0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.1826: Vim9: cannot use a {} block at script level

Problem:    Vim9: cannot use a {} block at script level.
Solution:   Recognize a {} block.
This commit is contained in:
Bram Moolenaar
2020-10-10 21:33:48 +02:00
parent d747548c66
commit 9becdf2b98
9 changed files with 76 additions and 5 deletions

View File

@@ -2733,6 +2733,27 @@ def Test_script_var_scope()
echo one
END
CheckScriptFailure(lines, 'E121:', 6)
lines =<< trim END
vim9script
{
var one = 'one'
assert_equal('one', one)
}
assert_false(exists('one'))
assert_false(exists('s:one'))
END
CheckScriptSuccess(lines)
lines =<< trim END
vim9script
{
var one = 'one'
echo one
}
echo one
END
CheckScriptFailure(lines, 'E121:', 6)
enddef
" Keep this last, it messes up highlighting.