Patch 8.2.0279
Problem:    Vim9: no test for deleted :def function.
Solution:   Add a test.  Clear uf_cleared flag when redefining a function.
Files:      src/userfunc.c, src/testdir/test_vim9_script.vim


*** ../vim-8.2.0278/src/userfunc.c      2020-02-17 10:01:20.314906811 +0100
--- src/userfunc.c      2020-02-19 15:07:59.441658191 +0100
***************
*** 3053,3058 ****
--- 3053,3059 ----
        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)
*** ../vim-8.2.0278/src/testdir/test_vim9_script.vim    2020-02-06 
20:39:41.485183084 +0100
--- src/testdir/test_vim9_script.vim    2020-02-19 15:34:53.428335789 +0100
***************
*** 477,481 ****
--- 477,502 ----
    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
*** ../vim-8.2.0278/src/version.c       2020-02-19 14:31:30.552772976 +0100
--- src/version.c       2020-02-19 15:46:23.758023295 +0100
***************
*** 740,741 ****
--- 740,743 ----
  {   /* Add new patch number below this line */
+ /**/
+     279,
  /**/

-- 
>From "know your smileys":
 8-O    "Omigod!!" (done "rm -rf *" ?)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202002191447.01JElL5J025481%40masaka.moolenaar.net.

Raspunde prin e-mail lui