From fab198b9a6c634ba080c2b4e5b7da8fba4a09faf Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Wed, 18 Dec 2024 18:10:31 +0000 Subject: [PATCH] fix code examples --- .../src/es2022/class_properties/supers.rs | 119 +++++++++--------- 1 file changed, 61 insertions(+), 58 deletions(-) diff --git a/crates/oxc_transformer/src/es2022/class_properties/supers.rs b/crates/oxc_transformer/src/es2022/class_properties/supers.rs index 0dc00ffc7b56ce..b1243f496766aa 100644 --- a/crates/oxc_transformer/src/es2022/class_properties/supers.rs +++ b/crates/oxc_transformer/src/es2022/class_properties/supers.rs @@ -308,33 +308,33 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> { /// * `++super.prop` -> /// ```js /// _superPropSet( - /// _Outer, - /// "prop", - /// ( - /// _super$prop = _superPropGet(_Outer, "prop", _Outer), - /// _super$prop2 = _super$prop++, - /// _super$prop - /// ), - /// _Outer, - /// 1 - /// ), - /// _super$prop2; + /// _Outer, + /// "prop", + /// ( + /// _super$prop = _superPropGet(_Outer, "prop", _Outer), + /// ++_super$prop + /// ), + /// _Outer, + /// 1 + /// ) /// ``` /// /// * `super.prop--` -> /// ```js - /// _superPropSet( - /// _Outer, - /// "prop", - /// ( - /// _super$prop3 = _superPropGet(_Outer, "prop", _Outer), - /// _super$prop4 = _super$prop3--, - /// _super$prop3 - /// ), - /// _Outer, - /// 1 - /// ), - /// _super$prop4; + /// ( + /// _superPropSet( + /// _Outer, + /// "prop", + /// ( + /// _super$prop = _superPropGet(_Outer, "prop", _Outer), + /// _super$prop2 = _super$prop--, + /// _super$prop + /// ), + /// _Outer, + /// 1 + /// ), + /// _super$prop2 + /// ) /// ``` /// // `#[inline]` so that compiler sees that `expr` is an `Expression::UpdateExpression`. @@ -377,24 +377,27 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> { /// ), /// _Outer, /// 1 - /// ); + /// ) /// ``` /// /// * `super[prop]--` -> /// ```js - /// _superPropSet( - /// _Outer, - /// prop, - /// ( - /// _super$prop = _superPropGet(_Outer, prop, _Outer), - /// _super$prop2 = _super$prop--, - /// _super$prop + /// ( + /// _superPropSet( + /// _Outer, + /// prop, + /// ( + /// _super$prop = _superPropGet(_Outer, prop, _Outer), + /// _super$prop2 = _super$prop--, + /// _super$prop + /// ), + /// _Outer, + /// 1 /// ), - /// _Outer, - /// 1 - /// ), - /// _super$prop2; - /// + /// _super$prop2 + /// ) + /// ``` + // // `#[inline]` so that compiler sees that `expr` is an `Expression::UpdateExpression`. #[inline] fn transform_update_expression_for_super_computed_member_expr( @@ -418,36 +421,36 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> { /// Transform update expression (`++` or `--`) where argument is a member expression with `super`. /// - /// * `++super.prop` -> - /// ```js - /// _superPropSet( - /// _Outer, - /// "prop", - /// ( - /// _super$prop = _superPropGet(_Outer, "prop", _Outer), - /// _super$prop2 = _super$prop++, - /// _super$prop - /// ), - /// _Outer, - /// 1 - /// ), - /// _super$prop2; - /// ``` - /// - /// * `super[prop]--` -> + /// * `++super[prop]` -> /// ```js /// _superPropSet( /// _Outer, /// prop, /// ( - /// _super$prop = _superPropGet(_Outer, prop, _Outer), - /// _super$prop2 = _super$prop--, - /// _super$prop + /// _super$prop = _superPropGet(_Outer, prop, _Outer), + /// ++_super$prop /// ), /// _Outer, /// 1 - /// ), - /// _super$prop2; + /// ) + /// ``` + /// + /// * `super[prop]--` -> + /// ```js + /// ( + /// _superPropSet( + /// _Outer, + /// prop, + /// ( + /// _super$prop = _superPropGet(_Outer, prop, _Outer), + /// _super$prop2 = _super$prop--, + /// _super$prop + /// ), + /// _Outer, + /// 1 + /// ), + /// _super$prop2 + /// ) /// ``` fn transform_super_update_expression_impl( &mut self,