0
0
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:
Bram Moolenaar
2023-06-10 16:45:13 +01:00
parent f07d1a7108
commit 5ca05fa59e
4 changed files with 38 additions and 4 deletions

View File

@@ -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