mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 9.0.1317: crash when using an unset object variable
Problem: Crash when using an unset object variable. Solution: Give an error instead. (closes #12005)
This commit is contained in:
@@ -182,6 +182,21 @@ def Test_class_interface_wrong_end()
|
||||
v9.CheckScriptFailure(lines, 'E476: Invalid command: endclass, expected endinterface')
|
||||
enddef
|
||||
|
||||
def Test_object_not_set()
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
|
||||
class State
|
||||
this.value = 'xyz'
|
||||
endclass
|
||||
|
||||
var state: State
|
||||
var db = {'xyz': 789}
|
||||
echo db[state.value]
|
||||
END
|
||||
v9.CheckScriptFailure(lines, 'E1360:')
|
||||
enddef
|
||||
|
||||
def Test_class_member_initializer()
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
|
Reference in New Issue
Block a user