0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.1454: Vim9: failure invoking lambda with wrong arguments

Problem:    Vim9: failure invoking lambda with wrong arguments.
Solution:   Handle invalid arguments.  Add a test.
This commit is contained in:
Bram Moolenaar
2020-08-14 22:16:33 +02:00
parent 8de2f44ac6
commit 79e8db9a21
4 changed files with 17 additions and 1 deletions

View File

@@ -206,7 +206,10 @@ call_dfunc(int cdf_idx, int argcount_arg, ectx_T *ectx)
arg_to_add = ufunc->uf_args.ga_len - argcount;
if (arg_to_add < 0)
{
iemsg("Argument count wrong?");
if (arg_to_add == -1)
emsg(_("E1106: one argument too many"));
else
semsg(_("E1106: %d arguments too many"), -arg_to_add);
return FAIL;
}
if (ga_grow(&ectx->ec_stack, arg_to_add + 3