LibJS: Update the noted grammar for ImportDeclaration

This commit is contained in:
Timothy Flynn 2025-01-20 11:14:03 -05:00 committed by Andreas Kling
commit 7d420bbd3d
Notes: github-actions[bot] 2025-01-21 13:59:55 +00:00

View file

@ -4631,10 +4631,10 @@ static DeprecatedFlyString default_string_value = "default";
NonnullRefPtr<ImportStatement const> Parser::parse_import_statement(Program& program) NonnullRefPtr<ImportStatement const> Parser::parse_import_statement(Program& program)
{ {
// We use the extended syntax which adds: // We use the extended syntax which adds:
// ImportDeclaration: // ImportDeclaration:
// import ImportClause FromClause [no LineTerminator here] WithClause; // import ImportClause FromClause WithClause[opt] ;
// import ModuleSpecifier [no LineTerminator here] WithClause; // import ModuleSpecifier WithClause[opt] ;
// From: https://tc39.es/proposal-import-attributes/#prod-ImportDeclaration // From: https://tc39.es/proposal-import-attributes/#prod-ImportDeclaration
auto rule_start = push_start(); auto rule_start = push_start();
if (program.type() != Program::Type::Module) if (program.type() != Program::Type::Module)