Problem: Vim9: no test for deleted :def function.
Solution: Add a test. Clear uf_cleared flag when redefining a function.
assert_equal('three', IfElse(3))
enddef
+def Test_delfunc()
+ let lines =<< trim END
+ vim9script
+ def GoneSoon()
+ echo 'hello'
+ enddef
+
+ def CallGoneSoon()
+ GoneSoon()
+ enddef
+
+ delfunc GoneSoon
+ CallGoneSoon()
+ END
+ writefile(lines, 'XToDelFunc')
+ assert_fails('so XToDelFunc', 'E933')
+ assert_fails('so XToDelFunc', 'E933')
+
+ delete('XToDelFunc')
+enddef
+
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
flags |= FC_SANDBOX;
fp->uf_flags = flags;
fp->uf_calls = 0;
+ fp->uf_cleared = FALSE;
fp->uf_script_ctx = current_sctx;
fp->uf_script_ctx.sc_lnum += sourcing_lnum_top;
if (is_export)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 279,
/**/
278,
/**/