To: vim_dev@googlegroups.com Subject: Patch 8.2.0279 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@Moolenaar.net -- 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 ///