diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-08-05 22:48:11 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-08-05 22:48:11 +0200 |
commit | 5671f3f076573fa9133bc210d6580067698d9a1b (patch) | |
tree | f51db5d212f5b4391dace789663cf68d36d4c68c /src/evalfunc.c | |
parent | 6f6d58c3809010b1386634c1aeec61f1a66e72c2 (diff) | |
download | vim-git-5671f3f076573fa9133bc210d6580067698d9a1b.tar.gz |
patch 8.2.3299: Vim9: exists() does not handle much at compile timev8.2.3299
Problem: Vim9: exists() does not handle much at compile time.
Solution: Handle variable names. (closes #8688)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index 6db930ef2..af46d150a 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -3552,7 +3552,14 @@ f_exists(typval_T *argvars, typval_T *rettv) } else if (*p == '*') // internal or user defined function { + int save_version = current_sctx.sc_version; + + // Vim9 script assumes a function is script-local, but here we want to + // find any matching function. + if (current_sctx.sc_version == SCRIPT_VERSION_VIM9) + current_sctx.sc_version = SCRIPT_VERSION_MAX; n = function_exists(p + 1, FALSE); + current_sctx.sc_version = save_version; } else if (*p == '?') // internal function only { |