mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.2692: Vim9: locked script variable can be changed
Problem: Vim9: locked script variable can be changed. Solution: Check for locked value. (closes #8031)
This commit is contained in:
@@ -1346,6 +1346,17 @@ def Test_var_declaration_fails()
|
||||
CheckScriptFailure(lines, 'E741:')
|
||||
unlet g:constvar
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
var name = 'one'
|
||||
lockvar name
|
||||
def SetLocked()
|
||||
name = 'two'
|
||||
enddef
|
||||
SetLocked()
|
||||
END
|
||||
CheckScriptFailure(lines, 'E741: Value is locked: name')
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
def SetGlobalConst()
|
||||
|
Reference in New Issue
Block a user