mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.3237: when a builtin function gives an error processing continues
Problem: When a builtin function gives an error processing continues. Solution: In Vim9 script return FAIL in get_func_tv().
This commit is contained in:
@@ -2002,5 +2002,20 @@ def Test_inc_dec()
|
||||
CheckDefAndScriptFailure(lines, "E1202: No white space allowed after '++': ++ nr")
|
||||
enddef
|
||||
|
||||
def Test_abort_after_error()
|
||||
# should abort after strpart() fails, not give another type error
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
var x: string
|
||||
x = strpart(1, 2)
|
||||
END
|
||||
writefile(lines, 'Xtestscript')
|
||||
var expected = 'E1174: String required for argument 1'
|
||||
assert_fails('so Xtestscript', [expected, expected], 3)
|
||||
|
||||
delete('Xtestscript')
|
||||
enddef
|
||||
|
||||
|
||||
|
||||
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
|
||||
|
Reference in New Issue
Block a user