diff src/testdir/test_vim9_builtin.vim @ 28233:e31f1a949d4e v8.2.4643

patch 8.2.4643: Vim9: variable may be locked unintentionally Commit: https://github.com/vim/vim/commit/24565cf27bc28cbd73f10e5ddf1e4ef53038a426 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Mar 28 18:16:52 2022 +0100 patch 8.2.4643: Vim9: variable may be locked unintentionally Problem: Vim9: variable may be locked unintentionally. Solution: Clear "v_lock". (closes https://github.com/vim/vim/issues/10036)
author Bram Moolenaar <Bram@vim.org>
date Mon, 28 Mar 2022 19:30:03 +0200
parents 662d2d5db9a6
children 425700af491b
line wrap: on
line diff
--- a/src/testdir/test_vim9_builtin.vim
+++ b/src/testdir/test_vim9_builtin.vim
@@ -371,10 +371,17 @@ def Test_bufname()
   assert_fails('bufname([])', 'E1220:')
 enddef
 
+let s:bufnr_res = 0
+
 def Test_bufnr()
   var buf = bufnr()
   bufnr('%')->assert_equal(buf)
 
+  # check the lock is not taken over through the stack
+  const nr = 10
+  bufnr_res = bufnr()
+  bufnr_res = 12345
+
   buf = bufnr('Xdummy', true)
   buf->assert_notequal(-1)
   exe 'bwipe! ' .. buf