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

patch 8.2.0696: Vim9: nested function does not work properly

Problem:    Vim9: nested function does not work properly
Solution:   Create a function reference.  Check argument count.
This commit is contained in:
Bram Moolenaar
2020-05-05 17:53:16 +02:00
parent 04b1269783
commit 0e65d3de0a
4 changed files with 30 additions and 31 deletions

View File

@@ -206,11 +206,6 @@ call_dfunc(int cdf_idx, int argcount_arg, ectx_T *ectx)
+ dfunc->df_varcount + dfunc->df_closure_count) == FAIL)
return FAIL;
// Closure may need the function context where it was defined.
// TODO: assuming current context.
ectx->ec_outer_stack = &ectx->ec_stack;
ectx->ec_outer_frame = ectx->ec_frame_idx;
// Move the vararg-list to below the missing optional arguments.
if (vararg_count > 0 && arg_to_add > 0)
*STACK_TV_BOT(arg_to_add - 1) = *STACK_TV_BOT(-1);