Problem: Test fails where lines are skipped.
Solution: Only give an error when not skipping commands.
assert_fails('vim9script', 'E1038:')
v9.CheckDefFailure(['vim9script'], 'E1038:')
+
+ # no error when skipping
+ if has('nothing')
+ vim9script
+ endif
enddef
def Test_script_var_shadows_function()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4314,
/**/
4313,
/**/
break;
case CMD_vim9script:
- emsg(_(e_vim9script_can_only_be_used_in_script));
- goto erret;
+ if (cctx.ctx_skip != SKIP_YES)
+ {
+ emsg(_(e_vim9script_can_only_be_used_in_script));
+ goto erret;
+ }
+ line = (char_u *)"";
+ break;
case CMD_global:
if (check_global_and_subst(ea.cmd, p) == FAIL)