0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 9.0.1625: "super" is not considered a reserved name

Problem:    "super" is not considered a reserved name.
Solution:   Add "super" to the list of reserved names. (closes #12515)
This commit is contained in:
Bram Moolenaar
2023-06-10 19:00:12 +01:00
parent 5ca05fa59e
commit ce723f3918
4 changed files with 31 additions and 5 deletions

View File

@@ -86,12 +86,23 @@ one_function_arg(
return arg;
}
// Vim9 script: cannot use script var name for argument. In function: also
// check local vars and arguments.
if (!skip && argtypes != NULL && check_defined(arg, p - arg,
evalarg == NULL ? NULL : evalarg->eval_cctx,
// Extra checks in Vim9 script.
if (!skip && argtypes != NULL)
{
int c = *p;
*p = NUL;
int r = check_reserved_name(arg, FALSE);
*p = c;
if (r == FAIL)
return arg;
// Cannot use script var name for argument. In function: also check
// local vars and arguments.
if (check_defined(arg, p - arg,
evalarg == NULL ? NULL : evalarg->eval_cctx,
eap == NULL ? NULL : eap->cstack, TRUE) == FAIL)
return arg;
return arg;
}
if (newargs != NULL && ga_grow(newargs, 1) == FAIL)
return arg;