diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index 9cb0b713a1261..39ca131d0b00a 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -2188,6 +2188,7 @@ pub struct ImportExpression<'a> { pub span: Span, pub source: Expression<'a>, pub arguments: Vec<'a, Expression<'a>>, + pub phase: Option, } #[ast(visit)] @@ -2198,6 +2199,7 @@ pub struct ImportDeclaration<'a> { /// `None` for `import 'foo'`, `Some([])` for `import {} from 'foo'` pub specifiers: Option>>, pub source: StringLiteral<'a>, + pub phase: Option, /// Some(vec![]) for empty assertion #[ts] pub with_clause: Option>>, @@ -2206,6 +2208,19 @@ pub struct ImportDeclaration<'a> { pub import_kind: ImportOrExportKind, } +/// Import Phase +/// +/// +/// +/// +#[ast] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[generate_derive(CloneIn, ContentEq, ContentHash, ESTree)] +pub enum ImportPhase { + Source = 0, + Defer = 1, +} + #[ast(visit)] #[derive(Debug)] #[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ContentHash, ESTree)] diff --git a/crates/oxc_ast/src/ast_impl/js.rs b/crates/oxc_ast/src/ast_impl/js.rs index 6baf3170e0aef..22525e55d0dba 100644 --- a/crates/oxc_ast/src/ast_impl/js.rs +++ b/crates/oxc_ast/src/ast_impl/js.rs @@ -1478,3 +1478,13 @@ impl<'a> ModuleExportName<'a> { } } } + +impl ImportPhase { + #[allow(missing_docs)] + pub fn as_str(&self) -> &'static str { + match self { + Self::Source => "source", + Self::Defer => "defer", + } + } +} diff --git a/crates/oxc_ast/src/generated/assert_layouts.rs b/crates/oxc_ast/src/generated/assert_layouts.rs index 43930945773f9..c2cf8232b18d2 100644 --- a/crates/oxc_ast/src/generated/assert_layouts.rs +++ b/crates/oxc_ast/src/generated/assert_layouts.rs @@ -697,19 +697,24 @@ const _: () = { assert!(offset_of!(AccessorProperty, type_annotation) == 88usize); assert!(offset_of!(AccessorProperty, accessibility) == 96usize); - assert!(size_of::() == 56usize); + assert!(size_of::() == 64usize); assert!(align_of::() == 8usize); assert!(offset_of!(ImportExpression, span) == 0usize); assert!(offset_of!(ImportExpression, source) == 8usize); assert!(offset_of!(ImportExpression, arguments) == 24usize); + assert!(offset_of!(ImportExpression, phase) == 56usize); - assert!(size_of::() == 96usize); + assert!(size_of::() == 104usize); assert!(align_of::() == 8usize); assert!(offset_of!(ImportDeclaration, span) == 0usize); assert!(offset_of!(ImportDeclaration, specifiers) == 8usize); assert!(offset_of!(ImportDeclaration, source) == 40usize); - assert!(offset_of!(ImportDeclaration, with_clause) == 80usize); - assert!(offset_of!(ImportDeclaration, import_kind) == 88usize); + assert!(offset_of!(ImportDeclaration, phase) == 80usize); + assert!(offset_of!(ImportDeclaration, with_clause) == 88usize); + assert!(offset_of!(ImportDeclaration, import_kind) == 96usize); + + assert!(size_of::() == 1usize); + assert!(align_of::() == 1usize); assert!(size_of::() == 16usize); assert!(align_of::() == 8usize); @@ -2254,19 +2259,24 @@ const _: () = { assert!(offset_of!(AccessorProperty, type_annotation) == 48usize); assert!(offset_of!(AccessorProperty, accessibility) == 52usize); - assert!(size_of::() == 32usize); + assert!(size_of::() == 36usize); assert!(align_of::() == 4usize); assert!(offset_of!(ImportExpression, span) == 0usize); assert!(offset_of!(ImportExpression, source) == 8usize); assert!(offset_of!(ImportExpression, arguments) == 16usize); + assert!(offset_of!(ImportExpression, phase) == 32usize); - assert!(size_of::() == 56usize); + assert!(size_of::() == 60usize); assert!(align_of::() == 4usize); assert!(offset_of!(ImportDeclaration, span) == 0usize); assert!(offset_of!(ImportDeclaration, specifiers) == 8usize); assert!(offset_of!(ImportDeclaration, source) == 24usize); - assert!(offset_of!(ImportDeclaration, with_clause) == 48usize); - assert!(offset_of!(ImportDeclaration, import_kind) == 52usize); + assert!(offset_of!(ImportDeclaration, phase) == 48usize); + assert!(offset_of!(ImportDeclaration, with_clause) == 52usize); + assert!(offset_of!(ImportDeclaration, import_kind) == 56usize); + + assert!(size_of::() == 1usize); + assert!(align_of::() == 1usize); assert!(size_of::() == 8usize); assert!(align_of::() == 4usize); diff --git a/crates/oxc_ast/src/generated/ast_builder.rs b/crates/oxc_ast/src/generated/ast_builder.rs index bd6064dcd80ed..0235f3a970ac0 100644 --- a/crates/oxc_ast/src/generated/ast_builder.rs +++ b/crates/oxc_ast/src/generated/ast_builder.rs @@ -833,14 +833,18 @@ impl<'a> AstBuilder<'a> { /// - span: The [`Span`] covering this node /// - source /// - arguments + /// - phase #[inline] pub fn expression_import( self, span: Span, source: Expression<'a>, arguments: Vec<'a, Expression<'a>>, + phase: Option, ) -> Expression<'a> { - Expression::ImportExpression(self.alloc(self.import_expression(span, source, arguments))) + Expression::ImportExpression( + self.alloc(self.import_expression(span, source, arguments, phase)), + ) } /// Build an [`Expression::LogicalExpression`] @@ -6587,6 +6591,7 @@ impl<'a> AstBuilder<'a> { /// - span: The [`Span`] covering this node /// - specifiers: `None` for `import 'foo'`, `Some([])` for `import {} from 'foo'` /// - source + /// - phase /// - with_clause: Some(vec![]) for empty assertion /// - import_kind: `import type { foo } from 'bar'` #[inline] @@ -6595,6 +6600,7 @@ impl<'a> AstBuilder<'a> { span: Span, specifiers: Option>>, source: StringLiteral<'a>, + phase: Option, with_clause: T1, import_kind: ImportOrExportKind, ) -> ModuleDeclaration<'a> @@ -6605,6 +6611,7 @@ impl<'a> AstBuilder<'a> { span, specifiers, source, + phase, with_clause, import_kind, ))) @@ -6836,14 +6843,16 @@ impl<'a> AstBuilder<'a> { /// - span: The [`Span`] covering this node /// - source /// - arguments + /// - phase #[inline] pub fn import_expression( self, span: Span, source: Expression<'a>, arguments: Vec<'a, Expression<'a>>, + phase: Option, ) -> ImportExpression<'a> { - ImportExpression { span, source, arguments } + ImportExpression { span, source, arguments, phase } } /// Build an [`ImportExpression`], and store it in the memory arena. @@ -6854,14 +6863,16 @@ impl<'a> AstBuilder<'a> { /// - span: The [`Span`] covering this node /// - source /// - arguments + /// - phase #[inline] pub fn alloc_import_expression( self, span: Span, source: Expression<'a>, arguments: Vec<'a, Expression<'a>>, + phase: Option, ) -> Box<'a, ImportExpression<'a>> { - Box::new_in(self.import_expression(span, source, arguments), self.allocator) + Box::new_in(self.import_expression(span, source, arguments, phase), self.allocator) } /// Build an [`ImportDeclaration`]. @@ -6872,6 +6883,7 @@ impl<'a> AstBuilder<'a> { /// - span: The [`Span`] covering this node /// - specifiers: `None` for `import 'foo'`, `Some([])` for `import {} from 'foo'` /// - source + /// - phase /// - with_clause: Some(vec![]) for empty assertion /// - import_kind: `import type { foo } from 'bar'` #[inline] @@ -6880,6 +6892,7 @@ impl<'a> AstBuilder<'a> { span: Span, specifiers: Option>>, source: StringLiteral<'a>, + phase: Option, with_clause: T1, import_kind: ImportOrExportKind, ) -> ImportDeclaration<'a> @@ -6890,6 +6903,7 @@ impl<'a> AstBuilder<'a> { span, specifiers, source, + phase, with_clause: with_clause.into_in(self.allocator), import_kind, } @@ -6903,6 +6917,7 @@ impl<'a> AstBuilder<'a> { /// - span: The [`Span`] covering this node /// - specifiers: `None` for `import 'foo'`, `Some([])` for `import {} from 'foo'` /// - source + /// - phase /// - with_clause: Some(vec![]) for empty assertion /// - import_kind: `import type { foo } from 'bar'` #[inline] @@ -6911,6 +6926,7 @@ impl<'a> AstBuilder<'a> { span: Span, specifiers: Option>>, source: StringLiteral<'a>, + phase: Option, with_clause: T1, import_kind: ImportOrExportKind, ) -> Box<'a, ImportDeclaration<'a>> @@ -6918,7 +6934,7 @@ impl<'a> AstBuilder<'a> { T1: IntoIn<'a, Option>>>, { Box::new_in( - self.import_declaration(span, specifiers, source, with_clause, import_kind), + self.import_declaration(span, specifiers, source, phase, with_clause, import_kind), self.allocator, ) } diff --git a/crates/oxc_ast/src/generated/derive_clone_in.rs b/crates/oxc_ast/src/generated/derive_clone_in.rs index e51cb7b1b80ed..7df8f1402b0dd 100644 --- a/crates/oxc_ast/src/generated/derive_clone_in.rs +++ b/crates/oxc_ast/src/generated/derive_clone_in.rs @@ -2225,6 +2225,7 @@ impl<'new_alloc> CloneIn<'new_alloc> for ImportExpression<'_> { span: CloneIn::clone_in(&self.span, allocator), source: CloneIn::clone_in(&self.source, allocator), arguments: CloneIn::clone_in(&self.arguments, allocator), + phase: CloneIn::clone_in(&self.phase, allocator), } } } @@ -2236,12 +2237,23 @@ impl<'new_alloc> CloneIn<'new_alloc> for ImportDeclaration<'_> { span: CloneIn::clone_in(&self.span, allocator), specifiers: CloneIn::clone_in(&self.specifiers, allocator), source: CloneIn::clone_in(&self.source, allocator), + phase: CloneIn::clone_in(&self.phase, allocator), with_clause: CloneIn::clone_in(&self.with_clause, allocator), import_kind: CloneIn::clone_in(&self.import_kind, allocator), } } } +impl<'alloc> CloneIn<'alloc> for ImportPhase { + type Cloned = ImportPhase; + fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { + match self { + Self::Source => ImportPhase::Source, + Self::Defer => ImportPhase::Defer, + } + } +} + impl<'new_alloc> CloneIn<'new_alloc> for ImportDeclarationSpecifier<'_> { type Cloned = ImportDeclarationSpecifier<'new_alloc>; fn clone_in(&self, allocator: &'new_alloc Allocator) -> Self::Cloned { diff --git a/crates/oxc_ast/src/generated/derive_content_eq.rs b/crates/oxc_ast/src/generated/derive_content_eq.rs index 5a01e0c9a540e..89dddee2ff2ac 100644 --- a/crates/oxc_ast/src/generated/derive_content_eq.rs +++ b/crates/oxc_ast/src/generated/derive_content_eq.rs @@ -2239,6 +2239,7 @@ impl ContentEq for ImportExpression<'_> { fn content_eq(&self, other: &Self) -> bool { ContentEq::content_eq(&self.source, &other.source) && ContentEq::content_eq(&self.arguments, &other.arguments) + && ContentEq::content_eq(&self.phase, &other.phase) } } @@ -2246,11 +2247,18 @@ impl ContentEq for ImportDeclaration<'_> { fn content_eq(&self, other: &Self) -> bool { ContentEq::content_eq(&self.specifiers, &other.specifiers) && ContentEq::content_eq(&self.source, &other.source) + && ContentEq::content_eq(&self.phase, &other.phase) && ContentEq::content_eq(&self.with_clause, &other.with_clause) && ContentEq::content_eq(&self.import_kind, &other.import_kind) } } +impl ContentEq for ImportPhase { + fn content_eq(&self, other: &Self) -> bool { + self == other + } +} + impl ContentEq for ImportDeclarationSpecifier<'_> { fn content_eq(&self, other: &Self) -> bool { match self { diff --git a/crates/oxc_ast/src/generated/derive_content_hash.rs b/crates/oxc_ast/src/generated/derive_content_hash.rs index 467e8f34538f5..53c742f2a0309 100644 --- a/crates/oxc_ast/src/generated/derive_content_hash.rs +++ b/crates/oxc_ast/src/generated/derive_content_hash.rs @@ -1227,6 +1227,7 @@ impl ContentHash for ImportExpression<'_> { fn content_hash(&self, state: &mut H) { ContentHash::content_hash(&self.source, state); ContentHash::content_hash(&self.arguments, state); + ContentHash::content_hash(&self.phase, state); } } @@ -1234,11 +1235,18 @@ impl ContentHash for ImportDeclaration<'_> { fn content_hash(&self, state: &mut H) { ContentHash::content_hash(&self.specifiers, state); ContentHash::content_hash(&self.source, state); + ContentHash::content_hash(&self.phase, state); ContentHash::content_hash(&self.with_clause, state); ContentHash::content_hash(&self.import_kind, state); } } +impl ContentHash for ImportPhase { + fn content_hash(&self, state: &mut H) { + ContentHash::content_hash(&discriminant(self), state); + } +} + impl ContentHash for ImportDeclarationSpecifier<'_> { fn content_hash(&self, state: &mut H) { ContentHash::content_hash(&discriminant(self), state); diff --git a/crates/oxc_ast/src/generated/derive_estree.rs b/crates/oxc_ast/src/generated/derive_estree.rs index 63d6d89ca5ecc..2a7d0f12c130e 100644 --- a/crates/oxc_ast/src/generated/derive_estree.rs +++ b/crates/oxc_ast/src/generated/derive_estree.rs @@ -1685,6 +1685,7 @@ impl Serialize for ImportExpression<'_> { self.span.serialize(serde::__private::ser::FlatMapSerializer(&mut map))?; map.serialize_entry("source", &self.source)?; map.serialize_entry("arguments", &self.arguments)?; + map.serialize_entry("phase", &self.phase)?; map.end() } } @@ -1696,12 +1697,22 @@ impl Serialize for ImportDeclaration<'_> { self.span.serialize(serde::__private::ser::FlatMapSerializer(&mut map))?; map.serialize_entry("specifiers", &self.specifiers)?; map.serialize_entry("source", &self.source)?; + map.serialize_entry("phase", &self.phase)?; map.serialize_entry("withClause", &self.with_clause)?; map.serialize_entry("importKind", &self.import_kind)?; map.end() } } +impl Serialize for ImportPhase { + fn serialize(&self, serializer: S) -> Result { + match *self { + ImportPhase::Source => serializer.serialize_unit_variant("ImportPhase", 0u32, "source"), + ImportPhase::Defer => serializer.serialize_unit_variant("ImportPhase", 1u32, "defer"), + } + } +} + impl Serialize for ImportDeclarationSpecifier<'_> { fn serialize(&self, serializer: S) -> Result { match self { diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index 644f0b446e962..008433e8a5d49 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -732,6 +732,10 @@ impl Gen for ImportDeclaration<'_> { if self.import_kind.is_type() { p.print_str(" type"); } + if let Some(phase) = self.phase { + p.print_hard_space(); + p.print_str(phase.as_str()); + } if let Some(specifiers) = &self.specifiers { if specifiers.is_empty() { p.print_soft_space(); @@ -1990,7 +1994,11 @@ impl GenExpr for ImportExpression<'_> { p.wrap(wrap, |p| { p.print_space_before_identifier(); p.add_source_mapping(self.span); - p.print_str("import("); + p.print_str("import"); + if let Some(phase) = self.phase { + p.print_str(phase.as_str()); + } + p.print_ascii_byte(b'('); if has_comment { p.indent(); } diff --git a/crates/oxc_isolated_declarations/src/module.rs b/crates/oxc_isolated_declarations/src/module.rs index 966405f0504c9..8722d05f7ab0f 100644 --- a/crates/oxc_isolated_declarations/src/module.rs +++ b/crates/oxc_isolated_declarations/src/module.rs @@ -141,6 +141,7 @@ impl<'a> IsolatedDeclarations<'a> { decl.span, Some(new_specifiers), decl.source.clone(), + None, decl.with_clause.clone_in(self.ast.allocator), decl.import_kind, )) diff --git a/crates/oxc_parser/src/diagnostics.rs b/crates/oxc_parser/src/diagnostics.rs index 9004040a298ca..e668b1521b151 100644 --- a/crates/oxc_parser/src/diagnostics.rs +++ b/crates/oxc_parser/src/diagnostics.rs @@ -456,6 +456,16 @@ pub fn duplicate_export(x0: &str, span1: Span, span2: Span) -> OxcDiagnostic { ]) } +#[cold] +pub fn import_meta(span: Span) -> OxcDiagnostic { + OxcDiagnostic::error("The only valid meta property for import is import.meta").with_label(span) +} + +#[cold] +pub fn new_target(span: Span) -> OxcDiagnostic { + OxcDiagnostic::error("The only valid meta property for new is new.target").with_label(span) +} + // ================================= MODIFIERS ================================= #[cold] diff --git a/crates/oxc_parser/src/js/expression.rs b/crates/oxc_parser/src/js/expression.rs index 5743d440f56c5..bb9be04956b05 100644 --- a/crates/oxc_parser/src/js/expression.rs +++ b/crates/oxc_parser/src/js/expression.rs @@ -184,15 +184,7 @@ impl<'a> ParserImpl<'a> { } Kind::New => self.parse_new_expression(), Kind::Super => Ok(self.parse_super()), - Kind::Import => { - let span = self.start_span(); - let identifier = self.parse_keyword_identifier(Kind::Import); - match self.cur_kind() { - Kind::Dot => self.parse_meta_property(span, identifier), - Kind::LParen => self.parse_import_expression(span), - _ => Err(self.unexpected()), - } - } + Kind::Import => self.parse_import_meta_or_call(), Kind::LParen => self.parse_parenthesized_expression(span), Kind::Slash | Kind::SlashEq => self .parse_literal_regexp() @@ -561,24 +553,40 @@ impl<'a> ParserImpl<'a> { ) } - /// Section 13.3 Meta Property - fn parse_meta_property( - &mut self, - span: Span, - meta: IdentifierName<'a>, - ) -> Result> { - self.bump_any(); // bump `.` - let kind = self.cur_kind(); - let property = match self.cur_kind() { - Kind::Meta => self.parse_keyword_identifier(Kind::Meta), - Kind::Target => self.parse_keyword_identifier(Kind::Target), - _ => self.parse_identifier_name()?, - }; - let span = self.end_span(span); - if kind == Kind::Meta { - self.module_record_builder.visit_import_meta(span); + /// Section 13.3 ImportCall or ImportMeta + fn parse_import_meta_or_call(&mut self) -> Result> { + let span = self.start_span(); + let meta = self.parse_keyword_identifier(Kind::Import); + match self.cur_kind() { + Kind::Dot => { + self.bump_any(); // bump `.` + match self.cur_kind() { + // `import.meta` + Kind::Meta => { + let property = self.parse_keyword_identifier(Kind::Meta); + let span = self.end_span(span); + self.module_record_builder.visit_import_meta(span); + Ok(self.ast.expression_meta_property(span, meta, property)) + } + // `import.source(expr)` + Kind::Source => { + self.bump_any(); + self.parse_import_expression(span, Some(ImportPhase::Source)) + } + // `import.defer(expr)` + Kind::Defer => { + self.bump_any(); + self.parse_import_expression(span, Some(ImportPhase::Defer)) + } + _ => { + self.bump_any(); + Err(diagnostics::import_meta(self.end_span(span))) + } + } + } + Kind::LParen => self.parse_import_expression(span, None), + _ => Err(self.unexpected()), } - Ok(self.ast.expression_meta_property(span, meta, property)) } /// Section 13.3 Left-Hand-Side Expression @@ -760,8 +768,15 @@ impl<'a> ParserImpl<'a> { fn parse_new_expression(&mut self) -> Result> { let span = self.start_span(); let identifier = self.parse_keyword_identifier(Kind::New); - if self.at(Kind::Dot) { - return self.parse_meta_property(span, identifier); + + if self.eat(Kind::Dot) { + return if self.at(Kind::Target) { + let property = self.parse_keyword_identifier(Kind::Target); + Ok(self.ast.expression_meta_property(self.end_span(span), identifier, property)) + } else { + self.bump_any(); + Err(diagnostics::new_target(self.end_span(span))) + }; } let rhs_span = self.start_span(); diff --git a/crates/oxc_parser/src/js/module.rs b/crates/oxc_parser/src/js/module.rs index 5e584677432b9..8f2540c00295b 100644 --- a/crates/oxc_parser/src/js/module.rs +++ b/crates/oxc_parser/src/js/module.rs @@ -10,8 +10,17 @@ use crate::{diagnostics, lexer::Kind, modifiers::Modifiers, Context, ParserImpl} impl<'a> ParserImpl<'a> { /// [Import Call](https://tc39.es/ecma262/#sec-import-calls) /// `ImportCall` : import ( `AssignmentExpression` ) - pub(crate) fn parse_import_expression(&mut self, span: Span) -> Result> { - self.bump_any(); // advance '(' + pub(crate) fn parse_import_expression( + &mut self, + span: Span, + phase: Option, + ) -> Result> { + self.expect(Kind::LParen)?; + + if self.eat(Kind::RParen) { + return Err(oxc_diagnostics::OxcDiagnostic::error("import() requires a specifier.") + .with_label(self.end_span(span))); + } let has_in = self.ctx.has_in(); self.ctx = self.ctx.and_in(true); @@ -25,7 +34,7 @@ impl<'a> ParserImpl<'a> { self.ctx = self.ctx.and_in(has_in); self.bump(Kind::Comma); self.expect(Kind::RParen)?; - Ok(self.ast.expression_import(self.end_span(span), expression, arguments)) + Ok(self.ast.expression_import(self.end_span(span), expression, arguments, phase)) } /// Section 16.2.2 Import Declaration @@ -45,7 +54,22 @@ impl<'a> ParserImpl<'a> { } // `import type ...` - let import_kind = self.parse_import_or_export_kind(); + // `import source ...` + // `import defer ...` + let mut import_kind = ImportOrExportKind::Value; + let mut phase = None; + match self.cur_kind() { + Kind::Source if self.peek_kind().is_binding_identifier() => { + self.bump_any(); + phase = Some(ImportPhase::Source); + } + Kind::Defer if self.peek_at(Kind::Star) => { + self.bump_any(); + phase = Some(ImportPhase::Defer); + } + Kind::Type if self.is_ts => import_kind = self.parse_import_or_export_kind(), + _ => {} + } let specifiers = if self.at(Kind::Str) { // import "source" @@ -64,6 +88,7 @@ impl<'a> ParserImpl<'a> { span, specifiers, source, + phase, with_clause, import_kind, ) diff --git a/crates/oxc_parser/src/lexer/byte_handlers.rs b/crates/oxc_parser/src/lexer/byte_handlers.rs index 140b60b6aced8..cbdefbc357f8b 100644 --- a/crates/oxc_parser/src/lexer/byte_handlers.rs +++ b/crates/oxc_parser/src/lexer/byte_handlers.rs @@ -560,6 +560,7 @@ ascii_identifier_handler!(L_D(id_without_first_char) match id_without_first_char "eclare" => Kind::Declare, "efault" => Kind::Default, "ebugger" => Kind::Debugger, + "efer" => Kind::Defer, _ => Kind::Ident, }); @@ -655,6 +656,7 @@ ascii_identifier_handler!(L_S(id_without_first_char) match id_without_first_char "ymbol" => Kind::Symbol, "tring" => Kind::String, "atisfies" => Kind::Satisfies, + "ource" => Kind::Source, _ => Kind::Ident, }); diff --git a/crates/oxc_parser/src/lexer/kind.rs b/crates/oxc_parser/src/lexer/kind.rs index 3b6eac6f8e124..00d6c38dcbe80 100644 --- a/crates/oxc_parser/src/lexer/kind.rs +++ b/crates/oxc_parser/src/lexer/kind.rs @@ -60,6 +60,8 @@ pub enum Kind { Set, Target, // new.target Accessor, // keyword from https://github.com/tc39/proposal-decorators + Source, // import.source https://github.com/tc39/proposal-source-phase-imports + Defer, // import.defer https://github.com/tc39/proposal-defer-import-eval // TypeScript Contextual Keywords Abstract, As, @@ -375,7 +377,9 @@ impl Kind { matches!(self, Async | From | Get | Meta | Of | Set | Target | Accessor | Abstract | As | Asserts | Assert | Any | Boolean | Constructor | Declare | Infer | Intrinsic | Is | KeyOf | Module | Namespace | Never | Out | Readonly | Require | Number | Object | Satisfies | String - | Symbol | Type | Undefined | Unique | Unknown | Using | Global | BigInt | Override) + | Symbol | Type | Undefined | Unique | Unknown | Using | Global | BigInt | Override + | Source | Defer + ) } #[rustfmt::skip] @@ -455,6 +459,7 @@ impl Kind { "using" => Using, "while" => While, "yield" => Yield, + "defer" => Defer, "assert" => Assert, "bigint" => BigInt, @@ -474,6 +479,7 @@ impl Kind { "target" => Target, "typeof" => Typeof, "unique" => Unique, + "source" => Source, "asserts" => Asserts, "boolean" => Boolean, @@ -566,6 +572,8 @@ impl Kind { Override => "override", Type => "type", Target => "target", + Source => "source", + Defer => "defer", Implements => "implements", Interface => "interface", Package => "package", diff --git a/crates/oxc_semantic/src/checker/javascript.rs b/crates/oxc_semantic/src/checker/javascript.rs index f121440033d39..be64aec7652d9 100644 --- a/crates/oxc_semantic/src/checker/javascript.rs +++ b/crates/oxc_semantic/src/checker/javascript.rs @@ -365,30 +365,18 @@ fn new_target(span: Span) -> OxcDiagnostic { .with_label(span) } -fn new_target_property(span: Span) -> OxcDiagnostic { - OxcDiagnostic::error("The only valid meta property for new is new.target").with_label(span) -} - fn import_meta(span: Span) -> OxcDiagnostic { OxcDiagnostic::error("Unexpected import.meta expression") .with_help("import.meta is only allowed in module code") .with_label(span) } -fn import_meta_property(span: Span) -> OxcDiagnostic { - OxcDiagnostic::error("The only valid meta property for import is import.meta").with_label(span) -} - pub fn check_meta_property<'a>(prop: &MetaProperty, node: &AstNode<'a>, ctx: &SemanticBuilder<'a>) { match prop.meta.name.as_str() { "import" => { - if prop.property.name == "meta" { - if ctx.source_type.is_script() { - return ctx.error(import_meta(prop.span)); - } - return; + if prop.property.name == "meta" && ctx.source_type.is_script() { + ctx.error(import_meta(prop.span)); } - ctx.error(import_meta_property(prop.span)); } "new" => { if prop.property.name == "target" { @@ -405,11 +393,9 @@ pub fn check_meta_property<'a>(prop: &MetaProperty, node: &AstNode<'a>, ctx: &Se } } if !in_function_scope { - return ctx.error(new_target(prop.span)); + ctx.error(new_target(prop.span)); } - return; } - ctx.error(new_target_property(prop.span)); } _ => {} } diff --git a/crates/oxc_transformer/src/common/module_imports.rs b/crates/oxc_transformer/src/common/module_imports.rs index ab6221004907c..76f1bbc0bee30 100644 --- a/crates/oxc_transformer/src/common/module_imports.rs +++ b/crates/oxc_transformer/src/common/module_imports.rs @@ -215,6 +215,7 @@ impl<'a> ModuleImportsStore<'a> { SPAN, Some(specifiers), ctx.ast.string_literal(SPAN, source, None), + None, NONE, ImportOrExportKind::Value, )) diff --git a/crates/oxc_transformer/src/plugins/inject_global_variables.rs b/crates/oxc_transformer/src/plugins/inject_global_variables.rs index c5ce8a83f4659..f4e5a6129f4cc 100644 --- a/crates/oxc_transformer/src/plugins/inject_global_variables.rs +++ b/crates/oxc_transformer/src/plugins/inject_global_variables.rs @@ -202,7 +202,7 @@ impl<'a> InjectGlobalVariables<'a> { let kind = ImportOrExportKind::Value; let import_decl = self .ast - .module_declaration_import_declaration(SPAN, specifiers, source, NONE, kind); + .module_declaration_import_declaration(SPAN, specifiers, source, None, NONE, kind); Statement::from(import_decl) }); program.body.splice(0..0, imports); diff --git a/crates/oxc_traverse/src/generated/ancestor.rs b/crates/oxc_traverse/src/generated/ancestor.rs index 3811baa090b2b..3ef295381bd9b 100644 --- a/crates/oxc_traverse/src/generated/ancestor.rs +++ b/crates/oxc_traverse/src/generated/ancestor.rs @@ -9260,6 +9260,7 @@ pub(crate) const OFFSET_IMPORT_EXPRESSION_SPAN: usize = offset_of!(ImportExpress pub(crate) const OFFSET_IMPORT_EXPRESSION_SOURCE: usize = offset_of!(ImportExpression, source); pub(crate) const OFFSET_IMPORT_EXPRESSION_ARGUMENTS: usize = offset_of!(ImportExpression, arguments); +pub(crate) const OFFSET_IMPORT_EXPRESSION_PHASE: usize = offset_of!(ImportExpression, phase); #[repr(transparent)] #[derive(Clone, Copy, Debug)] @@ -9281,6 +9282,14 @@ impl<'a, 't> ImportExpressionWithoutSource<'a, 't> { as *const Vec<'a, Expression<'a>>) } } + + #[inline] + pub fn phase(self) -> &'t Option { + unsafe { + &*((self.0 as *const u8).add(OFFSET_IMPORT_EXPRESSION_PHASE) + as *const Option) + } + } } impl<'a, 't> GetAddress for ImportExpressionWithoutSource<'a, 't> { @@ -9309,6 +9318,14 @@ impl<'a, 't> ImportExpressionWithoutArguments<'a, 't> { &*((self.0 as *const u8).add(OFFSET_IMPORT_EXPRESSION_SOURCE) as *const Expression<'a>) } } + + #[inline] + pub fn phase(self) -> &'t Option { + unsafe { + &*((self.0 as *const u8).add(OFFSET_IMPORT_EXPRESSION_PHASE) + as *const Option) + } + } } impl<'a, 't> GetAddress for ImportExpressionWithoutArguments<'a, 't> { @@ -9322,6 +9339,7 @@ pub(crate) const OFFSET_IMPORT_DECLARATION_SPAN: usize = offset_of!(ImportDeclar pub(crate) const OFFSET_IMPORT_DECLARATION_SPECIFIERS: usize = offset_of!(ImportDeclaration, specifiers); pub(crate) const OFFSET_IMPORT_DECLARATION_SOURCE: usize = offset_of!(ImportDeclaration, source); +pub(crate) const OFFSET_IMPORT_DECLARATION_PHASE: usize = offset_of!(ImportDeclaration, phase); pub(crate) const OFFSET_IMPORT_DECLARATION_WITH_CLAUSE: usize = offset_of!(ImportDeclaration, with_clause); pub(crate) const OFFSET_IMPORT_DECLARATION_IMPORT_KIND: usize = @@ -9348,6 +9366,14 @@ impl<'a, 't> ImportDeclarationWithoutSpecifiers<'a, 't> { } } + #[inline] + pub fn phase(self) -> &'t Option { + unsafe { + &*((self.0 as *const u8).add(OFFSET_IMPORT_DECLARATION_PHASE) + as *const Option) + } + } + #[inline] pub fn with_clause(self) -> &'t Option>> { unsafe { @@ -9393,6 +9419,14 @@ impl<'a, 't> ImportDeclarationWithoutSource<'a, 't> { } } + #[inline] + pub fn phase(self) -> &'t Option { + unsafe { + &*((self.0 as *const u8).add(OFFSET_IMPORT_DECLARATION_PHASE) + as *const Option) + } + } + #[inline] pub fn with_clause(self) -> &'t Option>> { unsafe { @@ -9446,6 +9480,14 @@ impl<'a, 't> ImportDeclarationWithoutWithClause<'a, 't> { } } + #[inline] + pub fn phase(self) -> &'t Option { + unsafe { + &*((self.0 as *const u8).add(OFFSET_IMPORT_DECLARATION_PHASE) + as *const Option) + } + } + #[inline] pub fn import_kind(self) -> &'t ImportOrExportKind { unsafe { diff --git a/npm/oxc-types/types.d.ts b/npm/oxc-types/types.d.ts index 62609c8f75ccd..0c36bac2f45b2 100644 --- a/npm/oxc-types/types.d.ts +++ b/npm/oxc-types/types.d.ts @@ -905,16 +905,20 @@ export interface ImportExpression extends Span { type: 'ImportExpression'; source: Expression; arguments: Array; + phase: ImportPhase | null; } export interface ImportDeclaration extends Span { type: 'ImportDeclaration'; specifiers: Array | null; source: StringLiteral; + phase: ImportPhase | null; withClause: WithClause | null; importKind: ImportOrExportKind; } +export type ImportPhase = 'source' | 'defer'; + export type ImportDeclarationSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier; export interface ImportSpecifier extends Span { diff --git a/tasks/coverage/snapshots/codegen_test262.snap b/tasks/coverage/snapshots/codegen_test262.snap index 0504077fee826..9aed4479e4016 100644 --- a/tasks/coverage/snapshots/codegen_test262.snap +++ b/tasks/coverage/snapshots/codegen_test262.snap @@ -1,5 +1,5 @@ commit: eefc5cf3 codegen_test262 Summary: -AST Parsed : 44037/44037 (100.00%) -Positive Passed: 44037/44037 (100.00%) +AST Parsed : 44169/44169 (100.00%) +Positive Passed: 44169/44169 (100.00%) diff --git a/tasks/coverage/snapshots/minifier_test262.snap b/tasks/coverage/snapshots/minifier_test262.snap index 619179383855b..7f91b4eeadb8d 100644 --- a/tasks/coverage/snapshots/minifier_test262.snap +++ b/tasks/coverage/snapshots/minifier_test262.snap @@ -1,5 +1,5 @@ commit: eefc5cf3 minifier_test262 Summary: -AST Parsed : 44037/44037 (100.00%) -Positive Passed: 44037/44037 (100.00%) +AST Parsed : 44169/44169 (100.00%) +Positive Passed: 44169/44169 (100.00%) diff --git a/tasks/coverage/snapshots/parser_babel.snap b/tasks/coverage/snapshots/parser_babel.snap index 5ec4f1590b5b0..a6c6ff2ceabe5 100644 --- a/tasks/coverage/snapshots/parser_babel.snap +++ b/tasks/coverage/snapshots/parser_babel.snap @@ -5680,10 +5680,10 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc · ╰── `)` expected ╰──── - × Unexpected token - ╭─[babel/packages/babel-parser/test/fixtures/es2020/dynamic-import/no-args/input.js:1:8] + × import() requires a specifier. + ╭─[babel/packages/babel-parser/test/fixtures/es2020/dynamic-import/no-args/input.js:1:1] 1 │ import(); - · ─ + · ──────── ╰──── × The only valid meta property for import is import.meta @@ -5719,10 +5719,10 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc · ╰── `)` expected ╰──── - × Unexpected token - ╭─[babel/packages/babel-parser/test/fixtures/es2020/dynamic-import-createImportExpression-false/no-args/input.js:1:8] + × import() requires a specifier. + ╭─[babel/packages/babel-parser/test/fixtures/es2020/dynamic-import-createImportExpression-false/no-args/input.js:1:1] 1 │ import(); - · ─ + · ──────── ╰──── × Unexpected import.meta expression @@ -8929,10 +8929,10 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc · ───────── ╰──── - × Unexpected token - ╭─[babel/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-dots/input.js:1:30] + × The only valid meta property for new is new.target + ╭─[babel/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-dots/input.js:1:26] 1 │ var x = function() { y = new..target; } - · ─ + · ───── ╰──── × Unexpected new.target expression diff --git a/tasks/coverage/snapshots/parser_test262.snap b/tasks/coverage/snapshots/parser_test262.snap index 18ccda581638c..ebc34fd2f6311 100644 --- a/tasks/coverage/snapshots/parser_test262.snap +++ b/tasks/coverage/snapshots/parser_test262.snap @@ -1,11 +1,39 @@ commit: eefc5cf3 parser_test262 Summary: -AST Parsed : 44037/44037 (100.00%) -Positive Passed: 44037/44037 (100.00%) -Negative Passed: 4320/4322 (99.95%) +AST Parsed : 44166/44169 (99.99%) +Positive Passed: 44166/44169 (99.99%) +Negative Passed: 4454/4456 (99.96%) Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attributes/json-invalid.js Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attributes/json-named-bindings.js +Expect to Parse: tasks/coverage/test262/test/language/import/import-defer/errors/resolution-error/import-defer-of-missing-module-fails.js + + × Expected `from` but found `string` + ╭─[test262/test/language/import/import-defer/errors/resolution-error/import-defer-of-missing-module-fails.js:22:22] + 21 │ + 22 │ import defer * as ns "./resolution-error_FIXTURE.js"; + · ───────────────┬─────────────── + · ╰── `from` expected + ╰──── +Expect to Parse: tasks/coverage/test262/test/language/import/import-defer/errors/syntax-error/import-defer-of-syntax-error-fails.js + + × Expected `from` but found `string` + ╭─[test262/test/language/import/import-defer/errors/syntax-error/import-defer-of-syntax-error-fails.js:22:22] + 21 │ + 22 │ import defer * as ns "./syntax-error_FIXTURE.js"; + · ─────────────┬───────────── + · ╰── `from` expected + ╰──── +Expect to Parse: tasks/coverage/test262/test/language/module-code/source-phase-import/import-source-binding-name.js + + × Expected `from` but found `string` + ╭─[test262/test/language/module-code/source-phase-import/import-source-binding-name.js:22:20] + 21 │ + 22 │ import source from ''; + · ─────────┬──────── + · ╰── `from` expected + 23 │ import from from ''; + ╰──── × '0'-prefixed octal literals and octal escape sequences are deprecated ╭─[test262/test/annexB/language/expressions/template-literal/legacy-octal-escape-sequence-strict.js:19:4] @@ -4712,11 +4740,18 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut · ─────────── ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/assignmenttargettype/direct-importcall.js:20:8] + × import() requires a specifier. + ╭─[test262/test/language/expressions/assignmenttargettype/direct-importcall-source.js:21:1] + 20 │ + 21 │ import.source() = 1; + · ─────────────── + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/assignmenttargettype/direct-importcall.js:20:1] 19 │ 20 │ import() = 1; - · ─ + · ──────── ╰──── × Cannot assign to this expression @@ -5808,11 +5843,18 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut · ─────────── ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/assignmenttargettype/parenthesized-importcall.js:23:9] + × import() requires a specifier. + ╭─[test262/test/language/expressions/assignmenttargettype/parenthesized-importcall-source.js:24:2] + 23 │ + 24 │ (import.source()) = 1; + · ─────────────── + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/assignmenttargettype/parenthesized-importcall.js:23:2] 22 │ 23 │ (import()) = 1; - · ─ + · ──────── ╰──── × Cannot assign to this expression @@ -14437,20 +14479,50 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut · ────────── ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expr-not-optional.js:35:10] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expr-not-optional.js:35:3] 34 │ let f = () => { 35 │ import(); - · ─ + · ──────── 36 │ }; ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-assignment-expr-not-optional.js:34:22] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-assignment-expr-not-optional.js:34:15] 33 │ 34 │ let f = () => import(); - · ─ + · ──────── + 35 │ + ╰──── + + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-call-unknown.js:36:15] 35 │ + 36 │ let f = () => import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 37 │ + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-source-assignment-expr-not-optional.js:35:15] + 34 │ + 35 │ let f = () => import.source(); + · ─────────────── + 36 │ + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-source-no-new-call-expression.js:38:19] + 37 │ + 38 │ let f = () => new import.source(''); + · ──────────────────────────────── + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-source-no-rest-param.js:43:29] + 42 │ + 43 │ let f = () => import.source(...['']); + · ─── ╰──── × Cannot use new with dynamic import @@ -14475,6 +14547,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut · ╰── `)` expected ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-typeof-import-call-source-property.js:36:35] + 35 │ + 36 │ let f = () => typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 37 │ + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-typeof-import-source.js:35:35] + 34 │ + 35 │ let f = () => typeof import.source; + · ┬ + · ╰── `(` expected + 36 │ + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-typeof-import.js:34:28] 33 │ @@ -14483,6 +14573,38 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 35 │ ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-call-unknown.js:37:3] + 36 │ let f = () => { + 37 │ import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 38 │ }; + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-source-assignment-expr-not-optional.js:36:3] + 35 │ let f = () => { + 36 │ import.source(); + · ─────────────── + 37 │ }; + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-source-no-new-call-expression.js:39:7] + 38 │ let f = () => { + 39 │ new import.source(''); + · ──────────────────────────────── + 40 │ }; + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-source-no-rest-param.js:44:17] + 43 │ let f = () => { + 44 │ import.source(...['']); + · ─── + 45 │ }; + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-no-new-call-expression.js:38:7] 37 │ let f = () => { @@ -14508,6 +14630,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 41 │ }; ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-typeof-import-call-source-property.js:37:23] + 36 │ let f = () => { + 37 │ typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 38 │ }; + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-typeof-import-source.js:36:23] + 35 │ let f = () => { + 36 │ typeof import.source; + · ┬ + · ╰── `(` expected + 37 │ }; + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-typeof-import.js:35:16] 34 │ let f = () => { @@ -14516,14 +14656,46 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 36 │ }; ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-assignment-expr-not-optional.js:35:16] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-assignment-expr-not-optional.js:35:9] 34 │ (async () => { 35 │ await import() - · ─ + · ──────── 36 │ }); ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-call-unknown.js:37:9] + 36 │ (async () => { + 37 │ await import.UNKNOWN('./empty_FIXTURE.js') + · ────────────── + 38 │ }); + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-source-assignment-expr-not-optional.js:36:9] + 35 │ (async () => { + 36 │ await import.source() + · ─────────────── + 37 │ }); + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-source-no-new-call-expression.js:39:13] + 38 │ (async () => { + 39 │ await new import.source('') + · ──────────────────────────────── + 40 │ }); + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-source-no-rest-param.js:44:23] + 43 │ (async () => { + 44 │ await import.source(...['']) + · ─── + 45 │ }); + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-no-new-call-expression.js:38:13] 37 │ (async () => { @@ -14549,6 +14721,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 41 │ }); ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-typeof-import-call-source-property.js:37:29] + 36 │ (async () => { + 37 │ await typeof import.source.UNKNOWN + · ┬ + · ╰── `(` expected + 38 │ }); + ╰──── + + × Expected `(` but found `}` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-typeof-import-source.js:37:1] + 36 │ await typeof import.source + 37 │ }); + · ┬ + · ╰── `(` expected + 38 │ + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-typeof-import.js:36:1] 35 │ await typeof import @@ -14557,14 +14747,44 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 37 │ ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-assignment-expr-not-optional.js:34:27] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-assignment-expr-not-optional.js:34:20] 33 │ 34 │ (async () => await import()) - · ─ + · ──────── 35 │ ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-call-unknown.js:36:20] + 35 │ + 36 │ (async () => await import.UNKNOWN('./empty_FIXTURE.js')) + · ────────────── + 37 │ + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-source-assignment-expr-not-optional.js:35:20] + 34 │ + 35 │ (async () => await import.source()) + · ─────────────── + 36 │ + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-source-no-new-call-expression.js:38:24] + 37 │ + 38 │ (async () => await new import.source('')) + · ──────────────────────────────── + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-source-no-rest-param.js:43:34] + 42 │ + 43 │ (async () => await import.source(...[''])) + · ─── + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-no-new-call-expression.js:37:24] 36 │ @@ -14587,6 +14807,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut · ╰── `)` expected ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-typeof-import-call-source-property.js:36:40] + 35 │ + 36 │ (async () => await typeof import.source.UNKNOWN) + · ┬ + · ╰── `(` expected + 37 │ + ╰──── + + × Expected `(` but found `)` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-typeof-import-source.js:35:40] + 34 │ + 35 │ (async () => await typeof import.source) + · ┬ + · ╰── `(` expected + 36 │ + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-typeof-import.js:34:33] 33 │ @@ -14595,22 +14833,54 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 35 │ ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-assignment-expr-not-optional.js:35:10] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-assignment-expr-not-optional.js:35:3] 34 │ async function f() { 35 │ import(); - · ─ + · ──────── 36 │ } ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-assignment-expr-not-optional.js:35:16] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-assignment-expr-not-optional.js:35:9] 34 │ async function f() { 35 │ await import(); - · ─ + · ──────── 36 │ } ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-call-unknown.js:37:9] + 36 │ async function f() { + 37 │ await import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 38 │ } + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-source-assignment-expr-not-optional.js:36:9] + 35 │ async function f() { + 36 │ await import.source(); + · ─────────────── + 37 │ } + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-source-no-new-call-expression.js:39:13] + 38 │ async function f() { + 39 │ await new import.source(''); + · ──────────────────────────────── + 40 │ } + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-source-no-rest-param.js:44:23] + 43 │ async function f() { + 44 │ await import.source(...['']); + · ─── + 45 │ } + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-no-new-call-expression.js:38:13] 37 │ async function f() { @@ -14636,6 +14906,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 41 │ } ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-typeof-import-call-source-property.js:37:29] + 36 │ async function f() { + 37 │ await typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 38 │ } + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-typeof-import-source.js:36:29] + 35 │ async function f() { + 36 │ await typeof import.source; + · ┬ + · ╰── `(` expected + 37 │ } + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-typeof-import.js:35:22] 34 │ async function f() { @@ -14644,6 +14932,38 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 36 │ } ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-call-unknown.js:37:3] + 36 │ async function f() { + 37 │ import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 38 │ } + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-source-assignment-expr-not-optional.js:36:3] + 35 │ async function f() { + 36 │ import.source(); + · ─────────────── + 37 │ } + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-source-no-new-call-expression.js:39:7] + 38 │ async function f() { + 39 │ new import.source(''); + · ──────────────────────────────── + 40 │ } + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-source-no-rest-param.js:44:17] + 43 │ async function f() { + 44 │ import.source(...['']); + · ─── + 45 │ } + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-no-new-call-expression.js:38:7] 37 │ async function f() { @@ -14669,14 +14989,46 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 41 │ } ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-assignment-expr-not-optional.js:35:23] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-assignment-expr-not-optional.js:35:16] 34 │ async function f() { 35 │ return await import(); - · ─ + · ──────── 36 │ } ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-call-unknown.js:37:16] + 36 │ async function f() { + 37 │ return await import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 38 │ } + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-source-assignment-expr-not-optional.js:36:16] + 35 │ async function f() { + 36 │ return await import.source(); + · ─────────────── + 37 │ } + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-source-no-new-call-expression.js:39:20] + 38 │ async function f() { + 39 │ return await new import.source(''); + · ──────────────────────────────── + 40 │ } + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-source-no-rest-param.js:44:30] + 43 │ async function f() { + 44 │ return await import.source(...['']); + · ─── + 45 │ } + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-no-new-call-expression.js:38:20] 37 │ async function f() { @@ -14702,6 +15054,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 41 │ } ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-typeof-import-call-source-property.js:37:36] + 36 │ async function f() { + 37 │ return await typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 38 │ } + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-typeof-import-source.js:36:36] + 35 │ async function f() { + 36 │ return await typeof import.source; + · ┬ + · ╰── `(` expected + 37 │ } + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-typeof-import.js:35:29] 34 │ async function f() { @@ -14710,6 +15080,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 36 │ } ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-typeof-import-call-source-property.js:37:23] + 36 │ async function f() { + 37 │ typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 38 │ } + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-typeof-import-source.js:36:23] + 35 │ async function f() { + 36 │ typeof import.source; + · ┬ + · ╰── `(` expected + 37 │ } + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-typeof-import.js:35:16] 34 │ async function f() { @@ -14718,14 +15106,46 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 36 │ } ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-assignment-expr-not-optional.js:35:16] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-assignment-expr-not-optional.js:35:9] 34 │ async function * f() { 35 │ await import() - · ─ + · ──────── 36 │ } ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-call-unknown.js:37:9] + 36 │ async function * f() { + 37 │ await import.UNKNOWN('./empty_FIXTURE.js') + · ────────────── + 38 │ } + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-source-assignment-expr-not-optional.js:36:9] + 35 │ async function * f() { + 36 │ await import.source() + · ─────────────── + 37 │ } + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-source-no-new-call-expression.js:39:13] + 38 │ async function * f() { + 39 │ await new import.source('') + · ──────────────────────────────── + 40 │ } + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-source-no-rest-param.js:44:23] + 43 │ async function * f() { + 44 │ await import.source(...['']) + · ─── + 45 │ } + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-no-new-call-expression.js:38:13] 37 │ async function * f() { @@ -14751,6 +15171,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 41 │ } ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-typeof-import-call-source-property.js:37:29] + 36 │ async function * f() { + 37 │ await typeof import.source.UNKNOWN + · ┬ + · ╰── `(` expected + 38 │ } + ╰──── + + × Expected `(` but found `}` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-typeof-import-source.js:37:1] + 36 │ await typeof import.source + 37 │ } + · ┬ + · ╰── `(` expected + 38 │ + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-typeof-import.js:36:1] 35 │ await typeof import @@ -14759,36 +15197,100 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 37 │ ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-assignment-expr-not-optional.js:35:10] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-assignment-expr-not-optional.js:35:3] 34 │ { 35 │ import(); - · ─ + · ──────── 36 │ }; ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-assignment-expr-not-optional.js:35:10] - 34 │ label: { - 35 │ import(); - · ─ - 36 │ }; + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-call-unknown.js:37:3] + 36 │ { + 37 │ import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 38 │ }; + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-source-assignment-expr-not-optional.js:36:3] + 35 │ { + 36 │ import.source(); + · ─────────────── + 37 │ }; ╰──── × Cannot use new with dynamic import - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-new-call-expression.js:38:7] - 37 │ label: { - 38 │ new import(''); - · ────────── - 39 │ }; + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-source-no-new-call-expression.js:39:7] + 38 │ { + 39 │ new import.source(''); + · ──────────────────────────────── + 40 │ }; ╰──── × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-rest-param.js:43:10] - 42 │ label: { - 43 │ import(...['']); - · ─── - 44 │ }; + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-source-no-rest-param.js:44:17] + 43 │ { + 44 │ import.source(...['']); + · ─── + 45 │ }; + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-assignment-expr-not-optional.js:35:3] + 34 │ label: { + 35 │ import(); + · ──────── + 36 │ }; + ╰──── + + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-call-unknown.js:37:3] + 36 │ label: { + 37 │ import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 38 │ }; + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-source-assignment-expr-not-optional.js:36:3] + 35 │ label: { + 36 │ import.source(); + · ─────────────── + 37 │ }; + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-source-no-new-call-expression.js:39:7] + 38 │ label: { + 39 │ new import.source(''); + · ──────────────────────────────── + 40 │ }; + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-source-no-rest-param.js:44:17] + 43 │ label: { + 44 │ import.source(...['']); + · ─── + 45 │ }; + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-new-call-expression.js:38:7] + 37 │ label: { + 38 │ new import(''); + · ────────── + 39 │ }; + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-rest-param.js:43:10] + 42 │ label: { + 43 │ import(...['']); + · ─── + 44 │ }; ╰──── × Expected `)` but found `string` @@ -14800,6 +15302,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 41 │ }; ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-typeof-import-call-source-property.js:37:23] + 36 │ label: { + 37 │ typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 38 │ }; + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-typeof-import-source.js:36:23] + 35 │ label: { + 36 │ typeof import.source; + · ┬ + · ╰── `(` expected + 37 │ }; + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-typeof-import.js:35:16] 34 │ label: { @@ -14833,6 +15353,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 41 │ }; ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-typeof-import-call-source-property.js:37:23] + 36 │ { + 37 │ typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 38 │ }; + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-typeof-import-source.js:36:23] + 35 │ { + 36 │ typeof import.source; + · ┬ + · ╰── `(` expected + 37 │ }; + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-block-typeof-import.js:35:16] 34 │ { @@ -14841,14 +15379,46 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 36 │ }; ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-assignment-expr-not-optional.js:35:10] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-assignment-expr-not-optional.js:35:3] 34 │ do { 35 │ import(); - · ─ + · ──────── 36 │ } while (false); ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-call-unknown.js:37:3] + 36 │ do { + 37 │ import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 38 │ } while (false); + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-source-assignment-expr-not-optional.js:36:3] + 35 │ do { + 36 │ import.source(); + · ─────────────── + 37 │ } while (false); + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-source-no-new-call-expression.js:39:7] + 38 │ do { + 39 │ new import.source(''); + · ──────────────────────────────── + 40 │ } while (false); + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-source-no-rest-param.js:44:17] + 43 │ do { + 44 │ import.source(...['']); + · ─── + 45 │ } while (false); + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-no-new-call-expression.js:38:7] 37 │ do { @@ -14874,6 +15444,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 41 │ } while (false); ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-typeof-import-call-source-property.js:37:23] + 36 │ do { + 37 │ typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 38 │ } while (false); + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-typeof-import-source.js:36:23] + 35 │ do { + 36 │ typeof import.source; + · ┬ + · ╰── `(` expected + 37 │ } while (false); + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-typeof-import.js:35:16] 34 │ do { @@ -14882,20 +15470,50 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 36 │ } while (false); ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-assignment-expr-not-optional.js:37:10] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-assignment-expr-not-optional.js:37:3] 36 │ } else { 37 │ import(); - · ─ + · ──────── 38 │ } ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-assignment-expr-not-optional.js:36:15] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-assignment-expr-not-optional.js:36:8] 35 │ 36 │ } else import(); - · ─ + · ──────── + 37 │ + ╰──── + + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-call-unknown.js:38:8] 37 │ + 38 │ } else import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 39 │ + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-source-assignment-expr-not-optional.js:37:8] + 36 │ + 37 │ } else import.source(); + · ─────────────── + 38 │ + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-source-no-new-call-expression.js:40:12] + 39 │ + 40 │ } else new import.source(''); + · ──────────────────────────────── + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-source-no-rest-param.js:45:22] + 44 │ + 45 │ } else import.source(...['']); + · ─── ╰──── × Cannot use new with dynamic import @@ -14920,6 +15538,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut · ╰── `)` expected ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-typeof-import-call-source-property.js:38:28] + 37 │ + 38 │ } else typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 39 │ + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-typeof-import-source.js:37:28] + 36 │ + 37 │ } else typeof import.source; + · ┬ + · ╰── `(` expected + 38 │ + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-typeof-import.js:36:21] 35 │ @@ -14928,6 +15564,38 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 37 │ ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-call-unknown.js:39:3] + 38 │ } else { + 39 │ import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 40 │ } + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-source-assignment-expr-not-optional.js:38:3] + 37 │ } else { + 38 │ import.source(); + · ─────────────── + 39 │ } + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-source-no-new-call-expression.js:41:7] + 40 │ } else { + 41 │ new import.source(''); + · ──────────────────────────────── + 42 │ } + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-source-no-rest-param.js:46:17] + 45 │ } else { + 46 │ import.source(...['']); + · ─── + 47 │ } + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-no-new-call-expression.js:40:7] 39 │ } else { @@ -14953,6 +15621,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 43 │ } ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-typeof-import-call-source-property.js:39:23] + 38 │ } else { + 39 │ typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 40 │ } + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-typeof-import-source.js:38:23] + 37 │ } else { + 38 │ typeof import.source; + · ┬ + · ╰── `(` expected + 39 │ } + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-else-typeof-import.js:37:16] 36 │ } else { @@ -14961,14 +15647,46 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 38 │ } ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-assignment-expr-not-optional.js:35:10] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-assignment-expr-not-optional.js:35:3] 34 │ function fn() { 35 │ import(); - · ─ + · ──────── 36 │ } ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-call-unknown.js:37:3] + 36 │ function fn() { + 37 │ import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 38 │ } + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-source-assignment-expr-not-optional.js:36:3] + 35 │ function fn() { + 36 │ import.source(); + · ─────────────── + 37 │ } + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-source-no-new-call-expression.js:39:7] + 38 │ function fn() { + 39 │ new import.source(''); + · ──────────────────────────────── + 40 │ } + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-source-no-rest-param.js:44:17] + 43 │ function fn() { + 44 │ import.source(...['']); + · ─── + 45 │ } + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-no-new-call-expression.js:38:7] 37 │ function fn() { @@ -14994,14 +15712,46 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 41 │ } ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-assignment-expr-not-optional.js:35:17] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-assignment-expr-not-optional.js:35:10] 34 │ function fn() { 35 │ return import(); - · ─ + · ──────── 36 │ } ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-call-unknown.js:37:10] + 36 │ function fn() { + 37 │ return import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 38 │ } + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-source-assignment-expr-not-optional.js:36:10] + 35 │ function fn() { + 36 │ return import.source(); + · ─────────────── + 37 │ } + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-source-no-new-call-expression.js:39:14] + 38 │ function fn() { + 39 │ return new import.source(''); + · ──────────────────────────────── + 40 │ } + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-source-no-rest-param.js:44:24] + 43 │ function fn() { + 44 │ return import.source(...['']); + · ─── + 45 │ } + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-no-new-call-expression.js:38:14] 37 │ function fn() { @@ -15027,6 +15777,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 41 │ } ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-typeof-import-call-source-property.js:37:30] + 36 │ function fn() { + 37 │ return typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 38 │ } + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-typeof-import-source.js:36:30] + 35 │ function fn() { + 36 │ return typeof import.source; + · ┬ + · ╰── `(` expected + 37 │ } + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-typeof-import.js:35:23] 34 │ function fn() { @@ -15035,6 +15803,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 36 │ } ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-typeof-import-call-source-property.js:37:23] + 36 │ function fn() { + 37 │ typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 38 │ } + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-typeof-import-source.js:36:23] + 35 │ function fn() { + 36 │ typeof import.source; + · ┬ + · ╰── `(` expected + 37 │ } + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-function-typeof-import.js:35:16] 34 │ function fn() { @@ -15043,22 +15829,52 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 36 │ } ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-assignment-expr-not-optional.js:35:10] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-assignment-expr-not-optional.js:35:3] 34 │ if (true) { 35 │ import(); - · ─ + · ──────── 36 │ } ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-assignment-expr-not-optional.js:34:18] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-assignment-expr-not-optional.js:34:11] 33 │ 34 │ if (true) import(); - · ─ + · ──────── 35 │ ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-call-unknown.js:36:11] + 35 │ + 36 │ if (true) import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 37 │ + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-source-assignment-expr-not-optional.js:35:11] + 34 │ + 35 │ if (true) import.source(); + · ─────────────── + 36 │ + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-source-no-new-call-expression.js:38:15] + 37 │ + 38 │ if (true) new import.source(''); + · ──────────────────────────────── + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-source-no-rest-param.js:43:25] + 42 │ + 43 │ if (true) import.source(...['']); + · ─── + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-no-new-call-expression.js:37:15] 36 │ @@ -15081,6 +15897,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut · ╰── `)` expected ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-typeof-import-call-source-property.js:36:31] + 35 │ + 36 │ if (true) typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 37 │ + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-typeof-import-source.js:35:31] + 34 │ + 35 │ if (true) typeof import.source; + · ┬ + · ╰── `(` expected + 36 │ + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-typeof-import.js:34:24] 33 │ @@ -15089,6 +15923,38 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 35 │ ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-call-unknown.js:37:3] + 36 │ if (true) { + 37 │ import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 38 │ } + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-source-assignment-expr-not-optional.js:36:3] + 35 │ if (true) { + 36 │ import.source(); + · ─────────────── + 37 │ } + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-source-no-new-call-expression.js:39:7] + 38 │ if (true) { + 39 │ new import.source(''); + · ──────────────────────────────── + 40 │ } + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-source-no-rest-param.js:44:17] + 43 │ if (true) { + 44 │ import.source(...['']); + · ─── + 45 │ } + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-no-new-call-expression.js:38:7] 37 │ if (true) { @@ -15114,6 +15980,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 41 │ } ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-typeof-import-call-source-property.js:37:23] + 36 │ if (true) { + 37 │ typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 38 │ } + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-typeof-import-source.js:36:23] + 35 │ if (true) { + 36 │ typeof import.source; + · ┬ + · ╰── `(` expected + 37 │ } + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-if-typeof-import.js:35:16] 34 │ if (true) { @@ -15122,14 +16006,46 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 36 │ } ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-while-assignment-expr-not-optional.js:37:10] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-while-assignment-expr-not-optional.js:37:3] 36 │ x++; 37 │ import(); - · ─ + · ──────── 38 │ }; ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-call-unknown.js:39:3] + 38 │ x++; + 39 │ import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 40 │ }; + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-source-assignment-expr-not-optional.js:38:3] + 37 │ x++; + 38 │ import.source(); + · ─────────────── + 39 │ }; + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-source-no-new-call-expression.js:41:7] + 40 │ x++; + 41 │ new import.source(''); + · ──────────────────────────────── + 42 │ }; + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-source-no-rest-param.js:46:17] + 45 │ x++; + 46 │ import.source(...['']); + · ─── + 47 │ }; + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-while-no-new-call-expression.js:40:7] 39 │ x++; @@ -15155,6 +16071,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 43 │ }; ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-while-typeof-import-call-source-property.js:39:23] + 38 │ x++; + 39 │ typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 40 │ }; + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-while-typeof-import-source.js:38:23] + 37 │ x++; + 38 │ typeof import.source; + · ┬ + · ╰── `(` expected + 39 │ }; + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-while-typeof-import.js:37:16] 36 │ x++; @@ -15163,22 +16097,52 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 38 │ }; ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-assignment-expr-not-optional.js:34:10] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-assignment-expr-not-optional.js:34:3] 33 │ with ({}) { 34 │ import(); - · ─ + · ──────── 35 │ } ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-assignment-expr-not-optional.js:33:14] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-assignment-expr-not-optional.js:33:7] 32 │ 33 │ with (import()) {} - · ─ + · ──────── 34 │ ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-call-unknown.js:35:7] + 34 │ + 35 │ with (import.UNKNOWN('./empty_FIXTURE.js')) {} + · ────────────── + 36 │ + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-source-assignment-expr-not-optional.js:34:7] + 33 │ + 34 │ with (import.source()) {} + · ─────────────── + 35 │ + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-source-no-new-call-expression.js:37:11] + 36 │ + 37 │ with (new import.source('')) {} + · ──────────────────────────────── + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-source-no-rest-param.js:42:21] + 41 │ + 42 │ with (import.source(...[''])) {} + · ─── + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-no-new-call-expression.js:36:11] 35 │ @@ -15201,6 +16165,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut · ╰── `)` expected ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-typeof-import-call-source-property.js:35:27] + 34 │ + 35 │ with (typeof import.source.UNKNOWN) {} + · ┬ + · ╰── `(` expected + 36 │ + ╰──── + + × Expected `(` but found `)` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-typeof-import-source.js:34:27] + 33 │ + 34 │ with (typeof import.source) {} + · ┬ + · ╰── `(` expected + 35 │ + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-typeof-import.js:33:20] 32 │ @@ -15209,6 +16191,38 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 34 │ ╰──── + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-call-unknown.js:36:3] + 35 │ with ({}) { + 36 │ import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 37 │ } + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-source-assignment-expr-not-optional.js:35:3] + 34 │ with ({}) { + 35 │ import.source(); + · ─────────────── + 36 │ } + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-source-no-new-call-expression.js:38:7] + 37 │ with ({}) { + 38 │ new import.source(''); + · ──────────────────────────────── + 39 │ } + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-source-no-rest-param.js:43:17] + 42 │ with ({}) { + 43 │ import.source(...['']); + · ─── + 44 │ } + ╰──── + × Cannot use new with dynamic import ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-no-new-call-expression.js:37:7] 36 │ with ({}) { @@ -15234,6 +16248,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 40 │ } ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-typeof-import-call-source-property.js:36:23] + 35 │ with ({}) { + 36 │ typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 37 │ } + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-typeof-import-source.js:35:23] + 34 │ with ({}) { + 35 │ typeof import.source; + · ┬ + · ╰── `(` expected + 36 │ } + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/nested-with-typeof-import.js:34:16] 33 │ with ({}) { @@ -15242,12 +16274,42 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut 35 │ } ╰──── - × Unexpected token - ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/top-level-assignment-expr-not-optional.js:24:8] + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/top-level-assignment-expr-not-optional.js:24:1] 23 │ 24 │ import(); - · ─ + · ──────── + 25 │ + ╰──── + + × The only valid meta property for import is import.meta + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-call-unknown.js:26:1] 25 │ + 26 │ import.UNKNOWN('./empty_FIXTURE.js'); + · ────────────── + 27 │ + ╰──── + + × import() requires a specifier. + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-source-assignment-expr-not-optional.js:25:1] + 24 │ + 25 │ import.source(); + · ─────────────── + 26 │ + ╰──── + + × Cannot use new with dynamic import + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-source-no-new-call-expression.js:28:5] + 27 │ + 28 │ new import.source(''); + · ──────────────────────────────── + ╰──── + + × Unexpected token + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-source-no-rest-param.js:33:15] + 32 │ + 33 │ import.source(...['']); + · ─── ╰──── × Cannot use new with dynamic import @@ -15272,6 +16334,24 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut · ╰── `)` expected ╰──── + × Expected `(` but found `.` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/top-level-typeof-import-call-source-property.js:26:21] + 25 │ + 26 │ typeof import.source.UNKNOWN; + · ┬ + · ╰── `(` expected + 27 │ + ╰──── + + × Expected `(` but found `;` + ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/top-level-typeof-import-source.js:25:21] + 24 │ + 25 │ typeof import.source; + · ┬ + · ╰── `(` expected + 26 │ + ╰──── + × Unexpected token ╭─[test262/test/language/expressions/dynamic-import/syntax/invalid/top-level-typeof-import.js:24:14] 23 │ @@ -19464,6 +20544,52 @@ Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attribut · ───────── ╰──── + × Expected `from` but found `Identifier` + ╭─[test262/test/language/import/import-defer/syntax/invalid-default-and-defer-namespace.js:34:14] + 33 │ + 34 │ import defer x, * as ns from "./dep_FIXTURE.js"; + · ┬ + · ╰── `from` expected + ╰──── + + × Expected `from` but found `as` + ╭─[test262/test/language/import/import-defer/syntax/invalid-defer-as-with-no-asterisk.js:34:14] + 33 │ + 34 │ import defer as ns from "./dep_FIXTURE.js"; + · ─┬ + · ╰── `from` expected + ╰──── + + × Unexpected token + ╭─[test262/test/language/import/import-defer/syntax/invalid-defer-default-and-namespace.js:34:11] + 33 │ + 34 │ import x, defer * as ns from "./dep_FIXTURE.js"; + · ───── + ╰──── + + × Expected `from` but found `Identifier` + ╭─[test262/test/language/import/import-defer/syntax/invalid-defer-default.js:34:14] + 33 │ + 34 │ import defer x from "./dep_FIXTURE.js"; + · ┬ + · ╰── `from` expected + ╰──── + + × Expected `from` but found `{` + ╭─[test262/test/language/import/import-defer/syntax/invalid-defer-named.js:34:14] + 33 │ + 34 │ import defer { default as x } from "./dep_FIXTURE.js"; + · ┬ + · ╰── `from` expected + ╰──── + + × Unexpected token + ╭─[test262/test/language/import/import-defer/syntax/invalid-export-defer-namespace.js:33:8] + 32 │ + 33 │ export defer * as ns from "./dep_FIXTURE.js"; + · ───── + ╰──── + × Unexpected token ╭─[test262/test/language/keywords/ident-ref-break.js:21:7] 20 │ diff --git a/tasks/coverage/snapshots/parser_typescript.snap b/tasks/coverage/snapshots/parser_typescript.snap index 130019b60c928..67835ef601869 100644 --- a/tasks/coverage/snapshots/parser_typescript.snap +++ b/tasks/coverage/snapshots/parser_typescript.snap @@ -1,7 +1,7 @@ commit: d85767ab parser_typescript Summary: -AST Parsed : 6495/6503 (99.88%) +AST Parsed : 6494/6503 (99.86%) Positive Passed: 6483/6503 (99.69%) Negative Passed: 1239/5747 (21.56%) Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/ClassDeclaration10.ts @@ -4764,13 +4764,6 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/es2019/import · ──────────── 3 │ export let z = import.import.import.malkovich; ╰──── - - × The only valid meta property for import is import.meta - ╭─[typescript/tests/cases/conformance/es2019/importMeta/importMeta.ts:3:16] - 2 │ export let y = import.metal; - 3 │ export let z = import.import.import.malkovich; - · ───────────── - ╰──── Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/es6/moduleExportsSystem/topLevelVarHoistingCommonJS.ts × 'with' statements are not allowed diff --git a/tasks/coverage/snapshots/semantic_test262.snap b/tasks/coverage/snapshots/semantic_test262.snap index 36bf4efee3d45..7650081d11d9f 100644 --- a/tasks/coverage/snapshots/semantic_test262.snap +++ b/tasks/coverage/snapshots/semantic_test262.snap @@ -1,8 +1,8 @@ commit: eefc5cf3 semantic_test262 Summary: -AST Parsed : 44037/44037 (100.00%) -Positive Passed: 43508/44037 (98.80%) +AST Parsed : 44169/44169 (100.00%) +Positive Passed: 43637/44169 (98.80%) tasks/coverage/test262/test/annexB/language/function-code/if-decl-else-decl-a-func-block-scoping.js semantic error: Symbol scope ID mismatch for "f": after transform: SymbolId(3): ScopeId(4294967294) @@ -3740,6 +3740,15 @@ Unresolved references mismatch: after transform: ["$DONE", "Object", "assert", "require"] rebuilt : ["$DONE", "Object", "_superprop_getMethod", "assert", "require"] +tasks/coverage/test262/test/language/import/import-defer/errors/resolution-error/import-defer-of-missing-module-fails.js +semantic error: Expected `from` but found `string` + +tasks/coverage/test262/test/language/import/import-defer/errors/syntax-error/import-defer-of-syntax-error-fails.js +semantic error: Expected `from` but found `string` + +tasks/coverage/test262/test/language/module-code/source-phase-import/import-source-binding-name.js +semantic error: Expected `from` but found `string` + tasks/coverage/test262/test/language/module-code/top-level-await/syntax/for-await-await-expr-func-expression.js semantic error: Scope children mismatch: after transform: ScopeId(14): [ScopeId(1)] diff --git a/tasks/coverage/snapshots/semantic_typescript.snap b/tasks/coverage/snapshots/semantic_typescript.snap index bc8ee70111a25..00c03b7933478 100644 --- a/tasks/coverage/snapshots/semantic_typescript.snap +++ b/tasks/coverage/snapshots/semantic_typescript.snap @@ -42303,7 +42303,6 @@ rebuilt : [] tasks/coverage/typescript/tests/cases/conformance/es2019/importMeta/importMeta.ts semantic error: The only valid meta property for import is import.meta -The only valid meta property for import is import.meta tasks/coverage/typescript/tests/cases/conformance/es2019/importMeta/importMetaNarrowing.ts semantic error: Scope children mismatch: diff --git a/tasks/coverage/snapshots/transformer_test262.snap b/tasks/coverage/snapshots/transformer_test262.snap index b9d66074999e3..33bcc1d2d0dfe 100644 --- a/tasks/coverage/snapshots/transformer_test262.snap +++ b/tasks/coverage/snapshots/transformer_test262.snap @@ -1,5 +1,5 @@ commit: eefc5cf3 transformer_test262 Summary: -AST Parsed : 44037/44037 (100.00%) -Positive Passed: 44037/44037 (100.00%) +AST Parsed : 44169/44169 (100.00%) +Positive Passed: 44169/44169 (100.00%) diff --git a/tasks/coverage/src/runtime/mod.rs b/tasks/coverage/src/runtime/mod.rs index 97f17e0ad00a4..38b9f16316af8 100644 --- a/tasks/coverage/src/runtime/mod.rs +++ b/tasks/coverage/src/runtime/mod.rs @@ -57,6 +57,8 @@ static SKIP_FEATURES: &[&str] = &[ // stage 3 "decorators", "explicit-resource-management", + "source-phase-imports", + "import-defer", ]; static SKIP_INCLUDES: &[&str] = &[ diff --git a/tasks/coverage/src/test262/mod.rs b/tasks/coverage/src/test262/mod.rs index 0113f3c1e3429..57debe0e1d94f 100644 --- a/tasks/coverage/src/test262/mod.rs +++ b/tasks/coverage/src/test262/mod.rs @@ -104,14 +104,10 @@ impl Case for Test262Case { } fn skip_test_case(&self) -> bool { - [ - // stage 3 https://github.com/tc39/proposal-source-phase-imports - "source-phase-imports", - // stage 2.7 https://github.com/tc39/proposal-defer-import-eval - "import-defer", - ] - .iter() - .any(|feature| self.meta.features.iter().any(|f| **f == **feature)) + false + // [] + // .iter() + // .any(|feature| self.meta.features.iter().any(|f| **f == **feature)) } // Unless configured otherwise (via the noStrict, onlyStrict, module, or raw flags),