forked from aniani/vim
patch 8.2.3408: can delete a numbered function
Problem: Can delete a numbered function. (Naohiro Ono) Solution: Disallow deleting a numbered function. (closes #8760)
This commit is contained in:
@@ -434,6 +434,11 @@ func Test_del_func()
|
||||
func d.fn()
|
||||
return 1
|
||||
endfunc
|
||||
|
||||
" cannot delete the dict function by number
|
||||
let nr = substitute(execute('echo d'), '.*function(''\(\d\+\)'').*', '\1', '')
|
||||
call assert_fails('delfunction g:' .. nr, 'E475: Invalid argument: g:')
|
||||
|
||||
delfunc d.fn
|
||||
call assert_equal({'a' : 10}, d)
|
||||
endfunc
|
||||
|
Reference in New Issue
Block a user