Mercurial > vim
diff src/vim9execute.c @ 20287:ce1b73835822 v8.2.0699
patch 8.2.0699: Vim9: not all errors tested
Commit: https://github.com/vim/vim/commit/015f4267f4a28627c1872042078a95be7e06c4dc
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 5 21:25:22 2020 +0200
patch 8.2.0699: Vim9: not all errors tested
Problem: Vim9: not all errors tested.
Solution: Add test for deleted function. Bail out on first error.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 05 May 2020 21:30:04 +0200 |
parents | 934657e365e5 |
children | 208b38bddc36 |
line wrap: on
line diff
--- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -432,6 +432,7 @@ call_bfunc(int func_idx, int argcount, e { typval_T argvars[MAX_FUNC_ARGS]; int idx; + int called_emsg_before = called_emsg; if (call_prepare(argcount, argvars, ectx) == FAIL) return FAIL; @@ -442,6 +443,9 @@ call_bfunc(int func_idx, int argcount, e // Clear the arguments. for (idx = 0; idx < argcount; ++idx) clear_tv(&argvars[idx]); + + if (called_emsg != called_emsg_before) + return FAIL; return OK; } @@ -549,7 +553,8 @@ call_partial(typval_T *tv, int argcount, if (name == NULL || call_by_name(name, argcount, ectx, NULL) == FAIL) { if (called_emsg == called_emsg_before) - semsg(_(e_unknownfunc), name); + semsg(_(e_unknownfunc), + name == NULL ? (char_u *)"[unknown]" : name); return FAIL; } return OK;