comparison src/testdir/test_vim9_func.vim @ 20189:63cc54100ae4 v8.2.0650

patch 8.2.0650: Vim9: script function can be deleted Commit: https://github.com/vim/vim/commit/4c17ad94ecb0a0fb26d6fface2614bc5172dea18 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 27 22:47:51 2020 +0200 patch 8.2.0650: Vim9: script function can be deleted Problem: Vim9: script function can be deleted. Solution: Disallow deleting script function. Delete functions when sourcing a script again.
author Bram Moolenaar <Bram@vim.org>
date Mon, 27 Apr 2020 23:00:03 +0200
parents fe8d0a4344df
children 23d75968ca5e
comparison
equal deleted inserted replaced
20188:085eb4da46f4 20189:63cc54100ae4
351 endfunc 351 endfunc
352 352
353 def Test_delfunc() 353 def Test_delfunc()
354 let lines =<< trim END 354 let lines =<< trim END
355 vim9script 355 vim9script
356 def GoneSoon() 356 def g:GoneSoon()
357 echo 'hello' 357 echo 'hello'
358 enddef 358 enddef
359 359
360 def CallGoneSoon() 360 def CallGoneSoon()
361 GoneSoon() 361 GoneSoon()
362 enddef 362 enddef
363 363
364 delfunc GoneSoon 364 delfunc g:GoneSoon
365 CallGoneSoon() 365 CallGoneSoon()
366 END 366 END
367 writefile(lines, 'XToDelFunc') 367 writefile(lines, 'XToDelFunc')
368 assert_fails('so XToDelFunc', 'E933') 368 assert_fails('so XToDelFunc', 'E933')
369 assert_fails('so XToDelFunc', 'E933') 369 assert_fails('so XToDelFunc', 'E933')