diff options
-rw-r--r-- | src/eval.c | 5 | ||||
-rw-r--r-- | src/testdir/test_vim9_cmd.vim | 13 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 223251090..47aaaad23 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2156,7 +2156,10 @@ eval0( && called_emsg == called_emsg_before && (flags & EVAL_CONSTANT) == 0) semsg(_(e_invexpr2), arg); - ret = FAIL; + + // Some of the expression may not have been consumed. Do not check for + // a next command to avoid more errors. + return FAIL; } if (eap != NULL) diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim index 162d79508..37fc559bf 100644 --- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -558,6 +558,19 @@ def Test_eval_command() ->Increment() assert_equal(111 + 3 + 4 + 5, g:val) unlet g:val + + var lines =<< trim END + vim9script + g:caught = 'no' + try + eval 123 || 0 + catch + g:caught = 'yes' + endtry + assert_equal('yes', g:caught) + unlet g:caught + END + CheckScriptSuccess(lines) enddef def Test_map_command() diff --git a/src/version.c b/src/version.c index b28638b44..a0bf9363c 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2094, +/**/ 2093, /**/ 2092, |