Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 25057:ffc3e1164652 v8.2.3065
patch 8.2.3065: Vim9: error when sourcing script twice and reusing function
Commit: https://github.com/vim/vim/commit/577dc93da9ec78684576bff71328d40f24bd6dd8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 27 15:35:40 2021 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 27 Jun 2021 15:45:03 +0200 |
parents | faa3de7aed8b |
children | eac6e5a94e9d |
comparison
equal
deleted
inserted
replaced
25056:43593a5d873f | 25057:ffc3e1164652 |
---|---|
1517 | 1517 |
1518 delete('XReloaded') | 1518 delete('XReloaded') |
1519 delete('XExportReload') | 1519 delete('XExportReload') |
1520 delfunc g:Values | 1520 delfunc g:Values |
1521 unlet g:loadCount | 1521 unlet g:loadCount |
1522 | |
1523 lines =<< trim END | |
1524 vim9script | |
1525 def Inner() | |
1526 enddef | |
1527 END | |
1528 lines->writefile('XreloadScript.vim') | |
1529 source XreloadScript.vim | |
1530 | |
1531 lines =<< trim END | |
1532 vim9script | |
1533 def Outer() | |
1534 def Inner() | |
1535 enddef | |
1536 enddef | |
1537 defcompile | |
1538 END | |
1539 lines->writefile('XreloadScript.vim') | |
1540 source XreloadScript.vim | |
1541 | |
1542 delete('XreloadScript.vim') | |
1522 enddef | 1543 enddef |
1523 | 1544 |
1524 def Test_vim9script_reload_import() | 1545 def Test_vim9script_reload_import() |
1525 var lines =<< trim END | 1546 var lines =<< trim END |
1526 vim9script | 1547 vim9script |