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

patch 8.2.2525: Vim9: only local variables checked for a name

Problem:    Vim9: only local variables checked for a name.
Solution:   Also check arguments and script variables. (closes #7838)
This commit is contained in:
Bram Moolenaar
2021-02-17 14:52:14 +01:00
parent 3aca5a6fbc
commit e0890d678d
5 changed files with 33 additions and 10 deletions

View File

@@ -323,6 +323,11 @@ def Test_for_linebreak()
CheckScriptSuccess(lines)
enddef
def MethodAfterLinebreak(arg: string)
arg
->setline(1)
enddef
def Test_method_call_linebreak()
var lines =<< trim END
vim9script
@@ -361,6 +366,11 @@ def Test_method_call_linebreak()
g:shortlist = [1, 2]
CheckDefAndScriptSuccess(lines)
unlet g:shortlist
new
MethodAfterLinebreak('foobar')
assert_equal('foobar', getline(1))
bwipe!
enddef
def Test_method_call_whitespace()