0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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.
This commit is contained in:
Bram Moolenaar
2020-05-07 14:07:25 +02:00
parent 3657686a0e
commit 8a1c101315
4 changed files with 6 additions and 9 deletions

View File

@@ -17,6 +17,7 @@ def s:ScriptFuncLoad(arg: string)
buffers buffers
echo arg echo arg
echo local echo local
echo &lines
echo v:version echo v:version
echo s:scriptvar echo s:scriptvar
echo g:globalvar echo g:globalvar
@@ -42,6 +43,7 @@ def Test_disassemble_load()
' EXEC \+buffers.*' .. ' EXEC \+buffers.*' ..
' LOAD arg\[-1\].*' .. ' LOAD arg\[-1\].*' ..
' LOAD $0.*' .. ' LOAD $0.*' ..
' LOADOPT &lines.*' ..
' LOADV v:version.*' .. ' LOADV v:version.*' ..
' LOADS s:scriptvar from .*test_vim9_disassemble.vim.*' .. ' LOADS s:scriptvar from .*test_vim9_disassemble.vim.*' ..
' LOADG g:globalvar.*' .. ' LOADG g:globalvar.*' ..

View File

@@ -1311,13 +1311,6 @@ def Test_vim9_comment()
'catch /pat/# comment', 'catch /pat/# comment',
'endtry', 'endtry',
], 'E488:') ], 'E488:')
CheckScriptFailure([
'vim9script',
'try',
' throw "pat"',
'catch /pat/# comment',
'endtry',
], 'E605:')
CheckDefFailure([ CheckDefFailure([
'try', 'try',
'echo "yes"', 'echo "yes"',

View File

@@ -746,6 +746,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
706,
/**/ /**/
705, 705,
/**/ /**/

View File

@@ -458,7 +458,7 @@ call_bfunc(int func_idx, int argcount, ectx_T *ectx)
{ {
typval_T argvars[MAX_FUNC_ARGS]; typval_T argvars[MAX_FUNC_ARGS];
int idx; int idx;
int called_emsg_before = called_emsg; int did_emsg_before = did_emsg;
if (call_prepare(argcount, argvars, ectx) == FAIL) if (call_prepare(argcount, argvars, ectx) == FAIL)
return FAIL; return FAIL;
@@ -470,7 +470,7 @@ call_bfunc(int func_idx, int argcount, ectx_T *ectx)
for (idx = 0; idx < argcount; ++idx) for (idx = 0; idx < argcount; ++idx)
clear_tv(&argvars[idx]); clear_tv(&argvars[idx]);
if (called_emsg != called_emsg_before) if (did_emsg != did_emsg_before)
return FAIL; return FAIL;
return OK; return OK;
} }