summaryrefslogtreecommitdiff
path: root/src/evalvars.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-02-13 13:56:29 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-13 13:56:29 +0000
commit75e27d78f5370e7d2e0898326d9b080937e7b090 (patch)
tree410ddc3fcf6d8ebd84883143ef78d8923e75233b /src/evalvars.c
parentcf6ad8ea8cff318877758b48d3786ab08251ab89 (diff)
downloadvim-git-75e27d78f5370e7d2e0898326d9b080937e7b090.tar.gz
patch 8.2.4371: Vim9: can create a script variable from a legacy functionv8.2.4371
Problem: Vim9: can create a script variable from a legacy function. Solution: Disallow creating a script variable from a function.
Diffstat (limited to 'src/evalvars.c')
-rw-r--r--src/evalvars.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/evalvars.c b/src/evalvars.c
index 994b9799c..d182a0e85 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -3504,6 +3504,12 @@ set_var_const(
semsg(_(e_cannot_use_str_itself_it_is_imported), name);
goto failed;
}
+ if (!in_vim9script())
+ {
+ semsg(_(e_cannot_create_vim9_script_variable_in_function_str),
+ name);
+ goto failed;
+ }
}
if (dest_tv == NULL)