diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-02-12 21:32:47 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-02-12 21:32:47 +0100 |
commit | d9d7789b6fe5f2b4074375ee9f1c0bad3e4d3cfe (patch) | |
tree | c4f8094ae801dab2d4bed5e048ead94cb0922417 /src/testdir/test_vim9_script.vim | |
parent | ca753ec862f8191f1fc5ed161753704a488ed08d (diff) | |
download | vim-git-d9d7789b6fe5f2b4074375ee9f1c0bad3e4d3cfe.tar.gz |
patch 8.2.2503: Vim9: a caught error may leave something on the stackv8.2.2503
Problem: Vim9: a caught error may leave something on the stack.
Solution: Drop items from the stack if needed. (closes #7826)
Diffstat (limited to 'src/testdir/test_vim9_script.vim')
-rw-r--r-- | src/testdir/test_vim9_script.vim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 42a0d61dd..17b996f17 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -556,6 +556,16 @@ def Test_try_catch_throw() n = 411 endtry assert_equal(411, n) + + var counter = 0 + for i in range(4) + try + eval [][0] + catch + endtry + counter += 1 + endfor + assert_equal(4, counter) enddef def Test_cnext_works_in_catch() |