diff --git a/.github/actions/clone-submodules/action.yml b/.github/actions/clone-submodules/action.yml index 8e42d81537100..01848f1b617fe 100644 --- a/.github/actions/clone-submodules/action.yml +++ b/.github/actions/clone-submodules/action.yml @@ -10,21 +10,21 @@ runs: show-progress: false repository: tc39/test262 path: tasks/coverage/test262 - ref: 0645461999632a17426e45d044ee519a0f07d022 + ref: fd979d85d4e4b74ef1ed097d25c71263417d5aad - uses: actions/checkout@v4 with: show-progress: false repository: babel/babel path: tasks/coverage/babel - ref: d20b314c14533ab86351ecf6ca6b7296b66a57b3 + ref: 54a8389fa31ce4fd18b0335b05832dc1ad3cc21f - uses: actions/checkout@v4 with: show-progress: false repository: microsoft/TypeScript path: tasks/coverage/typescript - ref: df9d16503f6755dd071e4c591b9d21c39d03d95e + ref: d85767abfd83880cea17cea70f9913e9c4496dcc - uses: actions/checkout@v4 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52566463185c6..b95b0b9381c7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -227,9 +227,6 @@ jobs: - uses: ./.github/actions/clone-submodules if: steps.filter.outputs.src == 'true' - - uses: oven-sh/setup-bun@v2 - if: steps.filter.outputs.src == 'true' - - uses: ./.github/actions/pnpm if: steps.filter.outputs.src == 'true' diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index 56a88dbe0d4e7..319384e16eae5 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -63,7 +63,7 @@ impl<'a> Gen for Hashbang<'a> { impl<'a> Gen for Directive<'a> { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); // A Use Strict Directive may not contain an EscapeSequence or LineContinuation. // So here should print original `directive` value, the `expression` value is escaped str. @@ -152,7 +152,7 @@ impl<'a> Gen for Statement<'a> { impl<'a> Gen for ExpressionStatement<'a> { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.start_of_stmt = p.code_len(); p.print_expression(&self.expression); @@ -166,7 +166,7 @@ impl<'a> Gen for ExpressionStatement<'a> { impl<'a> Gen for IfStatement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); print_if(self, p, ctx); } @@ -191,10 +191,10 @@ fn print_if(if_stmt: &IfStatement<'_>, p: &mut Codegen, ctx: Context) { } stmt if wrap_to_avoid_ambiguous_else(stmt) => { p.print_soft_space(); - p.print_block_start(stmt.span().start); + p.print_block_start(stmt.span()); stmt.print(p, ctx); p.needs_semicolon = false; - p.print_block_end(stmt.span().end); + p.print_block_end(stmt.span()); if if_stmt.alternate.is_some() { p.print_soft_space(); } else { @@ -255,7 +255,7 @@ impl<'a> Gen for BlockStatement<'a> { impl<'a> Gen for ForStatement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_str("for"); p.print_soft_space(); @@ -286,7 +286,7 @@ impl<'a> Gen for ForStatement<'a> { impl<'a> Gen for ForInStatement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_str("for"); p.print_soft_space(); @@ -304,7 +304,7 @@ impl<'a> Gen for ForInStatement<'a> { impl<'a> Gen for ForOfStatement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_str("for"); if self.r#await { @@ -350,7 +350,7 @@ impl<'a> Gen for ForStatementLeft<'a> { impl<'a> Gen for WhileStatement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_str("while"); p.print_soft_space(); @@ -363,7 +363,7 @@ impl<'a> Gen for WhileStatement<'a> { impl<'a> Gen for DoWhileStatement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_str("do "); if let Statement::BlockStatement(block) = &self.body { @@ -388,7 +388,7 @@ impl<'a> Gen for DoWhileStatement<'a> { impl Gen for EmptyStatement { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_semicolon(); p.print_soft_newline(); @@ -397,7 +397,7 @@ impl Gen for EmptyStatement { impl<'a> Gen for ContinueStatement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_str("continue"); if let Some(label) = &self.label { @@ -410,7 +410,7 @@ impl<'a> Gen for ContinueStatement<'a> { impl<'a> Gen for BreakStatement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_str("break"); if let Some(label) = &self.label { @@ -423,7 +423,7 @@ impl<'a> Gen for BreakStatement<'a> { impl<'a> Gen for SwitchStatement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_str("switch"); p.print_soft_space(); @@ -433,7 +433,7 @@ impl<'a> Gen for SwitchStatement<'a> { p.print_soft_space(); p.print_curly_braces(self.span, self.cases.is_empty(), |p| { for case in &self.cases { - p.add_source_mapping(case.span.start); + p.add_source_mapping(case.span); case.print(p, ctx); } }); @@ -472,7 +472,7 @@ impl<'a> Gen for SwitchCase<'a> { impl<'a> Gen for ReturnStatement<'a> { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_space_before_identifier(); p.print_str("return"); @@ -487,7 +487,7 @@ impl<'a> Gen for ReturnStatement<'a> { impl<'a> Gen for LabeledStatement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { if !p.options.minify && (p.indent > 0 || p.print_next_indent_as_space) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); } p.print_space_before_identifier(); @@ -499,7 +499,7 @@ impl<'a> Gen for LabeledStatement<'a> { impl<'a> Gen for TryStatement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_space_before_identifier(); p.print_str("try"); @@ -529,7 +529,7 @@ impl<'a> Gen for TryStatement<'a> { impl<'a> Gen for ThrowStatement<'a> { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_str("throw "); p.print_expression(&self.argument); @@ -539,7 +539,7 @@ impl<'a> Gen for ThrowStatement<'a> { impl<'a> Gen for WithStatement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_str("with"); p.print_ascii_byte(b'('); @@ -551,7 +551,7 @@ impl<'a> Gen for WithStatement<'a> { impl Gen for DebuggerStatement { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_str("debugger"); p.print_semicolon_after_statement(); @@ -560,7 +560,7 @@ impl Gen for DebuggerStatement { impl<'a> Gen for VariableDeclaration<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); if self.declare { p.print_str("declare "); } @@ -619,7 +619,7 @@ impl<'a> Gen for Function<'a> { p.print_annotation_comments(self.span.start); p.wrap(wrap, |p| { p.print_space_before_identifier(); - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); if self.declare { p.print_str("declare "); } @@ -724,7 +724,7 @@ impl<'a> Gen for FormalParameters<'a> { impl<'a> Gen for ImportDeclaration<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_str("import "); if self.import_kind.is_type() { @@ -812,19 +812,19 @@ impl<'a> Gen for ImportDeclaration<'a> { p.print_hard_space(); with_clause.print(p, ctx); } - p.add_source_mapping(self.span.end); + p.add_source_mapping_end(self.span); p.print_semicolon_after_statement(); } } impl<'a> Gen for WithClause<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); self.attributes_keyword.print(p, ctx); p.print_soft_space(); - p.print_block_start(self.span.start); + p.print_block_start(self.span); p.print_sequence(&self.with_entries, ctx); - p.print_block_end(self.span.end); + p.print_block_end(self.span); } } @@ -844,7 +844,7 @@ impl<'a> Gen for ImportAttribute<'a> { impl<'a> Gen for ExportNamedDeclaration<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); if p.options.print_annotation_comments() { @@ -967,7 +967,7 @@ impl<'a> Gen for ModuleExportName<'a> { impl<'a> Gen for ExportAllDeclaration<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_str("export "); if self.export_kind.is_type() { @@ -992,7 +992,7 @@ impl<'a> Gen for ExportAllDeclaration<'a> { impl<'a> Gen for ExportDefaultDeclaration<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_indent(); p.print_str("export default "); self.declaration.print(p, ctx); @@ -1085,7 +1085,7 @@ impl<'a> Gen for IdentifierReference<'a> { impl<'a> Gen for IdentifierName<'a> { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str(self.name.as_str()); } } @@ -1107,7 +1107,7 @@ impl<'a> Gen for LabelIdentifier<'a> { impl Gen for BooleanLiteral { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_space_before_identifier(); p.print_str(self.as_str()); } @@ -1116,14 +1116,14 @@ impl Gen for BooleanLiteral { impl Gen for NullLiteral { fn gen(&self, p: &mut Codegen, _ctx: Context) { p.print_space_before_identifier(); - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str("null"); } } impl<'a> GenExpr for NumericLiteral<'a> { fn gen_expr(&self, p: &mut Codegen, precedence: Precedence, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); let value = self.value; if ctx.contains(Context::TYPESCRIPT) { p.print_str(self.raw); @@ -1169,14 +1169,14 @@ impl<'a> Gen for BigIntLiteral<'a> { } p.print_space_before_identifier(); - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str(&raw); } } impl<'a> Gen for RegExpLiteral<'a> { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); let last = p.last_byte(); let pattern_text = self.regex.pattern.source_text(p.source_text); // Avoid forming a single-line comment or " Gen for StringLiteral<'a> { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); let s = self.value.as_str(); p.wrap_quote(|p, quote| { print_unquoted_str(s, quote, p); @@ -1287,7 +1287,7 @@ impl<'a> Gen for StringLiteral<'a> { impl Gen for ThisExpression { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_space_before_identifier(); p.print_str("this"); } @@ -1357,7 +1357,7 @@ impl<'a> GenExpr for CallExpression<'a> { if is_export_default { p.start_of_default_export = p.code_len(); } - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); self.callee.print_expr(p, Precedence::Postfix, Context::empty()); if self.optional { p.print_str("?."); @@ -1382,7 +1382,7 @@ impl<'a> GenExpr for CallExpression<'a> { p.print_list(&self.arguments, ctx); } p.print_ascii_byte(b')'); - p.add_source_mapping(self.span.end); + p.add_source_mapping_end(self.span); }); } } @@ -1412,7 +1412,7 @@ impl<'a> Gen for ArrayExpressionElement<'a> { impl<'a> Gen for SpreadElement<'a> { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_ellipsis(); self.argument.print_expr(p, Precedence::Comma, Context::empty()); } @@ -1421,7 +1421,7 @@ impl<'a> Gen for SpreadElement<'a> { impl<'a> Gen for ArrayExpression<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { let is_multi_line = self.elements.len() > 2; - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_ascii_byte(b'['); if is_multi_line { p.indent(); @@ -1446,7 +1446,7 @@ impl<'a> Gen for ArrayExpression<'a> { p.dedent(); p.print_indent(); } - p.add_source_mapping(self.span.end); + p.add_source_mapping_end(self.span); p.print_ascii_byte(b']'); } } @@ -1458,7 +1458,7 @@ impl<'a> GenExpr for ObjectExpression<'a> { let is_multi_line = len > 1; let wrap = p.start_of_stmt == n || p.start_of_arrow_expr == n; p.wrap(wrap, |p| { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_ascii_byte(b'{'); if is_multi_line { p.indent(); @@ -1482,7 +1482,7 @@ impl<'a> GenExpr for ObjectExpression<'a> { } else if len > 0 { p.print_soft_space(); } - p.add_source_mapping(self.span.end); + p.add_source_mapping_end(self.span); p.print_ascii_byte(b'}'); }); } @@ -1500,16 +1500,16 @@ impl<'a> Gen for ObjectPropertyKind<'a> { impl<'a> Gen for ObjectProperty<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { if let Expression::FunctionExpression(func) = &self.value { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); let is_accessor = match &self.kind { PropertyKind::Init => false, PropertyKind::Get => { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str("get "); true } PropertyKind::Set => { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str("set "); true } @@ -1599,7 +1599,7 @@ impl<'a> GenExpr for ArrowFunctionExpression<'a> { p.wrap(precedence >= Precedence::Assign, |p| { p.print_annotation_comments(self.span.start); if self.r#async { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str("async"); } @@ -1610,7 +1610,7 @@ impl<'a> GenExpr for ArrowFunctionExpression<'a> { if let Some(type_parameters) = &self.type_parameters { type_parameters.print(p, ctx); } - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_ascii_byte(b'('); self.params.print(p, ctx); p.print_ascii_byte(b')'); @@ -1637,7 +1637,7 @@ impl<'a> GenExpr for ArrowFunctionExpression<'a> { impl<'a> GenExpr for YieldExpression<'a> { fn gen_expr(&self, p: &mut Codegen, precedence: Precedence, _ctx: Context) { p.wrap(precedence >= Precedence::Assign, |p| { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_space_before_identifier(); p.print_str("yield"); if self.delegate { @@ -1659,7 +1659,7 @@ impl<'a> GenExpr for UpdateExpression<'a> { let operator = self.operator.as_str(); p.wrap(precedence >= self.precedence(), |p| { if self.prefix { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_space_before_operator(self.operator.into()); p.print_str(operator); p.prev_op = Some(self.operator.into()); @@ -1826,7 +1826,7 @@ impl<'a> Gen for AssignmentTargetPattern<'a> { impl<'a> Gen for ArrayAssignmentTarget<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_ascii_byte(b'['); for (index, item) in self.elements.iter().enumerate() { if index != 0 { @@ -1841,31 +1841,31 @@ impl<'a> Gen for ArrayAssignmentTarget<'a> { if !self.elements.is_empty() { p.print_comma(); } - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); target.print(p, ctx); } if self.trailing_comma.is_some() { p.print_comma(); } p.print_ascii_byte(b']'); - p.add_source_mapping(self.span.end); + p.add_source_mapping_end(self.span); } } impl<'a> Gen for ObjectAssignmentTarget<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_ascii_byte(b'{'); p.print_list(&self.properties, ctx); if let Some(target) = &self.rest { if !self.properties.is_empty() { p.print_comma(); } - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); target.print(p, ctx); } p.print_ascii_byte(b'}'); - p.add_source_mapping(self.span.end); + p.add_source_mapping_end(self.span); } } @@ -1963,7 +1963,7 @@ impl<'a> GenExpr for ImportExpression<'a> { || self.arguments.first().is_some_and(|argument| p.has_comment(argument.span().start)); p.wrap(wrap, |p| { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str("import("); if has_comment { p.indent(); @@ -2003,7 +2003,7 @@ impl<'a> Gen for TemplateLiteral<'a> { let mut expressions = self.expressions.iter(); for quasi in &self.quasis { - p.add_source_mapping(quasi.span.start); + p.add_source_mapping(quasi.span); p.print_str(quasi.value.raw.as_str()); if let Some(expr) = expressions.next() { @@ -2019,7 +2019,7 @@ impl<'a> Gen for TemplateLiteral<'a> { impl<'a> Gen for TaggedTemplateExpression<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); self.tag.print_expr(p, Precedence::Postfix, Context::empty()); if let Some(type_parameters) = &self.type_parameters { type_parameters.print(p, ctx); @@ -2030,7 +2030,7 @@ impl<'a> Gen for TaggedTemplateExpression<'a> { impl Gen for Super { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str("super"); } } @@ -2038,7 +2038,7 @@ impl Gen for Super { impl<'a> GenExpr for AwaitExpression<'a> { fn gen_expr(&self, p: &mut Codegen, precedence: Precedence, ctx: Context) { p.wrap(precedence >= self.precedence(), |p| { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str("await "); self.argument.print_expr(p, Precedence::Exponentiation, ctx); }); @@ -2066,7 +2066,7 @@ impl<'a> GenExpr for NewExpression<'a> { p.wrap(wrap, |p| { p.print_annotation_comments(self.span.start); p.print_space_before_identifier(); - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str("new "); self.callee.print_expr(p, Precedence::New, Context::FORBID_CALL); p.print_ascii_byte(b'('); @@ -2152,7 +2152,7 @@ impl<'a> GenExpr for TSTypeAssertion<'a> { impl<'a> Gen for MetaProperty<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); self.meta.print(p, ctx); p.print_ascii_byte(b'.'); self.property.print(p, ctx); @@ -2161,7 +2161,7 @@ impl<'a> Gen for MetaProperty<'a> { impl<'a> Gen for Class<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); let n = p.code_len(); let wrap = self.is_expression() && (p.start_of_stmt == n || p.start_of_default_export == n); p.wrap(wrap, |p| { @@ -2361,7 +2361,7 @@ impl<'a> Gen for JSXAttributeItem<'a> { impl<'a> Gen for JSXOpeningElement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_ascii_byte(b'<'); self.name.print(p, ctx); for attr in &self.attributes { @@ -2385,7 +2385,7 @@ impl<'a> Gen for JSXOpeningElement<'a> { impl<'a> Gen for JSXClosingElement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str("'); @@ -2406,21 +2406,21 @@ impl<'a> Gen for JSXElement<'a> { impl Gen for JSXOpeningFragment { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str("<>"); } } impl Gen for JSXClosingFragment { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str(""); } } impl<'a> Gen for JSXText<'a> { fn gen(&self, p: &mut Codegen, _ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str(self.value.as_str()); } } @@ -2456,7 +2456,7 @@ impl<'a> Gen for JSXFragment<'a> { impl<'a> Gen for StaticBlock<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_str("static"); p.print_soft_space(); p.print_curly_braces(self.span, self.body.is_empty(), |p| { @@ -2471,7 +2471,7 @@ impl<'a> Gen for StaticBlock<'a> { impl<'a> Gen for MethodDefinition<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); for decorator in &self.decorators { decorator.print(p, ctx); p.print_hard_space(); @@ -2538,7 +2538,7 @@ impl<'a> Gen for MethodDefinition<'a> { impl<'a> Gen for PropertyDefinition<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); for decorator in &self.decorators { decorator.print(p, ctx); p.print_hard_space(); @@ -2585,7 +2585,7 @@ impl<'a> Gen for PropertyDefinition<'a> { impl<'a> Gen for AccessorProperty<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); for decorator in &self.decorators { decorator.print(p, ctx); p.print_hard_space(); @@ -2660,7 +2660,7 @@ impl<'a> Gen for BindingPatternKind<'a> { impl<'a> Gen for ObjectPattern<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_ascii_byte(b'{'); if !self.is_empty() { p.print_soft_space(); @@ -2676,13 +2676,13 @@ impl<'a> Gen for ObjectPattern<'a> { p.print_soft_space(); } p.print_ascii_byte(b'}'); - p.add_source_mapping(self.span.end); + p.add_source_mapping_end(self.span); } } impl<'a> Gen for BindingProperty<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); if self.computed { p.print_ascii_byte(b'['); } @@ -2724,7 +2724,7 @@ impl<'a> Gen for BindingProperty<'a> { impl<'a> Gen for BindingRestElement<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_ellipsis(); self.argument.print(p, ctx); } @@ -2732,7 +2732,7 @@ impl<'a> Gen for BindingRestElement<'a> { impl<'a> Gen for ArrayPattern<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_ascii_byte(b'['); for (index, item) in self.elements.iter().enumerate() { if index != 0 { @@ -2751,7 +2751,7 @@ impl<'a> Gen for ArrayPattern<'a> { rest.print(p, ctx); } p.print_ascii_byte(b']'); - p.add_source_mapping(self.span.end); + p.add_source_mapping_end(self.span); } } @@ -2783,7 +2783,7 @@ impl<'a> Gen for Decorator<'a> { } } - p.add_source_mapping(self.span.start); + p.add_source_mapping(self.span); p.print_ascii_byte(b'@'); let wrap = need_wrap(&self.expression); p.wrap(wrap, |p| { diff --git a/crates/oxc_codegen/src/lib.rs b/crates/oxc_codegen/src/lib.rs index 28f5c684799a9..8c9324e193e3d 100644 --- a/crates/oxc_codegen/src/lib.rs +++ b/crates/oxc_codegen/src/lib.rs @@ -19,7 +19,7 @@ use oxc_ast::ast::{ BindingIdentifier, BlockStatement, Comment, Expression, IdentifierReference, Program, Statement, }; use oxc_mangler::Mangler; -use oxc_span::{GetSpan, Span}; +use oxc_span::{GetSpan, Span, SPAN}; use oxc_syntax::{ identifier::{is_identifier_part, is_identifier_part_ascii}, operator::{BinaryOperator, UnaryOperator, UpdateOperator}, @@ -390,7 +390,7 @@ impl<'a> Codegen<'a> { } fn print_curly_braces(&mut self, span: Span, single_line: bool, op: F) { - self.add_source_mapping(span.start); + self.add_source_mapping(span); self.print_ascii_byte(b'{'); if !single_line { self.print_soft_newline(); @@ -401,21 +401,21 @@ impl<'a> Codegen<'a> { self.dedent(); self.print_indent(); } - self.add_source_mapping(span.end); + self.add_source_mapping_end(span); self.print_ascii_byte(b'}'); } - fn print_block_start(&mut self, position: u32) { - self.add_source_mapping(position); + fn print_block_start(&mut self, span: Span) { + self.add_source_mapping(span); self.print_ascii_byte(b'{'); self.print_soft_newline(); self.indent(); } - fn print_block_end(&mut self, position: u32) { + fn print_block_end(&mut self, span: Span) { self.dedent(); self.print_indent(); - self.add_source_mapping(position); + self.add_source_mapping_end(span); self.print_ascii_byte(b'}'); } @@ -639,13 +639,28 @@ impl<'a> Codegen<'a> { self.print_ascii_byte(self.quote); } - fn add_source_mapping(&mut self, position: u32) { + fn add_source_mapping(&mut self, span: Span) { + if span == SPAN { + return; + } + if let Some(sourcemap_builder) = self.sourcemap_builder.as_mut() { + sourcemap_builder.add_source_mapping(self.code.as_bytes(), span.start, None); + } + } + + fn add_source_mapping_end(&mut self, span: Span) { + if span == SPAN { + return; + } if let Some(sourcemap_builder) = self.sourcemap_builder.as_mut() { - sourcemap_builder.add_source_mapping(self.code.as_bytes(), position, None); + sourcemap_builder.add_source_mapping(self.code.as_bytes(), span.end, None); } } fn add_source_mapping_for_name(&mut self, span: Span, name: &str) { + if span == SPAN { + return; + } if let Some(sourcemap_builder) = self.sourcemap_builder.as_mut() { sourcemap_builder.add_source_mapping_for_name(self.code.as_bytes(), span, name); } diff --git a/crates/oxc_language_server/README.md b/crates/oxc_language_server/README.md new file mode 100644 index 0000000000000..8e03c90d0cd6b --- /dev/null +++ b/crates/oxc_language_server/README.md @@ -0,0 +1,61 @@ +# oxc_language_server + +This crate provides an [LSP](https://microsoft.github.io/language-server-protocol/) Server which is used inside an editor or IDE. + +## Server Capabilities + +- [Text Document Synchronization](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_synchronization): `FULL`, +- Workspace + - [Workspace Folders](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspaceFoldersServerCapabilities): `true` + - File Operations: `false` +- [Code Actions Provider](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionKind): + - `quickfix` + +## Supported LSP Specifications from Server + +- [initialize](https://microsoft.github.io/language-server-protocol/specification#initialize) + - Returns the [Server Capabilities](#server-capabilities) +- [initialized](https://microsoft.github.io/language-server-protocol/specification#initialized) +- [shutdown](https://microsoft.github.io/language-server-protocol/specification#shutdown) + +### Workspace + +#### [workspace/didChangeConfiguration](https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeConfiguration) + +The server expects this request when settings like `run`, `enable` or `configPath` are changed. +The server will revalidate or reset the diagnostics for all open files and send one or more [textDocument/publishDiagnostics](#textdocumentpublishdiagnostics) requests to the client. + +#### [workspace/didChangeWatchedFiles](https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeWatchedFiles) + +The server expects this request when the oxlint configuration is changed. +The server will revalidate the diagnostics for all open files and send one or more [textDocument/publishDiagnostics](#textdocumentpublishdiagnostics) requests to the client. + +### TextDocument + +#### [textDocument/didOpen](https://microsoft.github.io/language-server-protocol/specification#textDocument_didOpen) + +The server will validate the file content and send a [textDocument/publishDiagnostics](#textdocumentpublishdiagnostics) request to the client. + +#### [textDocument/didSave](https://microsoft.github.io/language-server-protocol/specification#textDocument_didSave) + +When the configuration `run` is set to `onSave`, the server will validate the file content and send a [textDocument/publishDiagnostics](#textdocumentpublishdiagnostics) request to the client. + +#### [textDocument/didChange](https://microsoft.github.io/language-server-protocol/specification#textDocument_didChange) + +When the configuration `run` is set to `onType`, the server will validate the file content and send a [textDocument/publishDiagnostics](#textdocumentpublishdiagnostics) request to the client. + +#### [textDocument/didClose](https://microsoft.github.io/language-server-protocol/specification#textDocument_didClose) + +It will remove the reference internal. + +#### [textDocument/codeAction](https://microsoft.github.io/language-server-protocol/specification#textDocument_codeAction) + +Returns a list of [CodeAction](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeAction) + +## Expected LSP Specification from Client + +### TextDocument + +#### [textDocument/publishDiagnostics](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_publishDiagnostics) + +Returns a [PublishDiagnostic object](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#publishDiagnosticsParams) diff --git a/crates/oxc_transformer/src/plugins/replace_global_defines.rs b/crates/oxc_transformer/src/plugins/replace_global_defines.rs index 72f08f963bfa6..fbd991fae06f6 100644 --- a/crates/oxc_transformer/src/plugins/replace_global_defines.rs +++ b/crates/oxc_transformer/src/plugins/replace_global_defines.rs @@ -7,7 +7,8 @@ use oxc_parser::Parser; use oxc_semantic::{IsGlobalReference, ScopeTree, SymbolTable}; use oxc_span::{CompactStr, SourceType}; use oxc_syntax::identifier::is_identifier_name; -use oxc_traverse::{traverse_mut, Traverse, TraverseCtx}; +use oxc_traverse::{traverse_mut, Ancestor, Traverse, TraverseCtx}; +use rustc_hash::FxHashSet; /// Configuration for [ReplaceGlobalDefines]. /// @@ -324,13 +325,13 @@ impl<'a> ReplaceGlobalDefines<'a> { DotDefineMemberExpression::StaticMemberExpression(member), ) { let value = self.parse_value(&dot_define.value); - return Some(value); + return Some(destructing_dot_define_optimizer(value, ctx)); } } for meta_property_define in &self.config.0.meta_property { if Self::is_meta_property_define(meta_property_define, member) { let value = self.parse_value(&meta_property_define.value); - return Some(value); + return Some(destructing_dot_define_optimizer(value, ctx)); } } None @@ -498,3 +499,61 @@ fn static_property_name_of_computed_expr<'b, 'a: 'b>( _ => None, } } + +fn destructing_dot_define_optimizer<'ast>( + mut expr: Expression<'ast>, + ctx: &mut TraverseCtx<'ast>, +) -> Expression<'ast> { + let Expression::ObjectExpression(ref mut obj) = expr else { return expr }; + let parent = ctx.parent(); + let destruct_obj_pat = match parent { + Ancestor::VariableDeclaratorInit(declarator) => match declarator.id().kind { + BindingPatternKind::ObjectPattern(ref pat) => pat, + _ => return expr, + }, + _ => { + return expr; + } + }; + let mut needed_keys = FxHashSet::default(); + for prop in &destruct_obj_pat.properties { + match prop.key.name() { + Some(key) => { + needed_keys.insert(key); + } + // if there exists a none static key, we can't optimize + None => { + return expr; + } + } + } + + // here we iterate the object properties twice + // for the first time we check if all the keys are static + // for the second time we only keep the needed keys + // Another way to do this is mutate the objectExpr only the fly, + // but need to save the checkpoint(to return the original Expr if there are any dynamic key exists) which is a memory clone, + // cpu is faster than memory allocation + let mut should_preserved_keys = Vec::with_capacity(obj.properties.len()); + for prop in &obj.properties { + let v = match prop { + ObjectPropertyKind::ObjectProperty(prop) => { + // not static key just preserve it + if let Some(name) = prop.key.name() { + needed_keys.contains(&name) + } else { + true + } + } + // not static key + ObjectPropertyKind::SpreadProperty(_) => true, + }; + should_preserved_keys.push(v); + } + + // we could ensure `should_preserved_keys` has the same length as `obj.properties` + // the method copy from std doc https://doc.rust-lang.org/std/vec/struct.Vec.html#examples-26 + let mut iter = should_preserved_keys.iter(); + obj.properties.retain(|_| *iter.next().unwrap()); + expr +} diff --git a/crates/oxc_transformer/tests/integrations/plugins/replace_global_defines.rs b/crates/oxc_transformer/tests/integrations/plugins/replace_global_defines.rs index 84ac9bbf8d5bf..2c25882d60c10 100644 --- a/crates/oxc_transformer/tests/integrations/plugins/replace_global_defines.rs +++ b/crates/oxc_transformer/tests/integrations/plugins/replace_global_defines.rs @@ -104,3 +104,36 @@ fn optional_chain() { test_same("a?.[b][c]", config.clone()); test_same("a[b]?.[c]", config.clone()); } + +#[test] +fn dot_define_with_destruct() { + let config = ReplaceGlobalDefinesConfig::new(&[( + "process.env.NODE_ENV", + "{'a': 1, b: 2, c: true, d: {a: b}}", + )]) + .unwrap(); + test( + "const {a, c} = process.env.NODE_ENV", + "const { a, c } = {\n\t'a': 1,\n\tc: true};", + config.clone(), + ); + // bailout + test( + "const {[any]: alias} = process.env.NODE_ENV", + "const { [any]: alias } = {\n\t'a': 1,\n\tb: 2,\n\tc: true,\n\td: { a: b }\n};", + config.clone(), + ); + + // should filterout unused key even rhs objectExpr has SpreadElement + + let config = ReplaceGlobalDefinesConfig::new(&[( + "process.env.NODE_ENV", + "{'a': 1, b: 2, c: true, ...unknown}", + )]) + .unwrap(); + test( + "const {a} = process.env.NODE_ENV", + "const { a } = {\n\t'a': 1,\n\t...unknown\n};\n", + config.clone(), + ); +} diff --git a/editors/vscode/client/Config.ts b/editors/vscode/client/Config.ts index a53e8126c6238..9817a38662561 100644 --- a/editors/vscode/client/Config.ts +++ b/editors/vscode/client/Config.ts @@ -19,7 +19,7 @@ export class Config implements ConfigInterface { this._runTrigger = conf.get('lint.run') || 'onType'; this._enable = conf.get('enable') ?? true; this._trace = conf.get('trace.server') || 'off'; - this._configPath = conf.get('configPath') || '.eslintrc'; + this._configPath = conf.get('configPath') || '.oxlintrc.json'; this._binPath = conf.get('path.server'); } @@ -124,7 +124,7 @@ interface ConfigInterface { * * `oxc.configPath` * - * @default ".eslintrc" + * @default ".oxlintrc.json" */ configPath: string; /** diff --git a/editors/vscode/client/config.spec.ts b/editors/vscode/client/config.spec.ts index 266bf449119fe..4522361c86de0 100644 --- a/editors/vscode/client/config.spec.ts +++ b/editors/vscode/client/config.spec.ts @@ -16,7 +16,7 @@ suite('Config', () => { strictEqual(config.runTrigger, 'onType'); strictEqual(config.enable, true); strictEqual(config.trace, 'off'); - strictEqual(config.configPath, '.eslintrc'); + strictEqual(config.configPath, '.oxlintrc.json'); strictEqual(config.binPath, ''); }); diff --git a/editors/vscode/client/extension.ts b/editors/vscode/client/extension.ts index d8417b081f740..0e53d47ac226f 100644 --- a/editors/vscode/client/extension.ts +++ b/editors/vscode/client/extension.ts @@ -142,8 +142,7 @@ export async function activate(context: ExtensionContext) { synchronize: { // Notify the server about file config changes in the workspace fileEvents: [ - workspace.createFileSystemWatcher('**/.eslintr{c,c.json}'), - workspace.createFileSystemWatcher('**/.oxlint{.json,rc.json,rc}'), + workspace.createFileSystemWatcher('**/.oxlint{.json,rc.json}'), workspace.createFileSystemWatcher('**/oxlint{.json,rc.json}'), ], }, diff --git a/editors/vscode/package.json b/editors/vscode/package.json index ef9fc2b09e418..ebdc62ad69535 100644 --- a/editors/vscode/package.json +++ b/editors/vscode/package.json @@ -92,7 +92,7 @@ "oxc.configPath": { "type": "string", "scope": "window", - "default": ".eslintrc", + "default": ".oxlintrc.json", "description": "Path to ESlint configuration." }, "oxc.path.server": { @@ -108,8 +108,7 @@ "oxlintrc.json", "oxlint.json", ".oxlintrc.json", - ".oxlint.json", - ".oxlintrc" + ".oxlint.json" ], "url": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json" } @@ -121,8 +120,7 @@ "oxlintrc.json", "oxlint.json", ".oxlintrc.json", - ".oxlint.json", - ".oxlintrc" + ".oxlint.json" ] } ] diff --git a/justfile b/justfile index 6f8f8f80e518f..fc3b7671199a6 100755 --- a/justfile +++ b/justfile @@ -35,9 +35,9 @@ ready: # Clone or update submodules submodules: - just clone-submodule tasks/coverage/test262 https://github.com/tc39/test262.git 0645461999632a17426e45d044ee519a0f07d022 - just clone-submodule tasks/coverage/babel https://github.com/babel/babel.git d20b314c14533ab86351ecf6ca6b7296b66a57b3 - just clone-submodule tasks/coverage/typescript https://github.com/microsoft/TypeScript.git df9d16503f6755dd071e4c591b9d21c39d03d95e + just clone-submodule tasks/coverage/test262 https://github.com/tc39/test262.git fd979d85d4e4b74ef1ed097d25c71263417d5aad + just clone-submodule tasks/coverage/babel https://github.com/babel/babel.git 54a8389fa31ce4fd18b0335b05832dc1ad3cc21f + just clone-submodule tasks/coverage/typescript https://github.com/microsoft/TypeScript.git d85767abfd83880cea17cea70f9913e9c4496dcc just clone-submodule tasks/prettier_conformance/prettier https://github.com/prettier/prettier.git 52829385bcc4d785e58ae2602c0b098a643523c9 # Install git pre-commit to format files diff --git a/tasks/coverage/snapshots/codegen_babel.snap b/tasks/coverage/snapshots/codegen_babel.snap index c35f82a922a9a..375fe2b585c6f 100644 --- a/tasks/coverage/snapshots/codegen_babel.snap +++ b/tasks/coverage/snapshots/codegen_babel.snap @@ -1,5 +1,5 @@ -commit: d20b314c +commit: 54a8389f codegen_babel Summary: -AST Parsed : 2210/2210 (100.00%) -Positive Passed: 2210/2210 (100.00%) +AST Parsed : 2218/2218 (100.00%) +Positive Passed: 2218/2218 (100.00%) diff --git a/tasks/coverage/snapshots/codegen_test262.snap b/tasks/coverage/snapshots/codegen_test262.snap index 325c9ffb4a605..e41e7e5a9cd26 100644 --- a/tasks/coverage/snapshots/codegen_test262.snap +++ b/tasks/coverage/snapshots/codegen_test262.snap @@ -1,5 +1,5 @@ -commit: 06454619 +commit: fd979d85 codegen_test262 Summary: -AST Parsed : 43851/43851 (100.00%) -Positive Passed: 43851/43851 (100.00%) +AST Parsed : 44026/44026 (100.00%) +Positive Passed: 44026/44026 (100.00%) diff --git a/tasks/coverage/snapshots/codegen_typescript.snap b/tasks/coverage/snapshots/codegen_typescript.snap index 97e05c7340b49..3852be265bff0 100644 --- a/tasks/coverage/snapshots/codegen_typescript.snap +++ b/tasks/coverage/snapshots/codegen_typescript.snap @@ -1,5 +1,5 @@ -commit: df9d1650 +commit: d85767ab codegen_typescript Summary: -AST Parsed : 6490/6490 (100.00%) -Positive Passed: 6490/6490 (100.00%) +AST Parsed : 6503/6503 (100.00%) +Positive Passed: 6503/6503 (100.00%) diff --git a/tasks/coverage/snapshots/minifier_babel.snap b/tasks/coverage/snapshots/minifier_babel.snap index d35ded2bfc27c..0d3fa583e5725 100644 --- a/tasks/coverage/snapshots/minifier_babel.snap +++ b/tasks/coverage/snapshots/minifier_babel.snap @@ -1,5 +1,5 @@ -commit: d20b314c +commit: 54a8389f minifier_babel Summary: -AST Parsed : 1728/1728 (100.00%) -Positive Passed: 1728/1728 (100.00%) +AST Parsed : 1732/1732 (100.00%) +Positive Passed: 1732/1732 (100.00%) diff --git a/tasks/coverage/snapshots/minifier_test262.snap b/tasks/coverage/snapshots/minifier_test262.snap index 7c80ba79c1a81..116d228575bd9 100644 --- a/tasks/coverage/snapshots/minifier_test262.snap +++ b/tasks/coverage/snapshots/minifier_test262.snap @@ -1,5 +1,5 @@ -commit: 06454619 +commit: fd979d85 minifier_test262 Summary: -AST Parsed : 43851/43851 (100.00%) -Positive Passed: 43851/43851 (100.00%) +AST Parsed : 44026/44026 (100.00%) +Positive Passed: 44026/44026 (100.00%) diff --git a/tasks/coverage/snapshots/parser_babel.snap b/tasks/coverage/snapshots/parser_babel.snap index ec9ba51a4b298..491db2628be27 100644 --- a/tasks/coverage/snapshots/parser_babel.snap +++ b/tasks/coverage/snapshots/parser_babel.snap @@ -1,12 +1,15 @@ -commit: d20b314c +commit: 54a8389f parser_babel Summary: -AST Parsed : 2197/2210 (99.41%) -Positive Passed: 2183/2210 (98.78%) -Negative Passed: 1510/1633 (92.47%) +AST Parsed : 2205/2218 (99.41%) +Positive Passed: 2190/2218 (98.74%) +Negative Passed: 1510/1634 (92.41%) Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/annex-b/enabled/3.1-sloppy-labeled-functions-if-body/input.js Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-if/input.js Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/input.js +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/categorized/invalid-startindex-and-startline-specified-without-startcolumn/input.js +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/categorized/startline-and-startcolumn-specified/input.js +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/categorized/startline-specified/input.js Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/input.js Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/input.js Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/input.js @@ -25,8 +28,6 @@ Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/input.js Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2018/object-rest-spread/no-pattern-in-rest/input.js Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2018/object-rest-spread/no-pattern-in-rest-with-ts/input.js -Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-trailing-comma/input.js -Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2020/dynamic-import-createImportExpression-false/invalid-trailing-comma/input.js Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-optional-private-property/input.js Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-function/input.js Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-class-property-in-generator/input.js @@ -443,6 +444,39 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc · ───────── 10 │ ╰──── +Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/declare/eval-babel-7/input.ts + + × Cannot assign to 'eval' in strict mode + ╭─[babel/packages/babel-parser/test/fixtures/typescript/declare/eval-babel-7/input.ts:3:25] + 2 │ export namespace ns { + 3 │ export function eval(): void; + · ──── + 4 │ export function arguments(): void; + ╰──── + + × Cannot assign to 'arguments' in strict mode + ╭─[babel/packages/babel-parser/test/fixtures/typescript/declare/eval-babel-7/input.ts:4:25] + 3 │ export function eval(): void; + 4 │ export function arguments(): void; + · ───────── + 5 │ } + ╰──── + + × Cannot assign to 'eval' in strict mode + ╭─[babel/packages/babel-parser/test/fixtures/typescript/declare/eval-babel-7/input.ts:8:18] + 7 │ + 8 │ declare function eval(): void; + · ──── + 9 │ declare function arguments(): void; + ╰──── + + × Cannot assign to 'arguments' in strict mode + ╭─[babel/packages/babel-parser/test/fixtures/typescript/declare/eval-babel-7/input.ts:9:18] + 8 │ declare function eval(): void; + 9 │ declare function arguments(): void; + · ───────── + 10 │ + ╰──── Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/function/declare-pattern-parameters/input.ts × A required parameter cannot follow an optional parameter. diff --git a/tasks/coverage/snapshots/parser_test262.snap b/tasks/coverage/snapshots/parser_test262.snap index b56752b632650..4af9fd27465f2 100644 --- a/tasks/coverage/snapshots/parser_test262.snap +++ b/tasks/coverage/snapshots/parser_test262.snap @@ -1,8 +1,8 @@ -commit: 06454619 +commit: fd979d85 parser_test262 Summary: -AST Parsed : 43851/43851 (100.00%) -Positive Passed: 43851/43851 (100.00%) +AST Parsed : 44026/44026 (100.00%) +Positive Passed: 44026/44026 (100.00%) Negative Passed: 4320/4322 (99.95%) 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 diff --git a/tasks/coverage/snapshots/parser_typescript.snap b/tasks/coverage/snapshots/parser_typescript.snap index d62539a9dce34..036272dfe11c3 100644 --- a/tasks/coverage/snapshots/parser_typescript.snap +++ b/tasks/coverage/snapshots/parser_typescript.snap @@ -1,9 +1,9 @@ -commit: df9d1650 +commit: d85767ab parser_typescript Summary: -AST Parsed : 6481/6490 (99.86%) -Positive Passed: 6470/6490 (99.69%) -Negative Passed: 1239/5738 (21.59%) +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 Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/ClassDeclaration11.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/ClassDeclaration13.ts @@ -98,6 +98,7 @@ Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/arrayLiteral Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/arrayReferenceWithoutTypeArgs.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/arrayToLocaleStringES5.ts +Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/arrowExpressionBodyJSDoc.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/arrowFunctionInConstructorArgument1.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/asiPublicPrivateProtected.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/assignLambdaToNominalSubtypeOfFunction.ts @@ -161,6 +162,7 @@ Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/assignmentTo Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/assignmentToReferenceTypes.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/asyncFunctionNoReturnType.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/asyncFunctionReturnExpressionErrorSpans.ts +Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/asyncIteratorExtraParameters.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/augmentExportEquals1.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/augmentExportEquals1_1.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/augmentExportEquals2.ts @@ -534,7 +536,6 @@ Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/declarationE Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/declarationEmitRelativeModuleError.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/declarationEmitToDeclarationDirWithoutCompositeAndDeclarationOptions.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/declarationEmitTypeAliasTypeParameterExtendingUnknownSymbol.ts -Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/declarationEmitTypeofRest.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/declarationEmitUnknownImport.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/declarationEmitUsingTypeAlias1.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/declarationEmitVarInElidedBlock.ts @@ -572,6 +573,12 @@ Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/definiteAssi Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/deleteOperator1.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/deleteReadonly.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/deleteReadonlyInStrictNullChecks.ts +Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/dependentReturnType1.ts +Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/dependentReturnType2.ts +Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/dependentReturnType3.ts +Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/dependentReturnType4.ts +Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/dependentReturnType5.ts +Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/dependentReturnType6.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/deprecatedCompilerOptions1.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/deprecatedCompilerOptions3.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/deprecatedCompilerOptions4.ts @@ -1234,6 +1241,7 @@ Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/isolatedModu Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/isolatedModulesOut.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/isolatedModulesReExportType.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/isolatedModulesRequiresPreserveConstEnum.ts +Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/iteratorExtraParameters.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/javascriptImportDefaultBadExport.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/jsCheckObjectDefineThisNoCrash.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/compiler/jsDeclarationEmitExportedClassWithExtends.ts @@ -2493,6 +2501,7 @@ Expect Syntax Error: tasks/coverage/typescript/tests/cases/conformance/classes/m Expect Syntax Error: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateWriteOnlyAccessorRead.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/conformance/classes/mixinAbstractClasses.2.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/conformance/classes/mixinAccessModifiers.ts +Expect Syntax Error: tasks/coverage/typescript/tests/cases/conformance/classes/mixinWithBaseDependingOnSelfNoCrash1.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/conformance/classes/propertyMemberDeclarations/accessorsOverrideMethod.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/conformance/classes/propertyMemberDeclarations/accessorsOverrideProperty.ts Expect Syntax Error: tasks/coverage/typescript/tests/cases/conformance/classes/propertyMemberDeclarations/accessorsOverrideProperty2.ts diff --git a/tasks/coverage/snapshots/semantic_babel.snap b/tasks/coverage/snapshots/semantic_babel.snap index a0f8a5efe1cd2..11c6625c9d69d 100644 --- a/tasks/coverage/snapshots/semantic_babel.snap +++ b/tasks/coverage/snapshots/semantic_babel.snap @@ -1,8 +1,8 @@ -commit: d20b314c +commit: 54a8389f semantic_babel Summary: -AST Parsed : 2210/2210 (100.00%) -Positive Passed: 1841/2210 (83.30%) +AST Parsed : 2218/2218 (100.00%) +Positive Passed: 1846/2218 (83.23%) tasks/coverage/babel/packages/babel-parser/test/fixtures/annex-b/enabled/3.3-function-in-if-body/input.js semantic error: Symbol scope ID mismatch for "f": after transform: SymbolId(0): ScopeId(4294967294) @@ -599,6 +599,12 @@ Cannot assign to 'arguments' in strict mode Cannot assign to 'eval' in strict mode Cannot assign to 'arguments' in strict mode +tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/declare/eval-babel-7/input.ts +semantic error: Cannot assign to 'eval' in strict mode +Cannot assign to 'arguments' in strict mode +Cannot assign to 'eval' in strict mode +Cannot assign to 'arguments' in strict mode + tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/declare/function-rest-trailing-comma/input.ts semantic error: Scope children mismatch: after transform: ScopeId(0): [ScopeId(1)] @@ -1416,6 +1422,14 @@ Scope children mismatch: after transform: ScopeId(0): [ScopeId(1)] rebuilt : ScopeId(0): [] +tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/module-namespace/global-in-module-babel-7/input.ts +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["m"] +rebuilt : ScopeId(0): [] +Scope children mismatch: +after transform: ScopeId(0): [ScopeId(1)] +rebuilt : ScopeId(0): [] + tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/module-namespace/head/input.ts semantic error: Bindings mismatch: after transform: ScopeId(0): ["M", "N", "m"] @@ -1432,6 +1446,14 @@ Scope children mismatch: after transform: ScopeId(0): [ScopeId(1), ScopeId(3), ScopeId(4), ScopeId(5)] rebuilt : ScopeId(0): [] +tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/module-namespace/head-declare-babel-7/input.ts +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["M", "N", "m"] +rebuilt : ScopeId(0): [] +Scope children mismatch: +after transform: ScopeId(0): [ScopeId(1), ScopeId(3), ScopeId(4), ScopeId(5)] +rebuilt : ScopeId(0): [] + tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/module-namespace/head-export/input.ts semantic error: Bindings mismatch: after transform: ScopeId(0): ["X"] diff --git a/tasks/coverage/snapshots/semantic_test262.snap b/tasks/coverage/snapshots/semantic_test262.snap index 4497c38e2d58b..45220bee438bd 100644 --- a/tasks/coverage/snapshots/semantic_test262.snap +++ b/tasks/coverage/snapshots/semantic_test262.snap @@ -1,8 +1,8 @@ -commit: 06454619 +commit: fd979d85 semantic_test262 Summary: -AST Parsed : 43851/43851 (100.00%) -Positive Passed: 43311/43851 (98.77%) +AST Parsed : 44026/44026 (100.00%) +Positive Passed: 43486/44026 (98.77%) 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) diff --git a/tasks/coverage/snapshots/semantic_typescript.snap b/tasks/coverage/snapshots/semantic_typescript.snap index 4a977ce9e5b63..7266d2a4a35c0 100644 --- a/tasks/coverage/snapshots/semantic_typescript.snap +++ b/tasks/coverage/snapshots/semantic_typescript.snap @@ -1,8 +1,8 @@ -commit: df9d1650 +commit: d85767ab semantic_typescript Summary: -AST Parsed : 6490/6490 (100.00%) -Positive Passed: 2660/6490 (40.99%) +AST Parsed : 6503/6503 (100.00%) +Positive Passed: 2665/6503 (40.98%) tasks/coverage/typescript/tests/cases/compiler/2dArrays.ts semantic error: Symbol reference IDs mismatch for "Cell": after transform: SymbolId(0): [ReferenceId(1)] @@ -4105,6 +4105,41 @@ Reference symbol mismatch for "NS": after transform: SymbolId(0) "NS" rebuilt : SymbolId(0) "NS" +tasks/coverage/typescript/tests/cases/compiler/computedPropertiesWithSetterAssignment.ts +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["Foo", "Props", "foo", "k"] +rebuilt : ScopeId(0): ["Props", "k"] +Scope children mismatch: +after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] +rebuilt : ScopeId(0): [ScopeId(1)] +Bindings mismatch: +after transform: ScopeId(1): ["Props", "k"] +rebuilt : ScopeId(1): ["Props"] +Scope flags mismatch: +after transform: ScopeId(1): ScopeFlags(0x0) +rebuilt : ScopeId(1): ScopeFlags(Function) +Symbol reference IDs mismatch for "k": +after transform: SymbolId(0): [ReferenceId(3), ReferenceId(5), ReferenceId(13)] +rebuilt : SymbolId(0): [ReferenceId(9)] +Symbol flags mismatch for "Props": +after transform: SymbolId(1): SymbolFlags(ConstEnum) +rebuilt : SymbolId(1): SymbolFlags(FunctionScopedVariable) +Reference symbol mismatch for "foo": +after transform: SymbolId(4) "foo" +rebuilt : +Reference symbol mismatch for "foo": +after transform: SymbolId(4) "foo" +rebuilt : +Reference symbol mismatch for "foo": +after transform: SymbolId(4) "foo" +rebuilt : +Reference symbol mismatch for "foo": +after transform: SymbolId(4) "foo" +rebuilt : +Unresolved references mismatch: +after transform: ["Iterable", "Set", "Symbol"] +rebuilt : ["Symbol", "foo"] + tasks/coverage/typescript/tests/cases/compiler/computedPropertyNameAndTypeParameterConflict.ts semantic error: Bindings mismatch: after transform: ScopeId(0): ["O"] @@ -9406,6 +9441,11 @@ Unresolved references mismatch: after transform: ["const"] rebuilt : [] +tasks/coverage/typescript/tests/cases/compiler/declarationEmitTypeofRest.ts +semantic error: Symbol reference IDs mismatch for "a": +after transform: SymbolId(1): [ReferenceId(0)] +rebuilt : SymbolId(1): [] + tasks/coverage/typescript/tests/cases/compiler/declarationEmitTypeofThisInClass.ts semantic error: Unresolved references mismatch: after transform: ["this"] @@ -10288,6 +10328,26 @@ Unresolved references mismatch: after transform: ["module"] rebuilt : ["module", "require"] +tasks/coverage/typescript/tests/cases/compiler/dependentReturnType8.ts +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["array", "getObject", "record"] +rebuilt : ScopeId(0): ["getObject"] +Bindings mismatch: +after transform: ScopeId(1): ["T", "group"] +rebuilt : ScopeId(1): ["group"] +Scope children mismatch: +after transform: ScopeId(1): [ScopeId(2), ScopeId(3)] +rebuilt : ScopeId(1): [] +Reference symbol mismatch for "record": +after transform: SymbolId(0) "record" +rebuilt : +Reference symbol mismatch for "array": +after transform: SymbolId(1) "array" +rebuilt : +Unresolved references mismatch: +after transform: ["Record", "undefined"] +rebuilt : ["array", "record", "undefined"] + tasks/coverage/typescript/tests/cases/compiler/destructureOfVariableSameAsShorthand.ts semantic error: Bindings mismatch: after transform: ScopeId(0): ["AxiosResponse", "_asyncToGenerator", "_main", "main"] @@ -32008,6 +32068,11 @@ Symbol reference IDs mismatch for "Bar": after transform: SymbolId(3): [ReferenceId(2), ReferenceId(5)] rebuilt : SymbolId(2): [ReferenceId(0)] +tasks/coverage/typescript/tests/cases/compiler/signatureOverloadsWithComments.ts +semantic error: Scope children mismatch: +after transform: ScopeId(2): [ScopeId(3), ScopeId(4), ScopeId(5)] +rebuilt : ScopeId(2): [ScopeId(3)] + tasks/coverage/typescript/tests/cases/compiler/silentNeverPropagation.ts semantic error: Bindings mismatch: after transform: ScopeId(0): ["ModuleWithState", "MoreState", "State", "breaks"] @@ -36728,6 +36793,17 @@ Unresolved references mismatch: after transform: ["Partial", "Readonly"] rebuilt : [] +tasks/coverage/typescript/tests/cases/compiler/typedArrayConstructorOverloads.ts +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["TypedArrayConstructor", "makeTypedArray"] +rebuilt : ScopeId(0): ["makeTypedArray"] +Scope children mismatch: +after transform: ScopeId(0): [ScopeId(1), ScopeId(2)] +rebuilt : ScopeId(0): [ScopeId(1)] +Unresolved references mismatch: +after transform: ["ArrayBuffer", "BigInt64ArrayConstructor", "Float64ArrayConstructor"] +rebuilt : [] + tasks/coverage/typescript/tests/cases/compiler/typedArrays.ts semantic error: Bindings mismatch: after transform: ScopeId(8): ["T", "mapFn", "obj", "typedArrays"] @@ -49285,6 +49361,47 @@ Unresolved references mismatch: after transform: ["AsyncGenerator", "Generator", "Partial", "Record", "Symbol", "f1", "f2", "require"] rebuilt : ["Symbol", "f1", "f2", "require"] +tasks/coverage/typescript/tests/cases/conformance/generators/yieldStatementNoAsiAfterTransform.ts +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["a", "t1", "t10", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"] +rebuilt : ScopeId(0): ["t1", "t10", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"] +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Unresolved references mismatch: +after transform: [] +rebuilt : ["a"] + tasks/coverage/typescript/tests/cases/conformance/importAttributes/importAttributes7.ts semantic error: Bindings mismatch: after transform: ScopeId(0): ["_asyncToGenerator", "_f", "a", "f"] @@ -53886,6 +54003,47 @@ Symbol reference IDs mismatch for "a": after transform: SymbolId(8): [ReferenceId(9)] rebuilt : SymbolId(7): [] +tasks/coverage/typescript/tests/cases/conformance/statements/returnStatements/returnStatementNoAsiAfterTransform.ts +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["a", "t1", "t10", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"] +rebuilt : ScopeId(0): ["t1", "t10", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"] +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Reference symbol mismatch for "a": +after transform: SymbolId(0) "a" +rebuilt : +Unresolved references mismatch: +after transform: [] +rebuilt : ["a"] + tasks/coverage/typescript/tests/cases/conformance/statements/returnStatements/returnStatements.ts semantic error: Bindings mismatch: after transform: ScopeId(0): ["C", "D", "I", "fn1", "fn10", "fn11", "fn12", "fn13", "fn2", "fn3", "fn4", "fn5", "fn6", "fn7", "fn8"] @@ -54028,6 +54186,14 @@ Unresolved references mismatch: after transform: ["Promise"] rebuilt : ["x1", "x2"] +tasks/coverage/typescript/tests/cases/conformance/types/conditional/inferTypesWithExtendsDependingOnTypeVariables.ts +semantic error: Bindings mismatch: +after transform: ScopeId(0): ["Bar", "Res1"] +rebuilt : ScopeId(0): [] +Scope children mismatch: +after transform: ScopeId(0): [ScopeId(1), ScopeId(3)] +rebuilt : ScopeId(0): [] + tasks/coverage/typescript/tests/cases/conformance/types/conditional/variance.ts semantic error: Bindings mismatch: after transform: ScopeId(0): ["Bar", "Foo", "foo", "x", "y", "z"] diff --git a/tasks/coverage/snapshots/transformer_babel.snap b/tasks/coverage/snapshots/transformer_babel.snap index 87f6ad14feae6..3e2a08184cc96 100644 --- a/tasks/coverage/snapshots/transformer_babel.snap +++ b/tasks/coverage/snapshots/transformer_babel.snap @@ -1,5 +1,5 @@ -commit: d20b314c +commit: 54a8389f transformer_babel Summary: -AST Parsed : 2210/2210 (100.00%) -Positive Passed: 2210/2210 (100.00%) +AST Parsed : 2218/2218 (100.00%) +Positive Passed: 2218/2218 (100.00%) diff --git a/tasks/coverage/snapshots/transformer_test262.snap b/tasks/coverage/snapshots/transformer_test262.snap index 3ef1c8a6d5dd5..19c486b84abab 100644 --- a/tasks/coverage/snapshots/transformer_test262.snap +++ b/tasks/coverage/snapshots/transformer_test262.snap @@ -1,5 +1,5 @@ -commit: 06454619 +commit: fd979d85 transformer_test262 Summary: -AST Parsed : 43851/43851 (100.00%) -Positive Passed: 43851/43851 (100.00%) +AST Parsed : 44026/44026 (100.00%) +Positive Passed: 44026/44026 (100.00%) diff --git a/tasks/coverage/snapshots/transformer_typescript.snap b/tasks/coverage/snapshots/transformer_typescript.snap index cec4ce2013772..03c6b742a43d1 100644 --- a/tasks/coverage/snapshots/transformer_typescript.snap +++ b/tasks/coverage/snapshots/transformer_typescript.snap @@ -1,7 +1,7 @@ -commit: df9d1650 +commit: d85767ab transformer_typescript Summary: -AST Parsed : 6490/6490 (100.00%) -Positive Passed: 6488/6490 (99.97%) +AST Parsed : 6503/6503 (100.00%) +Positive Passed: 6501/6503 (99.97%) Mismatch: tasks/coverage/typescript/tests/cases/compiler/commentsAfterSpread.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/inline/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.tsx diff --git a/tasks/coverage/snapshots/transpile.snap b/tasks/coverage/snapshots/transpile.snap index 323ed8b759b07..9c8fe8531db4b 100644 --- a/tasks/coverage/snapshots/transpile.snap +++ b/tasks/coverage/snapshots/transpile.snap @@ -1,4 +1,4 @@ -commit: df9d1650 +commit: d85767ab transpile Summary: AST Parsed : 20/20 (100.00%) @@ -549,37 +549,3 @@ export {}; 45 | export class InClassMethodBad { o(array: T = [], rParam: string): void { } }; : ^^^^^^^^^^^^^ `---- - -#### "typescript/tests/cases/transpile/declarationRestParameters.ts" #### -//// [v1.ts] //// -export const v1 = (...a: [n: "n", a: "a"]): { a: typeof a } => { - return null!; -}; - -//// [v2.ts] //// -const n = Symbol(); -export const v2 = (...a: [n: "n", a: "a"]): { - a: typeof a; - n: typeof n; -} => { - return null!; -}; - -//// [v1.d.ts] //// -export declare const v1: (...a: [n: "n", a: "a"]) => { a: typeof a }; - -//// [v2.d.ts] //// -declare const n: unknown; -export declare const v2: (...a: [n: "n", a: "a"]) => { - a: typeof a; - n: typeof n; -}; -export {}; - - x TS9010: Variable must have an explicit type annotation with - | --isolatedDeclarations. - ,-[v2.d.ts:1:7] - 1 | const n = Symbol(); - : ^ - 2 | export const v2 = (...a: [n: "n", a: "a"]): { - `---- diff --git a/tasks/transform_conformance/snapshots/babel.snap.md b/tasks/transform_conformance/snapshots/babel.snap.md index 0a7c39cf7c72f..a7767c69b1b2b 100644 --- a/tasks/transform_conformance/snapshots/babel.snap.md +++ b/tasks/transform_conformance/snapshots/babel.snap.md @@ -1,6 +1,6 @@ -commit: d20b314c +commit: 54a8389f -Passed: 327/575 +Passed: 327/582 # All Passed: * babel-plugin-transform-class-static-block @@ -13,7 +13,7 @@ Passed: 327/575 * babel-plugin-transform-react-jsx-source -# babel-preset-env (41/127) +# babel-preset-env (43/130) * dynamic-import/auto-esm-unsupported-import-unsupported/input.mjs x Output mismatch @@ -152,6 +152,9 @@ x Output mismatch * preset-options/no-options/input.mjs x Output mismatch +* preset-options/regexp-modifiers-chrome-121/input.js +x Output mismatch + * preset-options/reserved-keys-ie8/input.mjs x Output mismatch @@ -224,6 +227,9 @@ x Output mismatch * preset-options-babel-7/no-options/input.mjs x Output mismatch +* preset-options-babel-7/regexp-modifiers-chrome-121/input.js +x Output mismatch + * preset-options-babel-7/reserved-keys-ie8/input.mjs x Output mismatch @@ -263,9 +269,6 @@ x Output mismatch * sanity/transform-duplicate-keys/input.js x Output mismatch -* shipped-proposals/import-assertions/input.mjs -x Output mismatch - * shipped-proposals/new-class-features-chrome-90/input.js x Output mismatch @@ -358,10 +361,22 @@ x Output mismatch x Output mismatch -# babel-plugin-transform-exponentiation-operator (3/4) +# babel-plugin-transform-exponentiation-operator (2/7) +* exponentiation-operator/memoise-object/input.js +x Output mismatch + +* exponentiation-operator/memoise-object-in-default-args/input.js +x Output mismatch + * regression/4349/input.js x Output mismatch +* regression/4349-keep-super/input.js +x Output mismatch + +* regression/4403/input.js +x Output mismatch + # babel-plugin-transform-arrow-functions (3/11) * arrow-functions/implicit-var-arguments/input.js @@ -389,7 +404,7 @@ x Output mismatch x Output mismatch -# babel-preset-typescript (11/16) +# babel-preset-typescript (10/17) * jsx-compat/ts-invalid/input.ts x Expected `>` but found `/` @@ -416,6 +431,12 @@ rebuilt : ScopeId(1): [] * opts/optimizeConstEnums/input.ts x Output mismatch +* opts/rewriteImportExtensions/input.ts +x Output mismatch + +* opts/rewriteImportExtensions-createImportExpressions/input.ts +x Output mismatch + # babel-plugin-transform-typescript (46/156) * cast/as-expression/input.ts diff --git a/tasks/transform_conformance/snapshots/babel_exec.snap.md b/tasks/transform_conformance/snapshots/babel_exec.snap.md index de542525f891f..08c761a7cc66e 100644 --- a/tasks/transform_conformance/snapshots/babel_exec.snap.md +++ b/tasks/transform_conformance/snapshots/babel_exec.snap.md @@ -1,4 +1,4 @@ -commit: d20b314c +commit: 54a8389f node: v22.11.0 ⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯ diff --git a/tasks/transform_conformance/snapshots/oxc.snap.md b/tasks/transform_conformance/snapshots/oxc.snap.md index 9c5ea927d9b1b..8efb9c1e0f6d0 100644 --- a/tasks/transform_conformance/snapshots/oxc.snap.md +++ b/tasks/transform_conformance/snapshots/oxc.snap.md @@ -1,4 +1,4 @@ -commit: d20b314c +commit: 54a8389f Passed: 90/100 diff --git a/tasks/transform_conformance/snapshots/oxc_exec.snap.md b/tasks/transform_conformance/snapshots/oxc_exec.snap.md index 292cdaf7be6a0..3805202d32ff6 100644 --- a/tasks/transform_conformance/snapshots/oxc_exec.snap.md +++ b/tasks/transform_conformance/snapshots/oxc_exec.snap.md @@ -1,4 +1,4 @@ -commit: d20b314c +commit: 54a8389f node: v22.11.0 filter: fixtures