1
0
forked from aniani/vim

patch 8.2.1700: Vim9: try/catch causes wrong value to be returned

Problem:    Vim9: try/catch causes wrong value to be returned.
Solution:   Reset tcd_return. (closes #6964)
This commit is contained in:
Bram Moolenaar
2020-09-16 22:29:52 +02:00
parent 916911f598
commit 9939f57b7f
3 changed files with 23 additions and 0 deletions

View File

@@ -1169,6 +1169,26 @@ def Test_try_catch_nested()
assert_equal('finally', g:in_finally)
enddef
def TryOne(): number
try
return 0
catch
endtry
return 0
enddef
def TryTwo(n: number): string
try
let x = {}
catch
endtry
return 'text'
enddef
def Test_try_catch_twice()
assert_equal('text', TryOne()->TryTwo())
enddef
def Test_try_catch_match()
let seq = 'a'
try