summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-02-22 20:43:36 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-22 20:43:36 +0000
commitafa048f0d4b5d63f2192c9ba340a9eb8b0822985 (patch)
tree1ee615badc0dc451a01bbe90a887c3d4460dd2d9 /src/vim9compile.c
parentfe73255c92b6cb54851f82fa32458340b736298d (diff)
downloadvim-git-afa048f0d4b5d63f2192c9ba340a9eb8b0822985.tar.gz
patch 8.2.4447: Vim9: can still use s:var in a compiled functionv8.2.4447
Problem: Vim9: can still use s:var in a compiled function. Solution: Disallow using s:var for Vim9 script. (closes #9824)
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 803f19c08..6eb6e160e 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1331,6 +1331,12 @@ compile_lhs(
char_u *rawname = lhs->lhs_name
+ (lhs->lhs_name[1] == ':' ? 2 : 0);
+ if (script_namespace && current_script_is_vim9())
+ {
+ semsg(_(e_cannot_use_s_colon_in_vim9_script_str),
+ var_start);
+ return FAIL;
+ }
if (is_decl)
{
if (script_namespace)