Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 23576:4cd173b3d572 v8.2.2330
patch 8.2.2330: Vim9: crash when using :trow in a not executed block
Commit: https://github.com/vim/vim/commit/9e1d9e3473f852735ffd605a0fa4d224b81a4f0c
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jan 11 20:17:34 2021 +0100
patch 8.2.2330: Vim9: crash when using :trow in a not executed block
Problem: Vim9: crash when using :trow in a not executed block.
Solution: Don't generate the instruction when skipping. (closes https://github.com/vim/vim/issues/7659)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 11 Jan 2021 20:30:04 +0100 |
parents | b02ac00aacbf |
children | d228ca435f3a |
comparison
equal
deleted
inserted
replaced
23575:166557d5ba68 | 23576:4cd173b3d572 |
---|---|
322 | 322 |
323 func g:NoSuchFunc() | 323 func g:NoSuchFunc() |
324 echo 'none' | 324 echo 'none' |
325 endfunc | 325 endfunc |
326 | 326 |
327 def Test_try_catch() | 327 def Test_try_catch_throw() |
328 var l = [] | 328 var l = [] |
329 try # comment | 329 try # comment |
330 add(l, '1') | 330 add(l, '1') |
331 throw 'wrong' | 331 throw 'wrong' |
332 add(l, '2') | 332 add(l, '2') |
554 echo d.member | 554 echo d.member |
555 catch /E716:/ | 555 catch /E716:/ |
556 n = 411 | 556 n = 411 |
557 endtry | 557 endtry |
558 assert_equal(411, n) | 558 assert_equal(411, n) |
559 enddef | |
560 | |
561 def Test_throw_skipped() | |
562 if 0 | |
563 throw dontgethere | |
564 endif | |
559 enddef | 565 enddef |
560 | 566 |
561 def DeletedFunc(): list<any> | 567 def DeletedFunc(): list<any> |
562 return ['delete me'] | 568 return ['delete me'] |
563 enddef | 569 enddef |