if (func == NULL || *func == NUL)
return; // type error, empty name or null function
- char_u *p = func;
- tofree = trans_function_name(&p, NULL, FALSE, TFN_INT|TFN_QUIET);
- if (tofree == NULL)
+ if (argvars[0].v_type == VAR_STRING)
{
- emsg_funcname(e_unknown_function_str, func);
- return;
+ char_u *p = func;
+ tofree = trans_function_name(&p, NULL, FALSE, TFN_INT|TFN_QUIET);
+ if (tofree == NULL)
+ {
+ emsg_funcname(e_unknown_function_str, func);
+ return;
+ }
+ func = tofree;
}
- func = tofree;
if (argvars[2].v_type != VAR_UNKNOWN)
{
func Test_call()
call assert_equal(3, call('len', [123]))
call assert_equal(3, 'len'->call([123]))
+ call assert_equal(4, call({ x -> len(x) }, ['xxxx']))
+ call assert_equal(2, call(function('len'), ['xx']))
call assert_fails("call call('len', 123)", 'E1211:')
call assert_equal(0, call('', []))
call assert_equal(0, call('len', test_null_list()))
export def Run()
done = 0
Setup()
+ call(Setup, [])
+ call("Setup", [])
+ call(() => Setup(), [])
done += 1
enddef
END
imp.Run()
- assert_equal(1, setup)
+ assert_equal(4, setup)
assert_equal(1, imp.done)
END
v9.CheckScriptSuccess(lines)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1017,
/**/
1016,
/**/