0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.1425: Vim9: cannot use call() without :call

Problem:    Vim9: cannot use call() without :call.
Solution:   Do not skip over "call(". (closes #6689)
This commit is contained in:
Bram Moolenaar
2020-08-12 14:21:11 +02:00
parent 040f975fc1
commit 575f24b3f3
3 changed files with 16 additions and 1 deletions

View File

@@ -290,6 +290,12 @@ def Test_call_def_varargs()
CheckScriptFailure(lines, 'E1013:')
enddef
def Test_call_call()
let l = [3, 2, 1]
call('reverse', [l])
assert_equal([1, 2, 3], l)
enddef
let s:value = ''
def FuncOneDefArg(opt = 'text')

View File

@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1425,
/**/
1424,
/**/

View File

@@ -6484,8 +6484,15 @@ compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx)
cmdmod = save_cmdmod;
// Skip ":call" to get to the function name.
p = ea.cmd;
if (checkforcmd(&ea.cmd, "call", 3))
{
if (*ea.cmd == '(')
// not for "call()"
ea.cmd = p;
else
ea.cmd = skipwhite(ea.cmd);
}
if (!starts_with_colon)
{