Skip to content

Commit

Permalink
fix code examples
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Dec 18, 2024
1 parent 86ed34f commit fab198b
Showing 1 changed file with 61 additions and 58 deletions.
119 changes: 61 additions & 58 deletions crates/oxc_transformer/src/es2022/class_properties/supers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand Down

0 comments on commit fab198b

Please sign in to comment.