Mercurial > vim
diff src/testdir/test_vim9_disassemble.vim @ 25605:6f13d9ea0d04 v8.2.3339
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Commit: https://github.com/vim/vim/commit/aacc966c5d0ed91e33ed32b08f17cf4df3ca1394
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 13 19:40:51 2021 +0200
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Problem: Vim9: cannot lock a member in a local dict.
Solution: Get the local dict from the stack and pass it to get_lval().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 13 Aug 2021 19:45:03 +0200 |
parents | d8fb5bb88362 |
children | 27cb2e79ccde |
line wrap: on
line diff
--- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -588,6 +588,25 @@ def Test_disassemble_unlet() res) enddef +def s:LockLocal() + var d = {a: 1} + lockvar d.a +enddef + +def Test_disassemble_locl_local() + var res = execute('disass s:LockLocal') + assert_match('<SNR>\d*_LockLocal\_s*' .. + 'var d = {a: 1}\_s*' .. + '\d PUSHS "a"\_s*' .. + '\d PUSHNR 1\_s*' .. + '\d NEWDICT size 1\_s*' .. + '\d STORE $0\_s*' .. + 'lockvar d.a\_s*' .. + '\d LOAD $0\_s*' .. + '\d LOCKUNLOCK lockvar d.a\_s*', + res) +enddef + def s:ScriptFuncTry() try echo "yes"