Support dynamic import calls (#4652)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-07-24 09:26:46 +02:00
committed by GitHub
parent d9360f51d0
commit d4178ae386
21 changed files with 698 additions and 114 deletions
+12
View File
@@ -2424,6 +2424,18 @@ parser_parse_import_statement (parser_context_t *context_p) /**< parser context
JERRY_ASSERT (context_p->token.type == LEXER_KEYW_IMPORT);
JERRY_ASSERT (context_p->module_names_p == NULL);
if (lexer_check_next_character (context_p, LIT_CHAR_LEFT_PAREN))
{
if (context_p->status_flags & PARSER_IS_FUNCTION)
{
parser_parse_expression_statement (context_p, PARSE_EXPR);
return;
}
parser_parse_block_expression (context_p, PARSE_EXPR);
return;
}
parser_module_check_request_place (context_p);
lexer_next_token (context_p);