diff src/eval.c @ 24717:bf8feac8a89a v8.2.2897

patch 8.2.2897: Vim9: can use reserved words at the script level Commit: https://github.com/vim/vim/commit/d0edaf9dc253e619ccc321ceaac321aee11c1ea5 Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 28 21:06:08 2021 +0200 patch 8.2.2897: Vim9: can use reserved words at the script level Problem: Vim9: can use reserved words at the script level. Solution: Check variable names for reserved words. (closes https://github.com/vim/vim/issues/8253)
author Bram Moolenaar <Bram@vim.org>
date Fri, 28 May 2021 21:15:03 +0200
parents 34a5329b85aa
children ca0f983f08cf
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -1309,6 +1309,9 @@ set_var_lval(
     {
 	cc = *endp;
 	*endp = NUL;
+	if (in_vim9script() && check_reserved_name(lp->ll_name) == FAIL)
+	    return;
+
 	if (lp->ll_blob != NULL)
 	{
 	    int	    error = FALSE, val;