0
0
mirror of https://github.com/vim/vim.git synced 2025-10-01 04:54:07 -04:00

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 #7584)
This commit is contained in:
Bram Moolenaar
2021-01-01 16:10:46 +01:00
parent a8b8af19e4
commit 69f7050ceb
3 changed files with 79 additions and 38 deletions

View File

@@ -361,6 +361,35 @@ def Test_try_catch()
endtry
assert_equal(99, n)
var done = 'no'
if 0
try | catch | endtry
else
done = 'yes'
endif
assert_equal('yes', done)
done = 'no'
if 1
done = 'yes'
else
try | catch | endtry
done = 'never'
endif
assert_equal('yes', done)
if 1
else
try | catch /pat/ | endtry
try | catch /pat/
endtry
try
catch /pat/ | endtry
try
catch /pat/
endtry
endif
try
# string slice returns a string, not a number
n = g:astring[3]