comparison src/userfunc.c @ 20538:9f921ba86d05 v8.2.0823

patch 8.2.0823: Vim9: script reload test is disabled Commit: https://github.com/vim/vim/commit/25e0f5863e9010a75a1ff0d04e8f886403968755 Author: Bram Moolenaar <Bram@vim.org> Date: Mon May 25 22:36:50 2020 +0200 patch 8.2.0823: Vim9: script reload test is disabled Problem: Vim9: script reload test is disabled. Solution: Compile a function in the context of the script where it was defined. Set execution stack for compiled function. Add a test that an error is reported for the right file/function.
author Bram Moolenaar <Bram@vim.org>
date Mon, 25 May 2020 22:45:03 +0200
parents cb4831fa7e25
children dd3165956464
comparison
equal deleted inserted replaced
20537:cceaa5ec43aa 20538:9f921ba86d05
1112 ga_init2(&fc->fc_funcs, sizeof(ufunc_T *), 1); 1112 ga_init2(&fc->fc_funcs, sizeof(ufunc_T *), 1);
1113 func_ptr_ref(fp); 1113 func_ptr_ref(fp);
1114 1114
1115 if (fp->uf_dfunc_idx != UF_NOT_COMPILED) 1115 if (fp->uf_dfunc_idx != UF_NOT_COMPILED)
1116 { 1116 {
1117 estack_push_ufunc(ETYPE_UFUNC, fp, 1); 1117 estack_push_ufunc(fp, 1);
1118 save_current_sctx = current_sctx; 1118 save_current_sctx = current_sctx;
1119 current_sctx = fp->uf_script_ctx; 1119 current_sctx = fp->uf_script_ctx;
1120 1120
1121 // Execute the compiled function. 1121 // Execute the function, possibly compiling it first.
1122 call_def_function(fp, argcount, argvars, funcexe->partial, rettv); 1122 call_def_function(fp, argcount, argvars, funcexe->partial, rettv);
1123 --depth; 1123 --depth;
1124 current_funccal = fc->caller; 1124 current_funccal = fc->caller;
1125 1125
1126 estack_pop(); 1126 estack_pop();
1286 { 1286 {
1287 using_sandbox = TRUE; 1287 using_sandbox = TRUE;
1288 ++sandbox; 1288 ++sandbox;
1289 } 1289 }
1290 1290
1291 estack_push_ufunc(ETYPE_UFUNC, fp, 1); 1291 estack_push_ufunc(fp, 1);
1292 ESTACK_CHECK_SETUP 1292 ESTACK_CHECK_SETUP
1293 if (p_verbose >= 12) 1293 if (p_verbose >= 12)
1294 { 1294 {
1295 ++no_wait_return; 1295 ++no_wait_return;
1296 verbose_enter_scroll(); 1296 verbose_enter_scroll();