Problem: Vim9: locked script variable can be changed.
Solution: Check legacy script variable for being locked. (issue #8031)
enddef
SetLocked()
END
- CheckScriptFailure(lines, 'E741: Value is locked: name')
+ CheckScriptFailure(lines, 'E741: Value is locked: name', 1)
+
+ lines =<< trim END
+ let s:legacy = 'one'
+ lockvar s:legacy
+ def SetLocked()
+ s:legacy = 'two'
+ enddef
+ call SetLocked()
+ END
+ CheckScriptFailure(lines, 'E741: Value is locked: s:legacy', 1)
lines =<< trim END
vim9script
SetGlobalConst()
g:globConst = 234
END
- CheckScriptFailure(lines, 'E741: Value is locked: globConst')
+ CheckScriptFailure(lines, 'E741: Value is locked: globConst', 1)
unlet g:globConst
lines =<< trim END
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2693,
/**/
2692,
/**/
store_var(name, STACK_TV_BOT(0));
else
{
+ SOURCING_LNUM = iptr->isn_lnum;
+ if (var_check_permission(di, name) == FAIL)
+ goto on_error;
clear_tv(&di->di_tv);
di->di_tv = *STACK_TV_BOT(0);
}