diff --git a/crates/oxc_transformer/src/es2022/class_properties/prop_decl.rs b/crates/oxc_transformer/src/es2022/class_properties/prop_decl.rs index 5c3d5245cac35..503b8cb7f8aec 100644 --- a/crates/oxc_transformer/src/es2022/class_properties/prop_decl.rs +++ b/crates/oxc_transformer/src/es2022/class_properties/prop_decl.rs @@ -88,8 +88,9 @@ impl<'a> ClassProperties<'a, '_> { prop: &mut PropertyDefinition<'a>, ctx: &mut TraverseCtx<'a>, ) { - // Get value, and transform it to replace `this` with reference to class name, - // and transform class fields (`object.#prop`) + // Get value. + // Transform it to replace `this` and references to class name with temp var for class. + // Also transform `super`. let value = match prop.value.take() { Some(mut value) => { self.transform_static_initializer(&mut value, ctx); diff --git a/crates/oxc_transformer/src/es2022/class_properties/static_block_and_prop_init.rs b/crates/oxc_transformer/src/es2022/class_properties/static_block_and_prop_init.rs index 7ee78b79ee3f2..301306f8e8e4e 100644 --- a/crates/oxc_transformer/src/es2022/class_properties/static_block_and_prop_init.rs +++ b/crates/oxc_transformer/src/es2022/class_properties/static_block_and_prop_init.rs @@ -155,6 +155,9 @@ impl<'a> ClassProperties<'a, '_> { /// * Class expression: /// * `x = class C { static x = C.y; }` -> `var _C; x = (_C = class C {}, _C.x = _C.y, _C)` /// * `x = class C { static { C.x(); } }` -> `var _C; x = (_C = class C {}, _C.x(), _C)` +/// 3. `super` to transpiled super. +/// * e.g. `super.prop` -> `_superPropGet(_Class, "prop", this)` (in static private method) +/// or `_superPropGet(_Class, "prop", _Class)` (in static property initializer or static block) /// /// Also: /// * Update parent `ScopeId` of first level of scopes, if `reparent_scopes == true`.