0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.2.4168: disallowing empty function name breaks existing plugins

Problem:    Disallowing empty function name breaks existing plugins.
Solution:   Allow empty function name in legacy script.
This commit is contained in:
Bram Moolenaar
2022-01-21 10:32:58 +00:00
parent dd5893be34
commit e6a4200ff4
4 changed files with 12 additions and 2 deletions

View File

@@ -3693,8 +3693,8 @@ trans_function_name(
// Note that TFN_ flags use the same values as GLV_ flags.
end = get_lval(start, NULL, &lv, FALSE, skip, flags | GLV_READ_ONLY,
lead > 2 ? 0 : FNE_CHECK_START);
if (end == start
|| (end != NULL && end[-1] == AUTOLOAD_CHAR && *end == '('))
if (end == start || (in_vim9script() && end != NULL
&& end[-1] == AUTOLOAD_CHAR && *end == '('))
{
if (!skip)
emsg(_(e_function_name_required));