comparison src/testdir/test_vim9_func.vim @ 28006:02f787034998 v8.2.4528

patch 8.2.4528: crash when using null_function for a partial Commit: https://github.com/vim/vim/commit/673bcb10ebe87ccf6954dd342d0143eb88cdfbcb Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 8 16:52:24 2022 +0000 patch 8.2.4528: crash when using null_function for a partial Problem: Crash when using null_function for a partial. Solution: Don't call fname_trans_sid() with NULL. (closes https://github.com/vim/vim/issues/9908)
author Bram Moolenaar <Bram@vim.org>
date Tue, 08 Mar 2022 18:00:04 +0100
parents 1012048eed26
children cc7d54a134e4
comparison
equal deleted inserted replaced
28005:8e6476e5578c 28006:02f787034998
3335 var Ref = function(Get, []) 3335 var Ref = function(Get, [])
3336 var RefRef = function(Ref, []) 3336 var RefRef = function(Ref, [])
3337 assert_equal(123, RefRef()) 3337 assert_equal(123, RefRef())
3338 enddef 3338 enddef
3339 3339
3340 def Test_partial_null_function()
3341 var lines =<< trim END
3342 var d: dict<func> = {f: null_function}
3343 var Ref = d.f
3344 assert_equal('func', typename(Ref))
3345 END
3346 v9.CheckDefAndScriptSuccess(lines)
3347 enddef
3348
3340 " Using "idx" from a legacy global function does not work. 3349 " Using "idx" from a legacy global function does not work.
3341 " This caused a crash when called from legacy context. 3350 " This caused a crash when called from legacy context.
3342 func Test_partial_call_fails() 3351 func Test_partial_call_fails()
3343 let lines =<< trim END 3352 let lines =<< trim END
3344 vim9script 3353 vim9script