Implement import.meta object (#4766)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-09-15 17:44:16 +02:00
committed by GitHub
parent 386ec44d4d
commit 77c2602205
27 changed files with 528 additions and 93 deletions
+12 -1
View File
@@ -316,7 +316,11 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
{
lexer_next_token (context_p);
if (context_p->token.type != LEXER_LEFT_PAREN)
if (context_p->token.type == LEXER_DOT)
{
scanner_check_import_meta (context_p);
}
else if (context_p->token.type != LEXER_LEFT_PAREN)
{
scanner_raise_error (context_p);
}
@@ -1697,6 +1701,13 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
{
lexer_next_token (context_p);
if (context_p->token.type == LEXER_DOT)
{
scanner_check_import_meta (context_p);
scanner_context_p->mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
return SCAN_KEEP_TOKEN;
}
if (context_p->token.type == LEXER_LEFT_PAREN)
{
scanner_context_p->mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;