mirror of
https://github.com/vim/vim.git
synced 2025-10-01 04:54:07 -04:00
patch 8.2.2543: Vim9: a return inside try/catch does not restore properly
Problem: Vim9: a return inside try/catch does not restore exception state properly. Solution: When there is no ":finally" jump to ":endtry". (closes #7882)
This commit is contained in:
@@ -589,6 +589,18 @@ def Test_try_catch_throw()
|
||||
assert_equal(4, ReturnInFinally())
|
||||
enddef
|
||||
|
||||
def Test_nocatch_return_in_try()
|
||||
# return in try block returns normally
|
||||
def ReturnInTry(): string
|
||||
try
|
||||
return '"some message"'
|
||||
catch
|
||||
endtry
|
||||
return 'not reached'
|
||||
enddef
|
||||
exe 'echoerr ' .. ReturnInTry()
|
||||
enddef
|
||||
|
||||
def Test_cnext_works_in_catch()
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
|
Reference in New Issue
Block a user