diff --git a/crates/oxc_transformer/src/common/helper_loader.rs b/crates/oxc_transformer/src/common/helper_loader.rs index 271929fd69c753..b6e68c32a074d7 100644 --- a/crates/oxc_transformer/src/common/helper_loader.rs +++ b/crates/oxc_transformer/src/common/helper_loader.rs @@ -143,6 +143,7 @@ pub enum Helper { AsyncToGenerator, ObjectSpread2, WrapAsyncGenerator, + DefineProperty, } impl Helper { @@ -154,6 +155,7 @@ impl Helper { Self::AsyncToGenerator => "asyncToGenerator", Self::ObjectSpread2 => "objectSpread2", Self::WrapAsyncGenerator => "wrapAsyncGenerator", + Self::DefineProperty => "defineProperty", } } } diff --git a/crates/oxc_transformer/src/common/statement_injector.rs b/crates/oxc_transformer/src/common/statement_injector.rs index 6b8ea5cdf02c5b..dbcd1f8bf42d7b 100644 --- a/crates/oxc_transformer/src/common/statement_injector.rs +++ b/crates/oxc_transformer/src/common/statement_injector.rs @@ -79,7 +79,6 @@ impl<'a> StatementInjectorStore<'a> { // The non-trivial inner functions are not marked `#[inline]` - compiler can decide whether to inline or not. impl<'a> StatementInjectorStore<'a> { /// Add a statement to be inserted immediately before the target statement. - #[expect(dead_code)] #[inline] pub fn insert_before(&self, target: &A, stmt: Statement<'a>) { self.insert_before_address(target.address(), stmt); diff --git a/crates/oxc_transformer/src/common/var_declarations.rs b/crates/oxc_transformer/src/common/var_declarations.rs index 7701c15a5378ce..66fb24af9e44cb 100644 --- a/crates/oxc_transformer/src/common/var_declarations.rs +++ b/crates/oxc_transformer/src/common/var_declarations.rs @@ -98,7 +98,6 @@ impl<'a> VarDeclarationsStore<'a> { /// Add a `let` declaration to be inserted at top of current enclosing statement block, /// given a `BoundIdentifier`. - #[expect(dead_code)] pub fn insert_let( &self, binding: &BoundIdentifier<'a>, diff --git a/crates/oxc_transformer/src/compiler_assumptions.rs b/crates/oxc_transformer/src/compiler_assumptions.rs index f37995fa930cd4..4aaa9e99497f89 100644 --- a/crates/oxc_transformer/src/compiler_assumptions.rs +++ b/crates/oxc_transformer/src/compiler_assumptions.rs @@ -85,7 +85,6 @@ pub struct CompilerAssumptions { pub set_computed_properties: bool, #[serde(default)] - #[deprecated = "Not Implemented"] pub set_public_class_fields: bool, #[serde(default)] diff --git a/crates/oxc_transformer/src/es2022/class_properties.rs b/crates/oxc_transformer/src/es2022/class_properties.rs index 5087d26aa86c34..355f2f2c686747 100644 --- a/crates/oxc_transformer/src/es2022/class_properties.rs +++ b/crates/oxc_transformer/src/es2022/class_properties.rs @@ -64,10 +64,18 @@ use serde::Deserialize; -use oxc_ast::ast::*; -use oxc_traverse::{Traverse, TraverseCtx}; +use oxc_allocator::{Address, GetAddress, Vec as ArenaVec}; +use oxc_ast::{ast::*, NONE}; +use oxc_span::SPAN; +use oxc_syntax::{ + node::NodeId, + reference::ReferenceFlags, + scope::{ScopeFlags, ScopeId}, + symbol::SymbolFlags, +}; +use oxc_traverse::{BoundIdentifier, Traverse, TraverseCtx}; -use crate::TransformCtx; +use crate::{common::helper_loader::Helper, CompilerAssumptions, TransformCtx}; #[derive(Debug, Default, Clone, Copy, Deserialize)] #[serde(default, rename_all = "camelCase")] @@ -77,18 +85,495 @@ pub struct ClassPropertiesOptions { } pub struct ClassProperties<'a, 'ctx> { + set_public_class_fields: bool, #[expect(dead_code)] - options: ClassPropertiesOptions, - #[expect(dead_code)] + static_block: bool, ctx: &'ctx TransformCtx<'a>, } impl<'a, 'ctx> ClassProperties<'a, 'ctx> { - pub fn new(options: ClassPropertiesOptions, ctx: &'ctx TransformCtx<'a>) -> Self { - Self { options, ctx } + pub fn new( + options: ClassPropertiesOptions, + assumptions: &CompilerAssumptions, + static_block: bool, + ctx: &'ctx TransformCtx<'a>, + ) -> Self { + // TODO: Raise error if these 2 options are inconsistent + let set_public_class_fields = + options.set_public_class_fields || assumptions.set_public_class_fields; + + Self { set_public_class_fields, static_block, ctx } } } impl<'a, 'ctx> Traverse<'a> for ClassProperties<'a, 'ctx> { - fn enter_class_body(&mut self, _body: &mut ClassBody<'a>, _ctx: &mut TraverseCtx<'a>) {} + fn enter_expression(&mut self, expr: &mut Expression<'a>, ctx: &mut TraverseCtx<'a>) { + if let Expression::ClassExpression(_) = expr { + self.transform_class_expression(expr, ctx); + } + } + + fn enter_statement(&mut self, stmt: &mut Statement<'a>, ctx: &mut TraverseCtx<'a>) { + if let Statement::ClassDeclaration(_) = stmt { + self.transform_class_declaration(stmt, ctx); + } + } +} + +/// State for transform, depending on whether class is a class expression or class declaration. +enum TransformState<'a> { + /// Contains `ArenaVec` of assignment expressions to be inserted before the class + Expression(ArenaVec<'a, Expression<'a>>), + /// Contains `Address` of statement, for inserting assignment statements before it + Statement(Address), +} + +impl<'a, 'ctx> ClassProperties<'a, 'ctx> { + /// Transform class expression. + // `#[inline]` so that compiler sees that `expr` is `Expression::ClassExpression`. + // Main logic is split out into a separate function `transform_class_expression_impl`, + // to keep this function small, so compiler can inline it into `enter_expression`, + // and potentially inline `enter_expression` into the parent function too. + #[inline] + fn transform_class_expression(&mut self, expr: &mut Expression<'a>, ctx: &mut TraverseCtx<'a>) { + let Expression::ClassExpression(class) = expr else { unreachable!() }; + + let mut assignments = self.transform_class_expression_impl(class, ctx); + + // Insert any assignments before the class. + // `C = class { [x()] = 1 };` -> `C = (_x = x(), class { constructor() { this[_x] = 1; } })` + if !assignments.is_empty() { + assignments.push(ctx.ast.move_expression(expr)); + *expr = ctx.ast.expression_sequence(SPAN, assignments); + } + } + + fn transform_class_expression_impl( + &mut self, + class: &mut Class<'a>, + ctx: &mut TraverseCtx<'a>, + ) -> ArenaVec<'a, Expression<'a>> { + // Create vec of assignments to be inserted before class + let mut state = TransformState::Expression(ctx.ast.vec()); + + let class_scope_id = class.scope_id(); + let has_super_class = class.super_class.is_some(); + self.transform_class_body( + &mut class.body, + class_scope_id, + has_super_class, + &mut state, + ctx, + ); + + let TransformState::Expression(assignments) = state else { unreachable!() }; + assignments + } + + /// Transform class declaration. + // `#[inline]` so that compiler sees that `stmt` is `Statement::ClassDeclaration`. + // Main logic is split out into a separate function `transform_class_declaration_impl`, + // to keep this function small, so compiler can inline it into `enter_statement`, + // and potentially inline `enter_statement` into the parent function too. + #[inline] + fn transform_class_declaration(&mut self, stmt: &mut Statement<'a>, ctx: &mut TraverseCtx<'a>) { + // Get `Address` of statement, for inserting assignment statements before the class + let stmt_address = stmt.address(); + + let Statement::ClassDeclaration(class) = stmt else { unreachable!() }; + + self.transform_class_declaration_impl(class, stmt_address, ctx); + } + + fn transform_class_declaration_impl( + &mut self, + class: &mut Class<'a>, + stmt_address: Address, + ctx: &mut TraverseCtx<'a>, + ) { + let mut state = TransformState::Statement(stmt_address); + + let class_scope_id = class.scope_id(); + let has_super_class = class.super_class.is_some(); + self.transform_class_body( + &mut class.body, + class_scope_id, + has_super_class, + &mut state, + ctx, + ); + } + + /// Main guts of the transform. + fn transform_class_body( + &mut self, + body: &mut ClassBody<'a>, + class_scope_id: ScopeId, + has_super_class: bool, + state: &mut TransformState<'a>, + ctx: &mut TraverseCtx<'a>, + ) { + // Check if class has any properties and get index and `ScopeId` of constructor (if class has one) + let mut instance_prop_count = 0; + let mut static_props_count = 0; + let mut constructor = None; + let mut index_not_including_properties = 0; + for element in &body.body { + match element { + ClassElement::PropertyDefinition(prop) => { + if !prop.decorators.is_empty() + || prop.r#type == PropertyDefinitionType::TSAbstractPropertyDefinition + { + // TODO: Raise error + return; + } + + if prop.r#static { + static_props_count += 1; + } else { + instance_prop_count += 1; + } + continue; + } + ClassElement::MethodDefinition(method) => { + if method.kind == MethodDefinitionKind::Constructor + && method.value.body.is_some() + { + constructor = + Some((index_not_including_properties, method.value.scope_id())); + } + } + _ => {} + } + + index_not_including_properties += 1; + } + + if instance_prop_count == 0 && static_props_count == 0 { + return; + } + + // Extract properties from class body + let mut instance_inits = Vec::with_capacity(instance_prop_count); + // let mut static_props = Vec::with_capacity(static_props_count); + body.body.retain_mut(|element| { + if let ClassElement::PropertyDefinition(prop) = element { + if prop.r#static { + self.convert_static_property(prop, state, ctx); + } else { + self.convert_instance_property(prop, &mut instance_inits, state, ctx); + } + false + } else { + // TODO: If a method with computed key which is before last property with computed key, + // convert method key to temp var to preserve evaluations order for keys + true + } + }); + + // Insert instance initializers into constructor + if !instance_inits.is_empty() { + // TODO: Re-parent any scopes within initializers. + if let Some((constructor_index, _)) = constructor { + // Existing constructor - amend it + Self::insert_inits_into_constructor(body, instance_inits, constructor_index, ctx); + } else { + // No constructor - create one + Self::insert_constructor( + body, + instance_inits, + class_scope_id, + has_super_class, + ctx, + ); + } + } + + // TODO: Static properties + } + + /// Convert instance property to initialization expression. + /// Property `foo = 123;` -> Expression `this.foo = 123` or `_defineProperty(this, "foo", 123)`. + fn convert_instance_property( + &mut self, + prop: &mut PropertyDefinition<'a>, + instance_inits: &mut Vec>, + state: &mut TransformState<'a>, + ctx: &mut TraverseCtx<'a>, + ) { + // Get value + let value = match &mut prop.value { + Some(value) => ctx.ast.move_expression(value), + None => ctx.ast.void_0(SPAN), + }; + + // Convert to assignment or `_defineProperty` call, depending on `loose` option + let init_expr = if self.set_public_class_fields { + // `this.foo = value` + self.convert_loose_instance_property(prop, value, state, ctx) + } else { + // `_defineProperty(this, "foo", value)` + self.convert_non_loose_instance_property(prop, value, state, ctx) + }; + + instance_inits.push(init_expr); + } + + /// Convert static property to initialization expression. + /// Property `static foo = 123;` -> Expression `C.foo = 123` or `_defineProperty(C, "foo", 123)`. + fn convert_static_property( + &mut self, + prop: &mut PropertyDefinition<'a>, + state: &mut TransformState<'a>, + ctx: &mut TraverseCtx<'a>, + ) { + match &mut prop.key { + PropertyKey::StaticIdentifier(_ident) => { + // TODO + } + PropertyKey::PrivateIdentifier(_) => { + // TODO: Handle private properties + } + key @ match_expression!(PropertyKey) => { + self.create_computed_key_temp_var(key.to_expression_mut(), state, ctx); + } + }; + } + + /// `this.foo = value` + fn convert_loose_instance_property( + &mut self, + prop: &mut PropertyDefinition<'a>, + value: Expression<'a>, + state: &mut TransformState<'a>, + ctx: &mut TraverseCtx<'a>, + ) -> Expression<'a> { + let this = ctx.ast.expression_this(SPAN); + let left = match &mut prop.key { + PropertyKey::StaticIdentifier(ident) => { + ctx.ast.member_expression_static(SPAN, this, ident.as_ref().clone(), false) + } + PropertyKey::PrivateIdentifier(_) => { + // TODO: Handle private properties + ctx.ast.member_expression_static( + SPAN, + this, + ctx.ast.identifier_name(SPAN, Atom::from("oops")), + false, + ) + } + key @ match_expression!(PropertyKey) => { + let key = self.create_computed_key_temp_var(key.to_expression_mut(), state, ctx); + ctx.ast.member_expression_computed(SPAN, this, key, false) + } + }; + + // TODO: Should this have span of the original `PropertyDefinition`? + ctx.ast.expression_assignment( + SPAN, + AssignmentOperator::Assign, + AssignmentTarget::from(left), + value, + ) + } + + /// `_defineProperty(this, "foo", value)` + fn convert_non_loose_instance_property( + &mut self, + prop: &mut PropertyDefinition<'a>, + value: Expression<'a>, + state: &mut TransformState<'a>, + ctx: &mut TraverseCtx<'a>, + ) -> Expression<'a> { + let key = match &mut prop.key { + PropertyKey::StaticIdentifier(ident) => { + ctx.ast.expression_string_literal(ident.span, ident.name.clone()) + } + PropertyKey::PrivateIdentifier(_) => { + // TODO: Handle private properties + ctx.ast.expression_string_literal(SPAN, Atom::from("oops")) + } + key @ match_expression!(PropertyKey) => { + self.create_computed_key_temp_var(key.to_expression_mut(), state, ctx) + } + }; + + let arguments = ctx.ast.vec_from_iter([ + Argument::from(ctx.ast.expression_this(SPAN)), + Argument::from(key), + Argument::from(value), + ]); + // TODO: Should this have span of the original `PropertyDefinition`? + self.ctx.helper_call_expr(Helper::DefineProperty, arguments, ctx) + } + + /// Convert computed property/method key to a temp var. + /// + /// Transformation is: + /// * Class declaration: + /// `class C { [x()] = 1; }` -> `let _x; _x = x(); class C { constructor() { this[_x] = 1; } }` + /// * Class expression: + /// `C = class { [x()] = 1; }` -> `let _x; C = (_x = x(), class C { constructor() { this[_x] = 1; } })` + /// + /// This function: + /// * Creates the `let _x;` statement and inserts it. + /// * Creates the `_x = x()` assignments. + /// * Inserts assignments before class declaration, or adds to `state` if class expression. + /// * Returns `_x`. + fn create_computed_key_temp_var( + &mut self, + key: &mut Expression<'a>, + state: &mut TransformState<'a>, + ctx: &mut TraverseCtx<'a>, + ) -> Expression<'a> { + // TODO: Bound vars and literals do not need temp vars + // e.g. `let x = 'x'; class C { [x] = 1; }` or `class C { ['x'] = 1; }` + + // We entered transform via `enter_expression` or `enter_statement`, + // so `ctx.current_scope_id()` is the scope outside the class + let parent_scope_id = ctx.current_scope_id(); + // TODO: Handle if is a class expression defined in a function's params. + let binding = + ctx.generate_uid_based_on_node(key, parent_scope_id, SymbolFlags::BlockScopedVariable); + + self.ctx.var_declarations.insert_let(&binding, None, ctx); + + let key = ctx.ast.move_expression(key); + match state { + TransformState::Expression(assignments) => { + let assignment = + Self::create_assignment(&binding, key, ReferenceFlags::read_write(), ctx); + assignments.push(assignment); + } + TransformState::Statement(class_address) => { + let assignment = Self::create_assignment(&binding, key, ReferenceFlags::Write, ctx); + let stmt = ctx.ast.statement_expression(SPAN, assignment); + self.ctx.statement_injector.insert_before(class_address, stmt); + } + } + + binding.create_read_expression(ctx) + } + + /// Create assignment to a binding. + fn create_assignment( + binding: &BoundIdentifier<'a>, + value: Expression<'a>, + flags: ReferenceFlags, + ctx: &mut TraverseCtx<'a>, + ) -> Expression<'a> { + ctx.ast.expression_assignment( + SPAN, + AssignmentOperator::Assign, + binding.create_target(flags, ctx), + value, + ) + } + + fn insert_inits_into_constructor( + body: &mut ClassBody<'a>, + inits: Vec>, + constructor_index: usize, + ctx: &mut TraverseCtx<'a>, + ) { + // TODO: Insert after `super()` if class has super-class. + // TODO: Insert as expression sequence if `super()` is used in an expression. + // TODO: Handle where vars used in property init clash with vars in top scope of constructor. + let element = body.body.get_mut(constructor_index).unwrap(); + let ClassElement::MethodDefinition(method) = element else { unreachable!() }; + let func_body = method.value.body.as_mut().unwrap(); + func_body + .statements + .splice(0..0, inits.into_iter().map(|expr| ctx.ast.statement_expression(SPAN, expr))); + } + + fn insert_constructor( + body: &mut ClassBody<'a>, + inits: Vec>, + class_scope_id: ScopeId, + has_super_class: bool, + ctx: &mut TraverseCtx<'a>, + ) { + // Create scope for constructor + let scope_id = ctx.scopes_mut().add_scope( + Some(class_scope_id), + NodeId::DUMMY, + ScopeFlags::Function | ScopeFlags::Constructor | ScopeFlags::StrictMode, + ); + + // Create statements to go in function body. + let mut stmts = ctx.ast.vec_with_capacity(inits.len() + usize::from(has_super_class)); + + // Add `super(...args);` statement and `...args` param if class has a super class. + // `constructor(...args) { super(...args); /* prop initialization */ }` + // TODO: Rename `args` if one of initializers uses a var called `args` + let mut params_rest = None; + if has_super_class { + let binding = ctx.generate_binding( + Atom::from("args"), + scope_id, + SymbolFlags::FunctionScopedVariable, + ); + params_rest = + Some(ctx.ast.alloc_binding_rest_element(SPAN, binding.create_binding_pattern(ctx))); + stmts.push(Self::create_super_call_stmt(&binding, ctx)); + } + // TODO: Should these have the span of the original `PropertyDefinition`s? + stmts.extend(inits.into_iter().map(|expr| ctx.ast.statement_expression(SPAN, expr))); + + let ctor = ClassElement::MethodDefinition(ctx.ast.alloc_method_definition( + MethodDefinitionType::MethodDefinition, + SPAN, + ctx.ast.vec(), + PropertyKey::StaticIdentifier( + ctx.ast.alloc_identifier_name(SPAN, Atom::from("constructor")), + ), + ctx.ast.alloc_function_with_scope_id( + FunctionType::FunctionExpression, + SPAN, + None, + false, + false, + false, + NONE, + NONE, + ctx.ast.alloc_formal_parameters( + SPAN, + FormalParameterKind::FormalParameter, + ctx.ast.vec(), + params_rest, + ), + NONE, + Some(ctx.ast.alloc_function_body(SPAN, ctx.ast.vec(), stmts)), + scope_id, + ), + MethodDefinitionKind::Constructor, + false, + false, + false, + false, + None, + )); + + // TODO(improve-on-babel): Could push constructor onto end of elements, instead of inserting as first + body.body.insert(0, ctor); + } + + /// `super(...args);` + fn create_super_call_stmt( + binding: &BoundIdentifier<'a>, + ctx: &mut TraverseCtx<'a>, + ) -> Statement<'a> { + let args_ident = binding.create_read_expression(ctx); + ctx.ast.statement_expression( + SPAN, + ctx.ast.expression_call( + SPAN, + ctx.ast.expression_super(SPAN), + NONE, + ctx.ast.vec1(ctx.ast.argument_spread_element(SPAN, args_ident)), + false, + ), + ) + } } diff --git a/crates/oxc_transformer/src/es2022/mod.rs b/crates/oxc_transformer/src/es2022/mod.rs index c0ad06a5fb0838..64dde49cbce568 100644 --- a/crates/oxc_transformer/src/es2022/mod.rs +++ b/crates/oxc_transformer/src/es2022/mod.rs @@ -1,7 +1,7 @@ use oxc_ast::ast::*; use oxc_traverse::{Traverse, TraverseCtx}; -use crate::TransformCtx; +use crate::{CompilerAssumptions, TransformCtx}; mod class_properties; mod class_static_block; @@ -14,31 +14,53 @@ use class_static_block::ClassStaticBlock; pub use options::ES2022Options; pub struct ES2022<'a, 'ctx> { - options: ES2022Options, // Plugins - class_static_block: ClassStaticBlock, - class_properties: Option>, + static_block_only: bool, + static_block: ClassStaticBlock, + properties: Option>, } impl<'a, 'ctx> ES2022<'a, 'ctx> { - pub fn new(options: ES2022Options, ctx: &'ctx TransformCtx<'a>) -> Self { - Self { - options, - class_static_block: ClassStaticBlock::new(), - class_properties: options - .class_properties - .map(|options| ClassProperties::new(options, ctx)), - } + pub fn new( + options: ES2022Options, + assumptions: &CompilerAssumptions, + ctx: &'ctx TransformCtx<'a>, + ) -> Self { + // Class properties transform performs the static block transform differently. + // So only enable static block transform if class properties transform is disabled. + let (static_block_only, properties) = match options.class_properties { + Some(properties_options) => ( + false, + Some(ClassProperties::new( + properties_options, + assumptions, + options.class_static_block, + ctx, + )), + ), + None => (options.class_static_block, None), + }; + + Self { static_block_only, static_block: ClassStaticBlock::new(), properties } } } impl<'a, 'ctx> Traverse<'a> for ES2022<'a, 'ctx> { - fn enter_class_body(&mut self, body: &mut ClassBody<'a>, ctx: &mut TraverseCtx<'a>) { - if self.options.class_static_block { - self.class_static_block.enter_class_body(body, ctx); + fn enter_expression(&mut self, expr: &mut Expression<'a>, ctx: &mut TraverseCtx<'a>) { + if let Some(properties) = &mut self.properties { + properties.enter_expression(expr, ctx); } - if let Some(class_properties) = &mut self.class_properties { - class_properties.enter_class_body(body, ctx); + } + + fn enter_statement(&mut self, stmt: &mut Statement<'a>, ctx: &mut TraverseCtx<'a>) { + if let Some(properties) = &mut self.properties { + properties.enter_statement(stmt, ctx); + } + } + + fn enter_class_body(&mut self, body: &mut ClassBody<'a>, ctx: &mut TraverseCtx<'a>) { + if self.static_block_only { + self.static_block.enter_class_body(body, ctx); } } } diff --git a/crates/oxc_transformer/src/lib.rs b/crates/oxc_transformer/src/lib.rs index 8e583531cebe10..35a7fd3fc7a528 100644 --- a/crates/oxc_transformer/src/lib.rs +++ b/crates/oxc_transformer/src/lib.rs @@ -100,7 +100,7 @@ impl<'a> Transformer<'a> { .is_typescript() .then(|| TypeScript::new(&self.options.typescript, &self.ctx)), x1_jsx: Jsx::new(self.options.jsx, ast_builder, &self.ctx), - x2_es2022: ES2022::new(self.options.env.es2022, &self.ctx), + x2_es2022: ES2022::new(self.options.env.es2022, &self.options.assumptions, &self.ctx), x2_es2021: ES2021::new(self.options.env.es2021, &self.ctx), x2_es2020: ES2020::new(self.options.env.es2020, &self.ctx), x2_es2019: ES2019::new(self.options.env.es2019), @@ -220,6 +220,7 @@ impl<'a, 'ctx> Traverse<'a> for TransformerImpl<'a, 'ctx> { if let Some(typescript) = self.x0_typescript.as_mut() { typescript.enter_expression(expr, ctx); } + self.x2_es2022.enter_expression(expr, ctx); self.x2_es2021.enter_expression(expr, ctx); self.x2_es2020.enter_expression(expr, ctx); self.x2_es2018.enter_expression(expr, ctx); @@ -429,6 +430,7 @@ impl<'a, 'ctx> Traverse<'a> for TransformerImpl<'a, 'ctx> { if let Some(typescript) = self.x0_typescript.as_mut() { typescript.enter_statement(stmt, ctx); } + self.x2_es2022.enter_statement(stmt, ctx); self.x2_es2018.enter_statement(stmt, ctx); } diff --git a/crates/oxc_transformer/tests/integrations/snapshots/es_target.snap b/crates/oxc_transformer/tests/integrations/snapshots/es_target.snap index 6993434205ff43..0af3ee5e1d940c 100644 --- a/crates/oxc_transformer/tests/integrations/snapshots/es_target.snap +++ b/crates/oxc_transformer/tests/integrations/snapshots/es_target.snap @@ -50,5 +50,5 @@ a || (a = b); class foo { static {} } ---------- class foo { - static #_ = (() => {})(); + static {} } diff --git a/tasks/transform_conformance/snapshots/babel.snap.md b/tasks/transform_conformance/snapshots/babel.snap.md index 22a15bcaf0116d..f51189da10c5d6 100644 --- a/tasks/transform_conformance/snapshots/babel.snap.md +++ b/tasks/transform_conformance/snapshots/babel.snap.md @@ -1,6 +1,6 @@ commit: d20b314c -Passed: 377/1078 +Passed: 405/1326 # All Passed: * babel-plugin-transform-class-static-block @@ -1427,6 +1427,680 @@ x Output mismatch x Output mismatch +# babel-plugin-transform-class-properties (28/248) +* assumption-constantSuper/complex-super-class/input.js +x Output mismatch + +* assumption-constantSuper/static-field/input.js +x Output mismatch + +* assumption-noDocumentAll/optional-chain-before-member-call/input.js +x Output mismatch + +* assumption-noDocumentAll/optional-chain-cast-to-boolean/input.js +x Output mismatch + +* assumption-noUninitializedPrivateFieldAccess/static-private/input.js +x Output mismatch + +* assumption-setPublicClassFields/computed/input.js +x Output mismatch + +* assumption-setPublicClassFields/constructor-collision/input.js +x Output mismatch + +* assumption-setPublicClassFields/foobar/input.js +x Output mismatch + +* assumption-setPublicClassFields/length-name-use-define/input.js +x Output mismatch + +* assumption-setPublicClassFields/non-block-arrow-func/input.mjs +x Output mismatch + +* assumption-setPublicClassFields/regression-T2983/input.mjs +x Output mismatch + +* assumption-setPublicClassFields/regression-T6719/input.js +x Output mismatch + +* assumption-setPublicClassFields/regression-T7364/input.mjs +x Output mismatch + +* assumption-setPublicClassFields/static/input.js +x Output mismatch + +* assumption-setPublicClassFields/static-class-binding/input.js +x Output mismatch + +* assumption-setPublicClassFields/static-export/input.mjs +x Output mismatch + +* assumption-setPublicClassFields/static-infer-name/input.js +x Output mismatch + +* assumption-setPublicClassFields/static-super/input.js +x Output mismatch + +* assumption-setPublicClassFields/static-super-loose/input.js +x Output mismatch + +* assumption-setPublicClassFields/static-this/input.js +x Output mismatch + +* assumption-setPublicClassFields/static-undefined/input.js +x Output mismatch + +* assumption-setPublicClassFields/super-expression/input.js +x Output mismatch + +* assumption-setPublicClassFields/super-statement/input.js +x Output mismatch + +* assumption-setPublicClassFields/super-with-collision/input.js +x Output mismatch + +* class-name-tdz/general/input.js +x Output mismatch + +* class-name-tdz/static-edgest-case/input.js +x Output mismatch + +* class-name-tdz/static-general/input.js +x Output mismatch + +* class-name-tdz/static-loose/input.js +x Output mismatch + +* compile-to-class/constructor-collision-ignores-types/input.js +Unresolved references mismatch: +after transform: ["T", "babelHelpers"] +rebuilt : ["babelHelpers"] + +* compile-to-class/constructor-collision-ignores-types-loose/input.js +Unresolved references mismatch: +after transform: ["T"] +rebuilt : [] + +* compile-to-class/preserve-comments/input.js +x Output mismatch + +* nested-class/super-call-in-decorator/input.js +x Output mismatch + +* nested-class/super-property-in-accessor-key/input.js +x Output mismatch + +* nested-class/super-property-in-decorator/input.js +x Output mismatch + +* private/1-helpermemberexpressionfunction/input.js +x Output mismatch + +* private/assignment/input.js +x Output mismatch + +* private/call/input.js +x Output mismatch + +* private/canonical/input.js +x Output mismatch + +* private/class-shadow-builtins/input.mjs +x Output mismatch + +* private/constructor-collision/input.js +x Output mismatch + +* private/declaration-order/input.js +x Output mismatch + +* private/derived/input.js +x Output mismatch + +* private/derived-multiple-supers/input.js +x Output mismatch + +* private/destructuring-array-pattern/input.js +x Output mismatch + +* private/destructuring-array-pattern-1/input.js +x Output mismatch + +* private/destructuring-array-pattern-2/input.js +x Output mismatch + +* private/destructuring-array-pattern-3/input.js +x Output mismatch + +* private/destructuring-array-pattern-static/input.js +x Output mismatch + +* private/destructuring-object-pattern/input.js +x Output mismatch + +* private/destructuring-object-pattern-1/input.js +x Output mismatch + +* private/destructuring-object-pattern-2/input.js +x Output mismatch + +* private/destructuring-object-pattern-3/input.js +x Output mismatch + +* private/destructuring-object-pattern-static/input.js +x Output mismatch + +* private/extracted-this/input.js +x Output mismatch + +* private/foobar/input.js +x Output mismatch + +* private/instance/input.js +x Output mismatch + +* private/instance-undefined/input.js +x Output mismatch + +* private/logical-assignment/input.js +x Output mismatch + +* private/multiple/input.js +x Output mismatch + +* private/native-classes/input.js +x Output mismatch + +* private/nested-class/input.js +x Output mismatch + +* private/nested-class-computed/input.js +x Output mismatch + +* private/nested-class-computed-redeclared/input.js +x Output mismatch + +* private/nested-class-extends-computed/input.js +x Output mismatch + +* private/nested-class-extends-computed-redeclared/input.js +x Output mismatch + +* private/nested-class-other-redeclared/input.js +x Output mismatch + +* private/nested-class-redeclared/input.js +x Output mismatch + +* private/non-block-arrow-func/input.mjs +x Output mismatch + +* private/optional-chain-before-member-call/input.js +x Output mismatch + +* private/optional-chain-before-property/input.js +x Output mismatch + +* private/optional-chain-cast-to-boolean/input.js +x Output mismatch + +* private/optional-chain-delete-property/input.js +x Output mismatch + +* private/optional-chain-in-function-param/input.js +x Output mismatch + +* private/optional-chain-member-optional-call/input.js +x Output mismatch + +* private/optional-chain-member-optional-call-spread-arguments/input.js +x Output mismatch + +* private/optional-chain-optional-member-call/input.js +x Output mismatch + +* private/optional-chain-optional-property/input.js +x Output mismatch + +* private/parenthesized-optional-member-call/input.js +x Output mismatch + +* private/preserve-comments/input.js +x Output mismatch + +* private/private-in-derived/input.js +x Output mismatch + +* private/reevaluated/input.js +x Output mismatch + +* private/reference-in-other-property/input.js +x Output mismatch + +* private/regression-T2983/input.mjs +x Output mismatch + +* private/regression-T6719/input.js +x Output mismatch + +* private/regression-T7364/input.mjs +x Output mismatch + +* private/static/input.js +x Output mismatch + +* private/static-call/input.js +x Output mismatch + +* private/static-class-binding/input.js +x Output mismatch + +* private/static-export/input.mjs +x Output mismatch + +* private/static-infer-name/input.js +x Output mismatch + +* private/static-inherited/input.js +x Output mismatch + +* private/static-self-field/input.js +x Output mismatch + +* private/static-shadow/input.js +x Output mismatch + +* private/static-this/input.js +x Output mismatch + +* private/static-undefined/input.js +x Output mismatch + +* private/super-call/input.js +x Output mismatch + +* private/super-expression/input.js +x Output mismatch + +* private/super-statement/input.js +x Output mismatch + +* private/tagged-template/input.js +x Output mismatch + +* private/update/input.js +x Output mismatch + +* private-loose/assignment/input.js +x Output mismatch + +* private-loose/call/input.js +x Output mismatch + +* private-loose/canonical/input.js +x Output mismatch + +* private-loose/class-shadow-builtins/input.mjs +x Output mismatch + +* private-loose/constructor-collision/input.js +x Output mismatch + +* private-loose/declaration-order/input.js +x Output mismatch + +* private-loose/derived/input.js +x Output mismatch + +* private-loose/derived-multiple-supers/input.js +x Output mismatch + +* private-loose/destructuring-array-pattern/input.js +x Output mismatch + +* private-loose/destructuring-array-pattern-1/input.js +x Output mismatch + +* private-loose/destructuring-array-pattern-2/input.js +x Output mismatch + +* private-loose/destructuring-array-pattern-3/input.js +x Output mismatch + +* private-loose/destructuring-array-pattern-static/input.js +x Output mismatch + +* private-loose/destructuring-object-pattern/input.js +x Output mismatch + +* private-loose/destructuring-object-pattern-1/input.js +x Output mismatch + +* private-loose/destructuring-object-pattern-2/input.js +x Output mismatch + +* private-loose/destructuring-object-pattern-3/input.js +x Output mismatch + +* private-loose/destructuring-object-pattern-static/input.js +x Output mismatch + +* private-loose/extracted-this/input.js +x Output mismatch + +* private-loose/foobar/input.js +x Output mismatch + +* private-loose/instance/input.js +x Output mismatch + +* private-loose/instance-undefined/input.js +x Output mismatch + +* private-loose/logical-assignment/input.js +x Output mismatch + +* private-loose/multiple/input.js +x Output mismatch + +* private-loose/native-classes/input.js +x Output mismatch + +* private-loose/nested-class/input.js +x Output mismatch + +* private-loose/nested-class-computed/input.js +x Output mismatch + +* private-loose/nested-class-computed-redeclared/input.js +x Output mismatch + +* private-loose/nested-class-extends-computed/input.js +x Output mismatch + +* private-loose/nested-class-extends-computed-redeclared/input.js +x Output mismatch + +* private-loose/nested-class-other-redeclared/input.js +x Output mismatch + +* private-loose/nested-class-redeclared/input.js +x Output mismatch + +* private-loose/non-block-arrow-func/input.mjs +x Output mismatch + +* private-loose/optional-chain-before-member-call/input.js +x Output mismatch + +* private-loose/optional-chain-before-property/input.js +x Output mismatch + +* private-loose/optional-chain-cast-to-boolean/input.js +x Output mismatch + +* private-loose/optional-chain-delete-property/input.js +x Output mismatch + +* private-loose/optional-chain-in-function-param/input.js +x Output mismatch + +* private-loose/optional-chain-member-optional-call/input.js +x Output mismatch + +* private-loose/optional-chain-member-optional-call-spread-arguments/input.js +x Output mismatch + +* private-loose/optional-chain-optional-member-call/input.js +x Output mismatch + +* private-loose/optional-chain-optional-property/input.js +x Output mismatch + +* private-loose/parenthesized-optional-member-call/input.js +x Output mismatch + +* private-loose/preserve-comments/input.js +x Output mismatch + +* private-loose/private-in-derived/input.js +x Output mismatch + +* private-loose/reevaluated/input.js +x Output mismatch + +* private-loose/reference-in-other-property/input.js +x Output mismatch + +* private-loose/static/input.js +x Output mismatch + +* private-loose/static-call/input.js +x Output mismatch + +* private-loose/static-class-binding/input.js +x Output mismatch + +* private-loose/static-export/input.mjs +x Output mismatch + +* private-loose/static-infer-name/input.js +x Output mismatch + +* private-loose/static-inherited/input.js +x Output mismatch + +* private-loose/static-shadow/input.js +x Output mismatch + +* private-loose/static-this/input.js +x Output mismatch + +* private-loose/static-undefined/input.js +x Output mismatch + +* private-loose/super-expression/input.js +x Output mismatch + +* private-loose/super-statement/input.js +x Output mismatch + +* private-loose/update/input.js +x Output mismatch + +* public/arrow-static-this-without-transform/input.js +x Output mismatch + +* public/call/input.js +Scope children mismatch: +after transform: ScopeId(1): [ScopeId(2), ScopeId(3), ScopeId(4)] +rebuilt : ScopeId(1): [ScopeId(2), ScopeId(4)] +Scope children mismatch: +after transform: ScopeId(4): [] +rebuilt : ScopeId(2): [ScopeId(3)] +Scope parent mismatch: +after transform: ScopeId(2): Some(ScopeId(1)) +rebuilt : ScopeId(3): Some(ScopeId(2)) + +* public/class-shadow-builtins/input.mjs +x Output mismatch + +* public/computed/input.js +x Output mismatch + +* public/computed-toPrimitive/input.js +x Output mismatch + +* public/constructor-collision/input.js +x Output mismatch + +* public/delete-super-property/input.js +x Output mismatch + +* public/delete-this/input.js +x Output mismatch + +* public/derived-multiple-supers/input.js +x Output mismatch + +* public/derived-super-in-default-params/input.js +x Output mismatch + +* public/derived-super-in-default-params-complex/input.js +x Output mismatch + +* public/derived-super-in-default-params-in-arrow/input.js +x Output mismatch + +* public/extracted-this/input.js +x Output mismatch + +* public/foobar/input.js +x Output mismatch + +* public/native-classes/input.js +x Output mismatch + +* public/non-block-arrow-func/input.mjs +x Output mismatch + +* public/numeric/input.js +x Output mismatch + +* public/preserve-comments/input.js +x Output mismatch + +* public/regression-T2983/input.mjs +x Output mismatch + +* public/regression-T6719/input.js +x Output mismatch + +* public/regression-T7364/input.mjs +x Output mismatch + +* public/static/input.js +x Output mismatch + +* public/static-class-binding/input.js +x Output mismatch + +* public/static-export/input.mjs +x Output mismatch + +* public/static-infer-name/input.js +x Output mismatch + +* public/static-super/input.js +x Output mismatch + +* public/static-this/input.js +x Output mismatch + +* public/static-undefined/input.js +x Output mismatch + +* public/super-expression/input.js +x Output mismatch + +* public/super-statement/input.js +x Output mismatch + +* public/super-with-collision/input.js +x Output mismatch + +* public-loose/arrow-static-this-without-transform/input.js +x Output mismatch + +* public-loose/class-shadow-builtins/input.mjs +x Output mismatch + +* public-loose/computed/input.js +x Output mismatch + +* public-loose/constructor-collision/input.js +x Output mismatch + +* public-loose/foobar/input.js +x Output mismatch + +* public-loose/non-block-arrow-func/input.mjs +x Output mismatch + +* public-loose/preserve-comments/input.js +x Output mismatch + +* public-loose/regression-T2983/input.mjs +x Output mismatch + +* public-loose/regression-T6719/input.js +x Output mismatch + +* public-loose/regression-T7364/input.mjs +x Output mismatch + +* public-loose/static/input.js +x Output mismatch + +* public-loose/static-class-binding/input.js +x Output mismatch + +* public-loose/static-export/input.mjs +x Output mismatch + +* public-loose/static-infer-name/input.js +x Output mismatch + +* public-loose/static-super/input.js +x Output mismatch + +* public-loose/static-this/input.js +x Output mismatch + +* public-loose/static-undefined/input.js +x Output mismatch + +* public-loose/super-expression/input.js +x Output mismatch + +* public-loose/super-statement/input.js +x Output mismatch + +* public-loose/super-with-collision/input.js +x Output mismatch + +* regression/6153/input.js +x Output mismatch + +* regression/6154/input.js +x Output mismatch + +* regression/7371/input.js +x Output mismatch + +* regression/7951/input.mjs +x Output mismatch + +* regression/8110/input.js +x Output mismatch + +* regression/8882/input.js +x Output mismatch + +* regression/T2983/input.mjs +x Output mismatch + +* regression/T6719/input.js +x Output mismatch + +* regression/T7364/input.mjs +x Output mismatch + +* regression/multiple-super-in-termary/input.js +x Output mismatch + + # babel-plugin-transform-nullish-coalescing-operator (5/12) * assumption-noDocumentAll/transform/input.js x Output mismatch diff --git a/tasks/transform_conformance/snapshots/babel_exec.snap.md b/tasks/transform_conformance/snapshots/babel_exec.snap.md index 5f39b203e7c90e..e20e15507f0f14 100644 --- a/tasks/transform_conformance/snapshots/babel_exec.snap.md +++ b/tasks/transform_conformance/snapshots/babel_exec.snap.md @@ -1,7 +1,7 @@ commit: d20b314c node: v22.11.0 -⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯ +⎯⎯⎯⎯⎯⎯ Failed Suites 93 ⎯⎯⎯⎯⎯⎯ FAIL fixtures/babel-plugin-transform-arrow-functions-test-fixtures-arrow-functions-implicit-var-arguments-exec.test.js [ fixtures/babel-plugin-transform-arrow-functions-test-fixtures-arrow-functions-implicit-var-arguments-exec.test.js ] Error: 'eval' and 'arguments' cannot be used as a binding identifier in strict mode @@ -11,9 +11,917 @@ Error: 'eval' and 'arguments' cannot be used as a binding identifier in strict m ❯ ssrTransformScript ../../node_modules/.pnpm/vite@5.4.8_@types+node@22.8.4/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:52319:11 ❯ loadAndTransform ../../node_modules/.pnpm/vite@5.4.8_@types+node@22.8.4/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:51917:72 -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/14]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/132]⎯ -⎯⎯⎯⎯⎯⎯ Failed Tests 13 ⎯⎯⎯⎯⎯⎯⎯ + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-noDocumentAll-optional-chain-before-member-call-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-noDocumentAll-optional-chain-before-member-call-exec.test.js ] +SyntaxError: Private field '#m' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-noDocumentAll-optional-chain-cast-to-boolean-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-noDocumentAll-optional-chain-cast-to-boolean-exec.test.js ] +SyntaxError: Private field '#a' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-noUninitializedPrivateFieldAccess-static-private-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-noUninitializedPrivateFieldAccess-static-private-exec.test.js ] +SyntaxError: Private field '#x' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-nested-class-super-call-in-decorator-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-nested-class-super-call-in-decorator-exec.test.js ] +SyntaxError: Invalid or unexpected token +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-nested-class-super-property-in-accessor-key-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-nested-class-super-property-in-accessor-key-exec.test.js ] +Error: Unexpected token `[`. Expected * for generator, private key, identifier or async + ❯ getRollupError ../../node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/parseAst.js:395:41 + ❯ convertProgram ../../node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/parseAst.js:1083:26 + ❯ parseAstAsync ../../node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/parseAst.js:2069:106 + ❯ ssrTransformScript ../../node_modules/.pnpm/vite@5.4.8_@types+node@22.8.4/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:52319:11 + ❯ loadAndTransform ../../node_modules/.pnpm/vite@5.4.8_@types+node@22.8.4/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:51917:72 + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-nested-class-super-property-in-decorator-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-nested-class-super-property-in-decorator-exec.test.js ] +SyntaxError: Invalid or unexpected token +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[7/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-access-before-declaration-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-access-before-declaration-exec.test.js ] +SyntaxError: Private field '#p' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[8/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-call-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-call-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[9/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-canonical-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-canonical-exec.test.js ] +SyntaxError: Private field '#x' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[10/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-constructor-collision-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-constructor-collision-exec.test.js ] +SyntaxError: Private field '#bar' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[11/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-declaration-order-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-declaration-order-exec.test.js ] +SyntaxError: Private field '#x' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[12/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-derived-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-derived-exec.test.js ] +SyntaxError: Private field '#prop' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[13/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-array-pattern-1-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-array-pattern-1-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[14/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-array-pattern-2-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-array-pattern-2-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[15/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-array-pattern-3-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-array-pattern-3-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[16/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-array-pattern-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-array-pattern-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[17/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-array-pattern-static-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-array-pattern-static-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[18/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-object-pattern-1-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-object-pattern-1-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[19/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-object-pattern-2-exec-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-object-pattern-2-exec-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[20/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-object-pattern-3-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-object-pattern-3-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[21/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-object-pattern-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-object-pattern-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[22/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-object-pattern-static-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-destructuring-object-pattern-static-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[23/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-instance-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-instance-exec.test.js ] +SyntaxError: Private field '#bar' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[24/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-instance-undefined-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-instance-undefined-exec.test.js ] +SyntaxError: Private field '#bar' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[25/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-access-before-declaration-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-access-before-declaration-exec.test.js ] +SyntaxError: Private field '#p' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[26/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-call-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-call-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[27/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-canonical-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-canonical-exec.test.js ] +SyntaxError: Private field '#x' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[28/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-constructor-collision-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-constructor-collision-exec.test.js ] +SyntaxError: Private field '#bar' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[29/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-declaration-order-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-declaration-order-exec.test.js ] +SyntaxError: Private field '#x' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[30/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-derived-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-derived-exec.test.js ] +SyntaxError: Private field '#prop' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[31/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-array-pattern-1-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-array-pattern-1-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[32/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-array-pattern-2-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-array-pattern-2-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[33/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-array-pattern-3-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-array-pattern-3-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[34/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-array-pattern-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-array-pattern-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[35/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-array-pattern-static-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-array-pattern-static-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[36/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-object-pattern-1-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-object-pattern-1-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[37/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-object-pattern-2-exec-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-object-pattern-2-exec-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[38/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-object-pattern-3-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-object-pattern-3-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[39/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-object-pattern-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-object-pattern-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[40/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-object-pattern-static-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-destructuring-object-pattern-static-exec.test.js ] +SyntaxError: Private field '#client' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[41/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-instance-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-instance-exec.test.js ] +SyntaxError: Private field '#bar' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[42/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-instance-undefined-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-instance-undefined-exec.test.js ] +SyntaxError: Private field '#bar' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[43/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-multiple-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-multiple-exec.test.js ] +SyntaxError: Private field '#x' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[44/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-nested-class-computed-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-nested-class-computed-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[45/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-nested-class-computed-redeclared-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-nested-class-computed-redeclared-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[46/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-nested-class-extends-computed-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-nested-class-extends-computed-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[47/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-nested-class-extends-computed-redeclared-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-nested-class-extends-computed-redeclared-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[48/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-before-member-call-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-before-member-call-exec.test.js ] +SyntaxError: Private field '#m' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[49/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-before-property-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-before-property-exec.test.js ] +SyntaxError: Private field '#x' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[50/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-cast-to-boolean-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-cast-to-boolean-exec.test.js ] +SyntaxError: Private field '#a' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[51/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-delete-property-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-delete-property-exec.test.js ] +SyntaxError: Private field '#self' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[52/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-in-function-param-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-in-function-param-exec.test.js ] +SyntaxError: Private field '#m' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[53/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-member-optional-call-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-member-optional-call-exec.test.js ] +SyntaxError: Private field '#m' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[54/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-member-optional-call-spread-arguments-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-member-optional-call-spread-arguments-exec.test.js ] +SyntaxError: Private field '#m' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[55/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-optional-member-call-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-optional-member-call-exec.test.js ] +SyntaxError: Private field '#m' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[56/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-optional-property-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-optional-chain-optional-property-exec.test.js ] +SyntaxError: Private field '#x' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[57/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-parenthesized-optional-member-call-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-parenthesized-optional-member-call-exec.test.js ] +SyntaxError: Private field '#m' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[58/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-static-call-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-static-call-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[59/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-static-class-binding-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-static-class-binding-exec.test.js ] +SyntaxError: Private field '#self' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[60/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-static-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-static-exec.test.js ] +SyntaxError: Private field '#bar' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[61/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-static-inherited-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-static-inherited-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[62/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-static-shadow-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-static-shadow-exec.test.js ] +SyntaxError: Private field '#x' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[63/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-static-this-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-static-this-exec.test.js ] +SyntaxError: Private field '#self' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[64/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-static-undefined-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-static-undefined-exec.test.js ] +SyntaxError: Private field '#bar' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[65/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-update-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-loose-update-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[66/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-multiple-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-multiple-exec.test.js ] +SyntaxError: Private field '#x' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[67/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-native-classes-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-native-classes-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[68/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-nested-class-computed-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-nested-class-computed-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[69/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-nested-class-computed-redeclared-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-nested-class-computed-redeclared-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[70/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-nested-class-extends-computed-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-nested-class-extends-computed-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[71/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-nested-class-extends-computed-redeclared-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-nested-class-extends-computed-redeclared-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[72/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-before-member-call-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-before-member-call-exec.test.js ] +SyntaxError: Private field '#m' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[73/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-before-property-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-before-property-exec.test.js ] +SyntaxError: Private field '#x' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[74/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-cast-to-boolean-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-cast-to-boolean-exec.test.js ] +SyntaxError: Private field '#a' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[75/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-delete-property-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-delete-property-exec.test.js ] +SyntaxError: Private field '#self' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[76/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-in-function-param-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-in-function-param-exec.test.js ] +SyntaxError: Private field '#m' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[77/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-member-optional-call-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-member-optional-call-exec.test.js ] +SyntaxError: Private field '#m' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[78/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-member-optional-call-spread-arguments-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-member-optional-call-spread-arguments-exec.test.js ] +SyntaxError: Private field '#m' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[79/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-optional-member-call-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-optional-member-call-exec.test.js ] +SyntaxError: Private field '#m' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[80/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-optional-property-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-optional-chain-optional-property-exec.test.js ] +SyntaxError: Private field '#x' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[81/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-parenthesized-optional-member-call-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-parenthesized-optional-member-call-exec.test.js ] +SyntaxError: Private field '#m' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[82/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-reevaluated-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-reevaluated-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[83/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-static-call-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-static-call-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[84/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-static-class-binding-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-static-class-binding-exec.test.js ] +SyntaxError: Private field '#self' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[85/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-static-inherited-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-static-inherited-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[86/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-static-self-field-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-static-self-field-exec.test.js ] +SyntaxError: Private field '#x' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[87/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-static-shadow-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-static-shadow-exec.test.js ] +SyntaxError: Private field '#x' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[88/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-static-this-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-static-this-exec.test.js ] +SyntaxError: Private field '#self' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[89/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-static-undefined-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-static-undefined-exec.test.js ] +SyntaxError: Private field '#bar' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[90/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-tagged-template-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-tagged-template-exec.test.js ] +SyntaxError: Private field '#tag2' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[91/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-private-update-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-private-update-exec.test.js ] +SyntaxError: Private field '#foo' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[92/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-regression-8882-exec.test.js [ fixtures/babel-plugin-transform-class-properties-test-fixtures-regression-8882-exec.test.js ] +SyntaxError: Private field '#bar' must be declared in an enclosing class +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[93/132]⎯ + +⎯⎯⎯⎯⎯⎯ Failed Tests 39 ⎯⎯⎯⎯⎯⎯⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-setPublicClassFields-computed-initialization-order-exec.test.js > exec +AssertionError: expected [ 1, 2, 5, 6, 7, 9, 3, 4, 8, 13, …(2) ] to deeply equal [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, …(5) ] + +- Expected ++ Received + + Array [ + 1, + 2, +- 3, +- 4, + 5, + 6, + 7, +- 8, + 9, +- 10, +- 11, +- 12, ++ 3, ++ 4, ++ 8, + 13, + 14, + 15, + ] + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-setPublicClassFields-computed-initialization-order-exec.test.js:48:22 + 46| 15 + 47| ]; + 48| expect(actualOrder).toEqual(expectedOrder); + | ^ + 49| expect(MyClass[1]).toBe(10); + 50| expect(inst[2]).toBe(13); + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[94/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-setPublicClassFields-static-class-binding-exec.test.js > exec +AssertionError: expected undefined to be [Function A] // Object.is equality + +- Expected: +[Function A] + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-setPublicClassFields-static-class-binding-exec.test.js:7:20 + 5| const oldA = A; + 6| A = null; + 7| expect(oldA.self).toBe(oldA); + | ^ + 8| expect(oldA.getA()).toBe(oldA); + 9| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[95/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-setPublicClassFields-static-exec.test.js > exec +AssertionError: expected undefined to be +0 // Object.is equality + +- Expected: +0 + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-setPublicClassFields-static-exec.test.js:5:18 + 3| test("exec", () => { + 4| class Foo {} + 5| expect(Foo.num).toBe(0); + | ^ + 6| expect(Foo.num = 1).toBe(1); + 7| expect(Foo.str).toBe("foo"); + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[96/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-setPublicClassFields-static-infer-name-exec.test.js > exec +AssertionError: expected undefined to be +0 // Object.is equality + +- Expected: +0 + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-setPublicClassFields-static-infer-name-exec.test.js:5:18 + 3| test("exec", () => { + 4| var Foo = class {}; + 5| expect(Foo.num).toBe(0); + | ^ + 6| expect(Foo.num = 1).toBe(1); + 7| expect(Foo.name).toBe("Foo"); + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[97/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-setPublicClassFields-static-super-exec.test.js > exec +AssertionError: expected undefined to be 2 // Object.is equality + +- Expected: +2 + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-setPublicClassFields-static-super-exec.test.js:7:15 + 5| class B extends A {} + 6| const { prop, propA, getPropA } = B; + 7| expect(prop).toBe(2); + | ^ + 8| expect(propA).toBe(1); + 9| expect(getPropA()).toBe(1); + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[98/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-setPublicClassFields-static-this-exec.test.js > exec +AssertionError: expected undefined to be [Function A] // Object.is equality + +- Expected: +[Function A] + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-setPublicClassFields-static-this-exec.test.js:6:15 + 4| class A {} + 5| const { self, getA } = A; + 6| expect(self).toBe(A); + | ^ + 7| expect(getA()).toBe(A); + 8| const oldA = A; + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[99/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-setPublicClassFields-static-undefined-exec.test.js > exec +AssertionError: expected false to be true // Object.is equality + +- Expected ++ Received + +- true ++ false + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-assumption-setPublicClassFields-static-undefined-exec.test.js:5:23 + 3| test("exec", () => { + 4| class Foo {} + 5| expect("num" in Foo).toBe(true); + | ^ + 6| expect(Foo.num).toBeUndefined(); + 7| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[100/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-computed-initialization-order-exec.test.js > exec +AssertionError: expected [ 1, 2, 5, 6, 7, 9, 3, 4, 8, 13, …(2) ] to deeply equal [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, …(5) ] + +- Expected ++ Received + + Array [ + 1, + 2, +- 3, +- 4, + 5, + 6, + 7, +- 8, + 9, +- 10, +- 11, +- 12, ++ 3, ++ 4, ++ 8, + 13, + 14, + 15, + ] + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-computed-initialization-order-exec.test.js:48:22 + 46| 15 + 47| ]; + 48| expect(actualOrder).toEqual(expectedOrder); + | ^ + 49| expect(MyClass[1]).toBe(10); + 50| expect(inst[2]).toBe(13); + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[101/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-computed-toPrimitive-exec.test.js > exec +AssertionError: expected undefined to be +0 // Object.is equality + +- Expected: +0 + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-computed-toPrimitive-exec.test.js:6:37 + 4| let _foo, _foo2; + 5| const foo = { [Symbol.toPrimitive]: () => "foo" }; + 6| expect((_foo = foo, class {}).foo).toBe(0); + | ^ + 7| expect(class { + 8| static [foo]() { + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[102/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-delete-super-property-exec.test.js > exec +AssertionError: expected function to throw an error, but it didn't + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-delete-super-property-exec.test.js:20:5 + 18| expect(() => { + 19| class X1 {} + 20| }).toThrow(ReferenceError); + | ^ + 21| expect(() => { + 22| class X2 {} + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[103/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-delete-this-exec.test.js > exec +AssertionError: expected undefined to be true // Object.is equality + +- Expected: +true + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-delete-this-exec.test.js:10:16 + 8| } + 9| expect(new Foo().x).toBe(true); + 10| expect(Foo.x).toBe(true); + | ^ + 11| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[104/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-loose-computed-initialization-order-exec.test.js > exec +AssertionError: expected [ 1, 2, 5, 6, 7, 9, 3, 4, 8, 13, …(2) ] to deeply equal [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, …(5) ] + +- Expected ++ Received + + Array [ + 1, + 2, +- 3, +- 4, + 5, + 6, + 7, +- 8, + 9, +- 10, +- 11, +- 12, ++ 3, ++ 4, ++ 8, + 13, + 14, + 15, + ] + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-loose-computed-initialization-order-exec.test.js:48:22 + 46| 15 + 47| ]; + 48| expect(actualOrder).toEqual(expectedOrder); + | ^ + 49| expect(MyClass[1]).toBe(10); + 50| expect(inst[2]).toBe(13); + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[105/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-loose-static-class-binding-exec.test.js > exec +AssertionError: expected undefined to be [Function A] // Object.is equality + +- Expected: +[Function A] + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-loose-static-class-binding-exec.test.js:7:20 + 5| const oldA = A; + 6| A = null; + 7| expect(oldA.self).toBe(oldA); + | ^ + 8| expect(oldA.getA()).toBe(oldA); + 9| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[106/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-loose-static-exec.test.js > exec +AssertionError: expected undefined to be +0 // Object.is equality + +- Expected: +0 + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-loose-static-exec.test.js:5:18 + 3| test("exec", () => { + 4| class Foo {} + 5| expect(Foo.num).toBe(0); + | ^ + 6| expect(Foo.num = 1).toBe(1); + 7| expect(Foo.str).toBe("foo"); + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[107/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-loose-static-infer-name-exec.test.js > exec +AssertionError: expected undefined to be +0 // Object.is equality + +- Expected: +0 + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-loose-static-infer-name-exec.test.js:5:18 + 3| test("exec", () => { + 4| var Foo = class {}; + 5| expect(Foo.num).toBe(0); + | ^ + 6| expect(Foo.num = 1).toBe(1); + 7| expect(Foo.name).toBe("Foo"); + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[108/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-loose-static-super-exec.test.js > exec +AssertionError: expected undefined to be 2 // Object.is equality + +- Expected: +2 + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-loose-static-super-exec.test.js:7:15 + 5| class B extends A {} + 6| const { prop, propA, getPropA } = B; + 7| expect(prop).toBe(2); + | ^ + 8| expect(propA).toBe(1); + 9| expect(getPropA()).toBe(1); + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[109/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-loose-static-this-exec.test.js > exec +AssertionError: expected undefined to be [Function A] // Object.is equality + +- Expected: +[Function A] + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-loose-static-this-exec.test.js:6:15 + 4| class A {} + 5| const { self, getA } = A; + 6| expect(self).toBe(A); + | ^ + 7| expect(getA()).toBe(A); + 8| const oldA = A; + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[110/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-loose-static-undefined-exec.test.js > exec +AssertionError: expected false to be true // Object.is equality + +- Expected ++ Received + +- true ++ false + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-loose-static-undefined-exec.test.js:5:23 + 3| test("exec", () => { + 4| class Foo {} + 5| expect("num" in Foo).toBe(true); + | ^ + 6| expect(Foo.num).toBeUndefined(); + 7| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[111/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-native-classes-exec.test.js > exec +AssertionError: expected false to be true // Object.is equality + +- Expected ++ Received + +- true ++ false + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-native-classes-exec.test.js:16:23 + 14| } + 15| const f = new Foo(); + 16| expect("foo" in Foo).toBe(true); + | ^ + 17| expect("bar" in f).toBe(true); + 18| expect(Foo.test()).toBe("foo"); + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[112/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-static-class-binding-exec.test.js > exec +AssertionError: expected undefined to be [Function A] // Object.is equality + +- Expected: +[Function A] + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-static-class-binding-exec.test.js:7:20 + 5| const oldA = A; + 6| A = null; + 7| expect(oldA.self).toBe(oldA); + | ^ + 8| expect(oldA.getA()).toBe(oldA); + 9| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[113/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-static-exec.test.js > exec +AssertionError: expected undefined to be +0 // Object.is equality + +- Expected: +0 + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-static-exec.test.js:5:18 + 3| test("exec", () => { + 4| class Foo {} + 5| expect(Foo.num).toBe(0); + | ^ + 6| expect(Foo.num = 1).toBe(1); + 7| expect(Foo.str).toBe("foo"); + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[114/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-static-infer-name-exec.test.js > exec +AssertionError: expected undefined to be +0 // Object.is equality + +- Expected: +0 + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-static-infer-name-exec.test.js:5:18 + 3| test("exec", () => { + 4| var Foo = class {}; + 5| expect(Foo.num).toBe(0); + | ^ + 6| expect(Foo.num = 1).toBe(1); + 7| expect(Foo.name).toBe("Foo"); + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[115/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-static-super-exec.test.js > exec +AssertionError: expected undefined to be 2 // Object.is equality + +- Expected: +2 + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-static-super-exec.test.js:7:15 + 5| class B extends A {} + 6| const { prop, propA, getPropA } = B; + 7| expect(prop).toBe(2); + | ^ + 8| expect(propA).toBe(1); + 9| expect(getPropA()).toBe(1); + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[116/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-static-this-exec.test.js > exec +AssertionError: expected undefined to be [Function A] // Object.is equality + +- Expected: +[Function A] + ++ Received: +undefined + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-static-this-exec.test.js:6:15 + 4| class A {} + 5| const { self, getA } = A; + 6| expect(self).toBe(A); + | ^ + 7| expect(getA()).toBe(A); + 8| const oldA = A; + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[117/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-public-static-undefined-exec.test.js > exec +AssertionError: expected false to be true // Object.is equality + +- Expected ++ Received + +- true ++ false + + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-public-static-undefined-exec.test.js:5:23 + 3| test("exec", () => { + 4| class Foo {} + 5| expect("num" in Foo).toBe(true); + | ^ + 6| expect(Foo.num).toBeUndefined(); + 7| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[118/132]⎯ + + FAIL fixtures/babel-plugin-transform-class-properties-test-fixtures-regression-7371-exec.test.js > exec +ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor + ❯ new A fixtures/babel-plugin-transform-class-properties-test-fixtures-regression-7371-exec.test.js:8:4 + 6| class A extends C { + 7| constructor() { + 8| _defineProperty(this, "field", 1); + | ^ + 9| super(); + 10| class B extends C { + ❯ fixtures/babel-plugin-transform-class-properties-test-fixtures-regression-7371-exec.test.js:20:2 + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[119/132]⎯ FAIL fixtures/babel-plugin-transform-object-rest-spread-test-fixtures-assumption-objectRestNoSymbols-rest-ignore-symbols-exec.test.js > exec AssertionError: expected true to be false // Object.is equality @@ -31,7 +939,7 @@ AssertionError: expected true to be false // Object.is equality | ^ 13| }) -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/14]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[120/132]⎯ FAIL fixtures/babel-plugin-transform-object-rest-spread-test-fixtures-assumption-pureGetters-rest-remove-unused-excluded-keys-exec.test.js > exec AssertionError: expected true to be false // Object.is equality @@ -49,7 +957,7 @@ AssertionError: expected true to be false // Object.is equality | ^ 11| }) -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/14]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[121/132]⎯ FAIL fixtures/babel-plugin-transform-object-rest-spread-test-fixtures-assumption-pureGetters-spread-single-call-exec.test.js > exec AssertionError: expected { foo: +0, middle: 1, bar: 1 } to deeply equal { foo: +0, middle: +0, bar: 1 } @@ -72,7 +980,7 @@ AssertionError: expected { foo: +0, middle: 1, bar: 1 } to deeply equal { foo: + 13| foo: 0, 14| middle: 0, -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/14]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[122/132]⎯ FAIL fixtures/babel-plugin-transform-object-rest-spread-test-fixtures-assumption-setSpreadProperties-no-object-assign-exec-exec.test.js > exec AssertionError: expected [Function] to throw an error @@ -84,7 +992,7 @@ AssertionError: expected [Function] to throw an error 14| const obj2 = { "NOWRITE": 456 }; 15| expect(() => { -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/14]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[123/132]⎯ FAIL fixtures/babel-plugin-transform-object-rest-spread-test-fixtures-assumption-setSpreadProperties-with-useBuiltIns-no-object-assign-exec-exec.test.js > exec AssertionError: expected [Function] to throw an error @@ -96,7 +1004,7 @@ AssertionError: expected [Function] to throw an error 14| const obj2 = { "NOWRITE": 456 }; 15| expect(() => { -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/14]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[124/132]⎯ FAIL fixtures/babel-plugin-transform-object-rest-spread-test-fixtures-object-spread-expression-exec.test.js > exec AssertionError: expected [ 1, 2 ] to deeply equal [ 1 ] @@ -116,7 +1024,7 @@ AssertionError: expected [ 1, 2 ] to deeply equal [ 1 ] | ^ 11| }) -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[7/14]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[125/132]⎯ FAIL fixtures/babel-plugin-transform-object-rest-spread-test-fixtures-object-spread-loose-builtins-side-effect-exec.test.js > exec AssertionError: expected { a: 1, b: 1 } to deeply equal { a: 2, b: 1 } @@ -138,7 +1046,7 @@ AssertionError: expected { a: 1, b: 1 } to deeply equal { a: 2, b: 1 } 10| a: 2, 11| b: 1 -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[8/14]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[126/132]⎯ FAIL fixtures/babel-plugin-transform-object-rest-spread-test-fixtures-object-spread-loose-side-effect-exec.test.js > exec AssertionError: expected { a: 1, b: 1 } to deeply equal { a: 2, b: 1 } @@ -160,7 +1068,7 @@ AssertionError: expected { a: 1, b: 1 } to deeply equal { a: 2, b: 1 } 10| a: 2, 11| b: 1 -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[9/14]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[127/132]⎯ FAIL fixtures/babel-plugin-transform-react-jsx-source-test-fixtures-react-source-basic-sample-exec.test.js > exec ReferenceError: transformAsync is not defined @@ -172,7 +1080,7 @@ ReferenceError: transformAsync is not defined 5| var expected = ` 6| var _jsxFileName = "/fake/path/mock.js"; -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[10/14]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[128/132]⎯ FAIL fixtures/babel-plugin-transform-react-jsx-source-test-fixtures-react-source-with-source-exec.test.js > exec ReferenceError: transformAsync is not defined @@ -184,7 +1092,7 @@ ReferenceError: transformAsync is not defined 5| var expected = "var x = ;"; 6| return actualP.then((actual) => { -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[11/14]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[129/132]⎯ FAIL fixtures/babel-preset-env-test-fixtures-plugins-integration-issue-15170-exec.test.js > exec AssertionError: expected [Function] to not throw an error but 'ReferenceError: x is not defined' was thrown @@ -202,7 +1110,7 @@ undefined | ^ 7| }) -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[12/14]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[130/132]⎯ FAIL fixtures/babel-preset-env-test-fixtures-sanity-check-es2015-constants-exec.test.js > exec TypeError: Assignment to constant variable. @@ -213,7 +1121,7 @@ TypeError: Assignment to constant variable. | ^ 6| }) -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[13/14]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[131/132]⎯ FAIL fixtures/babel-preset-env-test-fixtures-sanity-regex-dot-all-exec.test.js > exec AssertionError: expected false to be true // Object.is equality @@ -232,7 +1140,7 @@ AssertionError: expected false to be true // Object.is equality 11| expect(/hello.world/su.test(input)).toBe(true); 12| }) -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[14/14]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[132/132]⎯ ⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯ diff --git a/tasks/transform_conformance/src/constants.rs b/tasks/transform_conformance/src/constants.rs index 3248239ad02b13..fbd4748edb854f 100644 --- a/tasks/transform_conformance/src/constants.rs +++ b/tasks/transform_conformance/src/constants.rs @@ -3,7 +3,7 @@ pub(crate) const PLUGINS: &[&str] = &[ // // ES2024 // "babel-plugin-transform-unicode-sets-regex", // // ES2022 - // "babel-plugin-transform-class-properties", + "babel-plugin-transform-class-properties", "babel-plugin-transform-class-static-block", // "babel-plugin-transform-private-methods", // "babel-plugin-transform-private-property-in-object", @@ -63,7 +63,6 @@ pub(crate) const PLUGINS: &[&str] = &[ pub(crate) const PLUGINS_NOT_SUPPORTED_YET: &[&str] = &[ "proposal-decorators", - "transform-class-properties", "transform-classes", "transform-destructuring", "transform-modules-commonjs",