0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.2739: Vim9: a lambda accepts too many arguments at the script level

Problem:    Vim9: a lambda accepts too many arguments at the script level.
Solution:   Do not set uf_varargs in Vim9 script.
This commit is contained in:
Bram Moolenaar
2021-04-09 17:24:52 +02:00
parent dcae51facc
commit 767034c5b8
4 changed files with 13 additions and 5 deletions

View File

@@ -1263,8 +1263,9 @@ get_lambda_tv(
#endif
if (sandbox)
flags |= FC_SANDBOX;
// can be called with more args than uf_args.ga_len
fp->uf_varargs = TRUE;
// In legacy script a lambda can be called with more args than
// uf_args.ga_len.
fp->uf_varargs = !in_vim9script();
fp->uf_flags = flags;
fp->uf_calls = 0;
fp->uf_script_ctx = current_sctx;