mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.2.4331: Vim9: no test for existing script variable in block
Problem: Vim9: no test for existing script variable in block. Solution: Add a test.
This commit is contained in:
@@ -1028,11 +1028,35 @@ def Test_call_wrong_args()
|
||||
vim9script
|
||||
var name = 'piet'
|
||||
def FuncOne(name: string)
|
||||
echo nr
|
||||
echo name
|
||||
enddef
|
||||
END
|
||||
v9.CheckScriptFailure(lines, 'E1168:')
|
||||
|
||||
# same, inside the same block
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
if true
|
||||
var name = 'piet'
|
||||
def FuncOne(name: string)
|
||||
echo name
|
||||
enddef
|
||||
endif
|
||||
END
|
||||
v9.CheckScriptFailure(lines, 'E1168:')
|
||||
|
||||
# variable in other block is OK
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
if true
|
||||
var name = 'piet'
|
||||
endif
|
||||
def FuncOne(name: string)
|
||||
echo name
|
||||
enddef
|
||||
END
|
||||
v9.CheckScriptSuccess(lines)
|
||||
|
||||
# argument name declared later is only found when compiling
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
|
@@ -746,6 +746,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
4331,
|
||||
/**/
|
||||
4330,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user