mirror of
https://github.com/vim/vim.git
synced 2025-10-01 04:54:07 -04:00
patch 8.2.3065: Vim9: error when sourcing script twice and reusing function
Problem: Vim9: error when sourcing script twice and reusing a function name. Solution: Check if the function is dead. (closes #8463)
This commit is contained in:
@@ -1519,6 +1519,27 @@ def Test_vim9script_reload_noclear()
|
||||
delete('XExportReload')
|
||||
delfunc g:Values
|
||||
unlet g:loadCount
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
def Inner()
|
||||
enddef
|
||||
END
|
||||
lines->writefile('XreloadScript.vim')
|
||||
source XreloadScript.vim
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
def Outer()
|
||||
def Inner()
|
||||
enddef
|
||||
enddef
|
||||
defcompile
|
||||
END
|
||||
lines->writefile('XreloadScript.vim')
|
||||
source XreloadScript.vim
|
||||
|
||||
delete('XreloadScript.vim')
|
||||
enddef
|
||||
|
||||
def Test_vim9script_reload_import()
|
||||
|
Reference in New Issue
Block a user