1
0
forked from aniani/vim

patch 8.2.1515: Vim9: can create s:var in legacy script but cannot unlet

Problem:    Vim9: can create s:var in legacy script but cannot unlet.
Solution:   Allow :unlet for legacy script var.
This commit is contained in:
Bram Moolenaar
2020-08-23 15:21:55 +02:00
parent dc0cf1db3e
commit 8436773fad
3 changed files with 22 additions and 2 deletions

View File

@@ -608,6 +608,13 @@ def Test_unlet()
assert_false(exists('g:somevar'))
unlet! g:somevar
# also works for script-local variable in legacy Vim script
s:somevar = 'legacy'
assert_true(exists('s:somevar'))
unlet s:somevar
assert_false(exists('s:somevar'))
unlet! s:somevar
call CheckScriptFailure([
'vim9script',
'let svar = 123',