diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-04-09 17:24:52 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-04-09 17:24:52 +0200 |
commit | 767034c5b82ba8999d9fed2f997436e6e3e99419 (patch) | |
tree | b41c9572fc063a1bd77a6b2347d9148ef9955760 /src/userfunc.c | |
parent | dcae51facc4d6de1edd62f0242b40972be841103 (diff) |
patch 8.2.2739: Vim9: a lambda accepts too many arguments at the script levelv8.2.2739
Problem: Vim9: a lambda accepts too many arguments at the script level.
Solution: Do not set uf_varargs in Vim9 script.
Diffstat (limited to 'src/userfunc.c')
-rw-r--r-- | src/userfunc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index af107b0db6..81a73e2803 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -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; |