diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-17 15:44:52 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-17 15:44:52 +0100 |
commit | 0cdfb7ce462393595b0308dcabf343e82f05319d (patch) | |
tree | bce26a7c87ee0f99bc30006d3c0b02d813afc6da /src/testdir | |
parent | 8abb584ab85d5855d810d1c6e2b260f45ec839b7 (diff) |
patch 9.0.0485: in :def function all closures in loop get the same variablesv9.0.0485
Problem: In a :def function all closures in a loop get the same variables.
Solution: Make a copy of loop variables used in a closure.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_script.vim | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 8f9ffad2f6..85700b6c36 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -2285,9 +2285,7 @@ def Test_for_loop_with_closure() assert_equal(i, flist[i]()) endfor END - # FIXME - # v9.CheckDefAndScriptSuccess(lines) - v9.CheckScriptSuccess(['vim9script'] + lines) + v9.CheckDefAndScriptSuccess(lines) lines =<< trim END var flist: list<func> @@ -2301,9 +2299,7 @@ def Test_for_loop_with_closure() assert_equal(i, flist[i]()) endfor END - # FIXME - # v9.CheckDefAndScriptSuccess(lines) - v9.CheckScriptSuccess(['vim9script'] + lines) + v9.CheckDefAndScriptSuccess(lines) enddef def Test_for_loop_fails() |