mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.1428: Vim9: :def function does not abort on nested function error
Problem: Vim9: :def function does not abort on nested function error. Solution: Check whether an error message was given. (closes #6691)
This commit is contained in:
@@ -1054,6 +1054,24 @@ def Test_throw_vimscript()
|
||||
CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_error_in_nested_function()
|
||||
# an error in a nested :function aborts executin in the calling :def function
|
||||
let lines =<< trim END
|
||||
vim9script
|
||||
def Func()
|
||||
Error()
|
||||
g:test_var = 1
|
||||
enddef
|
||||
func Error() abort
|
||||
eval [][0]
|
||||
endfunc
|
||||
Func()
|
||||
END
|
||||
g:test_var = 0
|
||||
CheckScriptFailure(lines, 'E684:')
|
||||
assert_equal(0, g:test_var)
|
||||
enddef
|
||||
|
||||
def Test_cexpr_vimscript()
|
||||
# only checks line continuation
|
||||
set errorformat=File\ %f\ line\ %l
|
||||
|
Reference in New Issue
Block a user