comparison src/testdir/test_vim9_script.vim @ 26490:cd452f46085e v8.2.3775

patch 8.2.3775: Vim9: lambda compiled without outer context when debugging Commit: https://github.com/vim/vim/commit/9fffef9f3562e05755e4b3c46509b2eeeb623ff7 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 10 16:55:58 2021 +0000 patch 8.2.3775: Vim9: lambda compiled without outer context when debugging Problem: Vim9: lambda compiled without outer context when debugging. Solution: When compiling a lambda for debugging also compile it without. (closes #9302)
author Bram Moolenaar <Bram@vim.org>
date Fri, 10 Dec 2021 18:00:05 +0100
parents 42471d3ac079
children 8861ece40b4b
comparison
equal deleted inserted replaced
26489:f19d8c077771 26490:cd452f46085e
4632 .. ' continued' 4632 .. ' continued'
4633 END 4633 END
4634 CheckDefExecAndScriptFailure(lines, 'some error continued', 1) 4634 CheckDefExecAndScriptFailure(lines, 'some error continued', 1)
4635 enddef 4635 enddef
4636 4636
4637 def Test_debug_with_lambda()
4638 CheckRunVimInTerminal
4639
4640 var lines =<< trim END
4641 vim9script
4642 def Func()
4643 var n = 0
4644 echo [0]->filter((_, v) => v == n)
4645 enddef
4646 breakadd func Func
4647 Func()
4648 END
4649 writefile(lines, 'XdebugFunc')
4650 var buf = RunVimInTerminal('-S XdebugFunc', {rows: 6, wait_for_ruler: 0})
4651 WaitForAssert(() => assert_match('^>', term_getline(buf, 6)))
4652
4653 term_sendkeys(buf, "cont\<CR>")
4654 WaitForAssert(() => assert_match('\[0\]', term_getline(buf, 5)))
4655
4656 StopVimInTerminal(buf)
4657 delete('XdebugFunc')
4658 enddef
4659
4637 def ProfiledWithLambda() 4660 def ProfiledWithLambda()
4638 var n = 3 4661 var n = 3
4639 echo [[1, 2], [3, 4]]->filter((_, l) => l[0] == n) 4662 echo [[1, 2], [3, 4]]->filter((_, l) => l[0] == n)
4640 enddef 4663 enddef
4641 4664