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:
@@ -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]
|
||||
|
Reference in New Issue
Block a user