mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.3720: Vim9: Internal error when invoking closure in legacy context
Problem: Vim9: Internal error when invoking closure in legacy context. Solution: Give a more appropriate error message. (closes #9251)
This commit is contained in:
@@ -2733,7 +2733,13 @@ exec_instructions(ectx_T *ectx)
|
||||
if (outer == NULL)
|
||||
{
|
||||
SOURCING_LNUM = iptr->isn_lnum;
|
||||
iemsg("LOADOUTER depth more than scope levels");
|
||||
if (ectx->ec_frame_idx == ectx->ec_initial_frame_idx
|
||||
|| ectx->ec_outer_ref == NULL)
|
||||
// Possibly :def function called from legacy
|
||||
// context.
|
||||
emsg(_(e_closure_called_from_invalid_context));
|
||||
else
|
||||
iemsg("LOADOUTER depth more than scope levels");
|
||||
goto theend;
|
||||
}
|
||||
tv = ((typval_T *)outer->out_stack->ga_data)
|
||||
|
Reference in New Issue
Block a user