1
0
forked from aniani/vim

patch 8.2.3276: Vim9: exists() can only be evaluated at runtime

Problem:    Vim9: exists() can only be evaluated at runtime.
Solution:   Evaluate at compile time for option name literals. (closes #8437)
This commit is contained in:
Bram Moolenaar
2021-08-02 20:06:50 +02:00
parent 35578168be
commit bb7ee7abe1
5 changed files with 34 additions and 6 deletions

View File

@@ -790,6 +790,25 @@ enddef
def Test_exists()
CheckDefAndScriptFailure2(['exists(10)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
call assert_equal(1, exists('&tabstop'))
if exists('+newoption')
if &newoption == 'ok'
endif
endif
if exists('&newoption')
if &newoption == 'ok'
endif
endif
if exists('+tabstop')
assert_equal(8, &tabstop)
else
assert_report('tabstop option not existing?')
endif
if exists('&tabstop')
assert_equal(8, &tabstop)
else
assert_report('tabstop option not existing?')
endif
enddef
def Test_expand()