Mercurial > vim
diff src/testdir/test_trycatch.vim @ 25872:a58520ab7c3b v8.2.3470
patch 8.2.3470: crash with error in :catch and also in :finally
Commit: https://github.com/vim/vim/commit/a684a684096ecef3fbaee39c573b47423235d6b1
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Oct 4 18:52:19 2021 +0100
patch 8.2.3470: crash with error in :catch and also in :finally
Problem: Crash with error in :catch and also in :finally.
Solution: Only discard an exception if there is one. (closes https://github.com/vim/vim/issues/8954)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 04 Oct 2021 20:00:06 +0200 |
parents | 5040fae521f6 |
children | 51694ef3902e |
line wrap: on
line diff
--- a/src/testdir/test_trycatch.vim +++ b/src/testdir/test_trycatch.vim @@ -2273,6 +2273,18 @@ func Test_user_command_function_call_wit call delete('XtestThrow') endfunc +func ThisWillFail() + try + if x | endif + catch + for l in [] + finally +endfunc + +func Test_error_in_catch_and_finally() + call assert_fails('call ThisWillFail()', ['E121:', 'E600:']) +endfunc + " Modeline {{{1 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker