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:
@@ -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
|
||||
|
Reference in New Issue
Block a user