Mercurial > vim
comparison src/testdir/test_vim9_disassemble.vim @ 21558:1c4d4aa22b37 v8.2.1329
patch 8.2.1329: Vim9: cannot define global function inside :def function
Commit: https://github.com/vim/vim/commit/38ddf333f6b2806b0ea2dd052ee1cd50dd7f4525
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 31 22:05:04 2020 +0200
patch 8.2.1329: Vim9: cannot define global function inside :def function
Problem: Vim9: cannot define global function inside :def function.
Solution: Assign to global variable instead of local. (closes https://github.com/vim/vim/issues/6584)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 31 Jul 2020 22:15:04 +0200 |
parents | 5cb6e676defd |
children | ef3b31d510d2 |
comparison
equal
deleted
inserted
replaced
21557:00c9f8522652 | 21558:1c4d4aa22b37 |
---|---|
697 '\d CONCAT\_s*' .. | 697 '\d CONCAT\_s*' .. |
698 '\d RETURN', | 698 '\d RETURN', |
699 instr) | 699 instr) |
700 enddef | 700 enddef |
701 | 701 |
702 def NestedOuter() | |
703 def g:Inner() | |
704 echomsg "inner" | |
705 enddef | |
706 enddef | |
707 | |
708 def Test_nested_func() | |
709 let instr = execute('disassemble NestedOuter') | |
710 assert_match('NestedOuter\_s*' .. | |
711 'def g:Inner()\_s*' .. | |
712 'echomsg "inner"\_s*' .. | |
713 'enddef\_s*' .. | |
714 '\d NEWFUNC <lambda>\d\+ Inner\_s*' .. | |
715 '\d PUSHNR 0\_s*' .. | |
716 '\d RETURN', | |
717 instr) | |
718 enddef | |
719 | |
702 def AndOr(arg: any): string | 720 def AndOr(arg: any): string |
703 if arg == 1 && arg != 2 || arg == 4 | 721 if arg == 1 && arg != 2 || arg == 4 |
704 return 'yes' | 722 return 'yes' |
705 endif | 723 endif |
706 return 'no' | 724 return 'no' |