Mercurial > vim
changeset 20301:e1a8d2040bd7 v8.2.0706
patch 8.2.0706: Vim9: using assert_fails() causes function to finish
Commit: https://github.com/vim/vim/commit/8a1c1013153a7f08e014facac883a1987985d6db
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 7 14:07:25 2020 +0200
patch 8.2.0706: Vim9: using assert_fails() causes function to finish
Problem: Vim9: using assert_fails() causes function to finish.
Solution: Check did_emsg instead of called_emsg.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 07 May 2020 14:15:04 +0200 |
parents | 24252e7f14c4 |
children | 0f149bbdc5ea |
files | src/testdir/test_vim9_disassemble.vim src/testdir/test_vim9_script.vim src/version.c src/vim9execute.c |
diffstat | 4 files changed, 6 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -17,6 +17,7 @@ def s:ScriptFuncLoad(arg: string) buffers echo arg echo local + echo &lines echo v:version echo s:scriptvar echo g:globalvar @@ -42,6 +43,7 @@ def Test_disassemble_load() ' EXEC \+buffers.*' .. ' LOAD arg\[-1\].*' .. ' LOAD $0.*' .. + ' LOADOPT &lines.*' .. ' LOADV v:version.*' .. ' LOADS s:scriptvar from .*test_vim9_disassemble.vim.*' .. ' LOADG g:globalvar.*' ..
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -1311,13 +1311,6 @@ def Test_vim9_comment() 'catch /pat/# comment', 'endtry', ], 'E488:') - CheckScriptFailure([ - 'vim9script', - 'try', - ' throw "pat"', - 'catch /pat/# comment', - 'endtry', - ], 'E605:') CheckDefFailure([ 'try', 'echo "yes"',
--- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 706, +/**/ 705, /**/ 704,
--- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -458,7 +458,7 @@ call_bfunc(int func_idx, int argcount, e { typval_T argvars[MAX_FUNC_ARGS]; int idx; - int called_emsg_before = called_emsg; + int did_emsg_before = did_emsg; if (call_prepare(argcount, argvars, ectx) == FAIL) return FAIL; @@ -470,7 +470,7 @@ call_bfunc(int func_idx, int argcount, e for (idx = 0; idx < argcount; ++idx) clear_tv(&argvars[idx]); - if (called_emsg != called_emsg_before) + if (did_emsg != did_emsg_before) return FAIL; return OK; }