* ArgumentList , )
*/
- parser->in_args = 1;
-
if (token->type == NJS_TOKEN_CLOSE_PARENTHESIS) {
njs_lexer_consume_token(parser->lexer, 1);
return njs_parser_stack_pop(parser);
}
+ parser->scope->in_args = 1;
+
njs_parser_next(parser, njs_parser_argument_list);
return njs_parser_after(parser, current, NULL, 1,
njs_parser_parenthesis_or_comma(njs_parser_t *parser, njs_lexer_token_t *token,
njs_queue_link_t *current)
{
- parser->in_args = 0;
+ parser->scope->in_args = 0;
if (token->type == NJS_TOKEN_CLOSE_PARENTHESIS) {
njs_lexer_consume_token(parser->lexer, 1);
node = parser->node;
- if (parser->in_args) {
+ if (scope->in_args) {
njs_parser_syntax_error(parser, "await in arguments not supported");
return NJS_ERROR;
}
"(async function() {f(await 111)})"),
njs_str("SyntaxError: await in arguments not supported in 1") },
+ { njs_str("Promise.all([async () => [await x('X')]])"),
+ njs_str("[object Promise]") },
+
+ { njs_str("async () => [await x(1)(),]; async () => [await x(1)()]"),
+ njs_str("[object AsyncFunction]") },
+
{ njs_str("function f(a, b, c) {}"
"(async function() {f(1, 'a', await 111)})"),
njs_str("SyntaxError: await in arguments not supported in 1") },