0
0
mirror of https://github.com/vim/vim.git synced 2025-10-18 07:54:29 -04:00

patch 8.1.1722: error when scriptversion is 2 a making a dictionary access

Problem:    Error when scriptversion is 2 a making a dictionary access.
Solution:   Parse the subscript even when not evaluating the sub-expression.
            (closes #4704)
This commit is contained in:
Bram Moolenaar
2019-07-20 21:11:13 +02:00
parent 63187f7932
commit 61343f0c44
3 changed files with 20 additions and 6 deletions

View File

@@ -176,6 +176,13 @@ func Test_vvar_scriptversion2()
call assert_true(v:versionlong > 8011525)
endfunc
func Test_dict_access_scriptversion2()
let l:x = {'foo': 1}
call assert_false(0 && l:x.foo)
call assert_true(1 && l:x.foo)
endfunc
func Test_scriptversion()
call writefile(['scriptversion 9'], 'Xversionscript')
call assert_fails('source Xversionscript', 'E999:')