Mercurial > vim
diff src/vim9expr.c @ 27843:532a0c5de1ec v8.2.4447
patch 8.2.4447: Vim9: can still use s:var in a compiled function
Commit: https://github.com/vim/vim/commit/afa048f0d4b5d63f2192c9ba340a9eb8b0822985
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 22 20:43:36 2022 +0000
patch 8.2.4447: Vim9: can still use s:var in a compiled function
Problem: Vim9: can still use s:var in a compiled function.
Solution: Disallow using s:var for Vim9 script. (closes https://github.com/vim/vim/issues/9824)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 22 Feb 2022 21:45:03 +0100 |
parents | 3813036f19cb |
children | 1012048eed26 |
line wrap: on
line diff
--- a/src/vim9expr.c +++ b/src/vim9expr.c @@ -422,8 +422,15 @@ compile_load( { case 'v': res = generate_LOADV(cctx, name, error); break; - case 's': if (is_expr && ASCII_ISUPPER(*name) - && find_func(name, FALSE) != NULL) + case 's': if (current_script_is_vim9()) + { + semsg(_(e_cannot_use_s_colon_in_vim9_script_str), + *arg); + vim_free(name); + return FAIL; + } + if (is_expr && ASCII_ISUPPER(*name) + && find_func(name, FALSE) != NULL) res = generate_funcref(cctx, name, FALSE); else res = compile_load_scriptvar(cctx, name,