Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
27842:4b3c59be80c7 | 27843:532a0c5de1ec |
---|---|
420 | 420 |
421 switch (**arg) | 421 switch (**arg) |
422 { | 422 { |
423 case 'v': res = generate_LOADV(cctx, name, error); | 423 case 'v': res = generate_LOADV(cctx, name, error); |
424 break; | 424 break; |
425 case 's': if (is_expr && ASCII_ISUPPER(*name) | 425 case 's': if (current_script_is_vim9()) |
426 && find_func(name, FALSE) != NULL) | 426 { |
427 semsg(_(e_cannot_use_s_colon_in_vim9_script_str), | |
428 *arg); | |
429 vim_free(name); | |
430 return FAIL; | |
431 } | |
432 if (is_expr && ASCII_ISUPPER(*name) | |
433 && find_func(name, FALSE) != NULL) | |
427 res = generate_funcref(cctx, name, FALSE); | 434 res = generate_funcref(cctx, name, FALSE); |
428 else | 435 else |
429 res = compile_load_scriptvar(cctx, name, | 436 res = compile_load_scriptvar(cctx, name, |
430 NULL, &end, error); | 437 NULL, &end, error); |
431 break; | 438 break; |