Mercurial > vim
comparison src/testdir/test_vim9_func.vim @ 27022:eebbcc83fb75 v8.2.4040
patch 8.2.4040: keeping track of allocated lines is too complicated
Commit: https://github.com/vim/vim/commit/9f1a39a5d1cd7989ada2d1cb32f97d84360e050f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 8 15:39:39 2022 +0000
patch 8.2.4040: keeping track of allocated lines is too complicated
Problem: Keeping track of allocated lines in user functions is too
complicated.
Solution: Instead of freeing individual lines keep them all until the end.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 08 Jan 2022 16:45:02 +0100 |
parents | fceb494e22de |
children | 47dbeda35910 |
comparison
equal
deleted
inserted
replaced
27021:7c33c227c1ed | 27022:eebbcc83fb75 |
---|---|
1753 endfunc|BBBB | 1753 endfunc|BBBB |
1754 enddef | 1754 enddef |
1755 defcompile | 1755 defcompile |
1756 END | 1756 END |
1757 CheckScriptFailure(lines, 'E1173: Text found after endfunction: BBBB') | 1757 CheckScriptFailure(lines, 'E1173: Text found after endfunction: BBBB') |
1758 enddef | |
1759 | |
1760 def Test_error_in_function_args() | |
1761 var lines =<< trim END | |
1762 def FirstFunction() | |
1763 def SecondFunction(J = | |
1764 # Nois | |
1765 # one | |
1766 | |
1767 enddef|BBBB | |
1768 enddef | |
1769 # Compile all functions | |
1770 defcompile | |
1771 END | |
1772 CheckScriptFailure(lines, 'E488:') | |
1758 enddef | 1773 enddef |
1759 | 1774 |
1760 def Test_return_type_wrong() | 1775 def Test_return_type_wrong() |
1761 CheckScriptFailure([ | 1776 CheckScriptFailure([ |
1762 'def Func(): number', | 1777 'def Func(): number', |
2046 CheckUnix | 2061 CheckUnix |
2047 call Run_Test_free_dict_while_in_funcstack() | 2062 call Run_Test_free_dict_while_in_funcstack() |
2048 endfunc | 2063 endfunc |
2049 | 2064 |
2050 def Run_Test_free_dict_while_in_funcstack() | 2065 def Run_Test_free_dict_while_in_funcstack() |
2051 | |
2052 # this was freeing the TermRun() default argument dictionary while it was | 2066 # this was freeing the TermRun() default argument dictionary while it was |
2053 # still referenced in a funcstack_T | 2067 # still referenced in a funcstack_T |
2054 var lines =<< trim END | 2068 var lines =<< trim END |
2055 vim9script | 2069 vim9script |
2056 | 2070 |