Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 23440:b0587f7ec422 v8.2.2263
patch 8.2.2263: Vim9: compilation error with try-catch in skipped block
Commit: https://github.com/vim/vim/commit/69f7050cebb0f069d6e39571961b9bbe8531c69a
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 1 16:10:46 2021 +0100
patch 8.2.2263: Vim9: compilation error with try-catch in skipped block
Problem: Vim9: compilation error with try-catch in skipped block.
Solution: Do not bail out when generate_instr() returns NULL. (closes https://github.com/vim/vim/issues/7584)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 01 Jan 2021 16:15:04 +0100 |
parents | 5807e3958e38 |
children | b02ac00aacbf |
comparison
equal
deleted
inserted
replaced
23439:ce571f96b8a7 | 23440:b0587f7ec422 |
---|---|
358 n = l[3] | 358 n = l[3] |
359 catch /E684:/ | 359 catch /E684:/ |
360 n = 99 | 360 n = 99 |
361 endtry | 361 endtry |
362 assert_equal(99, n) | 362 assert_equal(99, n) |
363 | |
364 var done = 'no' | |
365 if 0 | |
366 try | catch | endtry | |
367 else | |
368 done = 'yes' | |
369 endif | |
370 assert_equal('yes', done) | |
371 | |
372 done = 'no' | |
373 if 1 | |
374 done = 'yes' | |
375 else | |
376 try | catch | endtry | |
377 done = 'never' | |
378 endif | |
379 assert_equal('yes', done) | |
380 | |
381 if 1 | |
382 else | |
383 try | catch /pat/ | endtry | |
384 try | catch /pat/ | |
385 endtry | |
386 try | |
387 catch /pat/ | endtry | |
388 try | |
389 catch /pat/ | |
390 endtry | |
391 endif | |
363 | 392 |
364 try | 393 try |
365 # string slice returns a string, not a number | 394 # string slice returns a string, not a number |
366 n = g:astring[3] | 395 n = g:astring[3] |
367 catch /E1012:/ | 396 catch /E1012:/ |