Mercurial > vim
comparison src/vim9execute.c @ 20281:ab8c8fd0f868 v8.2.0696
patch 8.2.0696: Vim9: nested function does not work properly
Commit: https://github.com/vim/vim/commit/0e65d3de0aeff00aa42ea899f1afd11f8b22b93e
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 5 17:53:16 2020 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 05 May 2020 18:00:04 +0200 |
parents | 49b50843e725 |
children | 934657e365e5 |
comparison
equal
deleted
inserted
replaced
20280:50e2e957cd0d | 20281:ab8c8fd0f868 |
---|---|
203 return FAIL; | 203 return FAIL; |
204 } | 204 } |
205 if (ga_grow(&ectx->ec_stack, arg_to_add + 3 | 205 if (ga_grow(&ectx->ec_stack, arg_to_add + 3 |
206 + dfunc->df_varcount + dfunc->df_closure_count) == FAIL) | 206 + dfunc->df_varcount + dfunc->df_closure_count) == FAIL) |
207 return FAIL; | 207 return FAIL; |
208 | |
209 // Closure may need the function context where it was defined. | |
210 // TODO: assuming current context. | |
211 ectx->ec_outer_stack = &ectx->ec_stack; | |
212 ectx->ec_outer_frame = ectx->ec_frame_idx; | |
213 | 208 |
214 // Move the vararg-list to below the missing optional arguments. | 209 // Move the vararg-list to below the missing optional arguments. |
215 if (vararg_count > 0 && arg_to_add > 0) | 210 if (vararg_count > 0 && arg_to_add > 0) |
216 *STACK_TV_BOT(arg_to_add - 1) = *STACK_TV_BOT(-1); | 211 *STACK_TV_BOT(arg_to_add - 1) = *STACK_TV_BOT(-1); |
217 | 212 |