comparison 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
comparison
equal deleted inserted replaced
25871:8a00c3caf60d 25872:a58520ab7c3b
2271 source XtestThrow 2271 source XtestThrow
2272 2272
2273 call delete('XtestThrow') 2273 call delete('XtestThrow')
2274 endfunc 2274 endfunc
2275 2275
2276 func ThisWillFail()
2277 try
2278 if x | endif
2279 catch
2280 for l in []
2281 finally
2282 endfunc
2283
2284 func Test_error_in_catch_and_finally()
2285 call assert_fails('call ThisWillFail()', ['E121:', 'E600:'])
2286 endfunc
2287
2276 2288
2277 " Modeline {{{1 2289 " Modeline {{{1
2278 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker 2290 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker