mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 9.0.1624: crash when calling object constructor
Problem: Crash when calling object constructor from legacy script. (Israel Chauca Fuentes) Solution: Pass a pointer for "ufunc". (closes #12502)
This commit is contained in:
@@ -1767,6 +1767,29 @@ def Test_closure_in_class()
|
||||
v9.CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_call_constructor_from_legacy()
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
|
||||
var newCalled = 'false'
|
||||
|
||||
class A
|
||||
def new()
|
||||
newCalled = 'true'
|
||||
enddef
|
||||
endclass
|
||||
|
||||
export def F(options = {}): any
|
||||
return A
|
||||
enddef
|
||||
|
||||
g:p = F()
|
||||
legacy call p.new()
|
||||
assert_equal('true', newCalled)
|
||||
END
|
||||
v9.CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_defer_with_object()
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
|
Reference in New Issue
Block a user