Skip to content

Commit

Permalink
test(transformer/class-properties): more testing for assignment to `s…
Browse files Browse the repository at this point in the history
…uper[prop]`
  • Loading branch information
overlookmotel committed Dec 18, 2024
1 parent cc57db3 commit e9af5ee
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const ident = "A";
let bound = "A";

class Outer {
static B = () => {
Expand All @@ -9,11 +9,17 @@ class Outer {
super.A &&= 1;
super.A ||= 1;

super[ident] = 1;
super[ident] += 1;
super[ident] -= 1;
super[ident] &&= 1;
super[ident] ||= 1;
super[bound] = 1;
super[bound] += 1;
super[bound] -= 1;
super[bound] &&= 1;
super[bound] ||= 1;

super[unbound] = 1;
super[unbound] += 1;
super[unbound] -= 1;
super[unbound] &&= 1;
super[unbound] ||= 1;

class Inner {
method() {
Expand All @@ -24,11 +30,17 @@ class Outer {
super.A &&= 1;
super.A ||= 1;

super[ident] = 1;
super[ident] += 1;
super[ident] -= 1;
super[ident] &&= 1;
super[ident] ||= 1;
super[bound] = 1;
super[bound] += 1;
super[bound] -= 1;
super[bound] &&= 1;
super[bound] ||= 1;

super[unbound] = 1;
super[unbound] += 1;
super[unbound] -= 1;
super[unbound] &&= 1;
super[unbound] ||= 1;
}

static staticMethod() {
Expand All @@ -39,11 +51,17 @@ class Outer {
super.A &&= 1;
super.A ||= 1;

super[ident] = 1;
super[ident] += 1;
super[ident] -= 1;
super[ident] &&= 1;
super[ident] ||= 1;
super[bound] = 1;
super[bound] += 1;
super[bound] -= 1;
super[bound] &&= 1;
super[bound] ||= 1;

super[unbound] = 1;
super[unbound] += 1;
super[unbound] -= 1;
super[unbound] &&= 1;
super[unbound] ||= 1;
}
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var _Outer;
var _unbound, _unbound2, _unbound3, _unbound4, _Outer;

const ident = "A";
let bound = "A";

class Outer {}

Expand All @@ -13,11 +13,17 @@ babelHelpers.defineProperty(Outer, "B", () => {
babelHelpers.superPropGet(_Outer, "A", _Outer) && babelHelpers.superPropSet(_Outer, "A", 1, _Outer, 1);
babelHelpers.superPropGet(_Outer, "A", _Outer) || babelHelpers.superPropSet(_Outer, "A", 1, _Outer, 1);

babelHelpers.superPropSet(_Outer, ident, 1, _Outer, 1);
babelHelpers.superPropSet(_Outer, ident, babelHelpers.superPropGet(_Outer, ident, _Outer) + 1, _Outer, 1);
babelHelpers.superPropSet(_Outer, ident, babelHelpers.superPropGet(_Outer, ident, _Outer) - 1, _Outer, 1);
babelHelpers.superPropGet(_Outer, ident, _Outer) && babelHelpers.superPropSet(_Outer, ident, 1, _Outer, 1);
babelHelpers.superPropGet(_Outer, ident, _Outer) || babelHelpers.superPropSet(_Outer, ident, 1, _Outer, 1);
babelHelpers.superPropSet(_Outer, bound, 1, _Outer, 1);
babelHelpers.superPropSet(_Outer, bound, babelHelpers.superPropGet(_Outer, bound, _Outer) + 1, _Outer, 1);
babelHelpers.superPropSet(_Outer, bound, babelHelpers.superPropGet(_Outer, bound, _Outer) - 1, _Outer, 1);
babelHelpers.superPropGet(_Outer, bound, _Outer) && babelHelpers.superPropSet(_Outer, bound, 1, _Outer, 1);
babelHelpers.superPropGet(_Outer, bound, _Outer) || babelHelpers.superPropSet(_Outer, bound, 1, _Outer, 1);

babelHelpers.superPropSet(_Outer, unbound, 1, _Outer, 1);
babelHelpers.superPropSet(_Outer, _unbound = unbound, babelHelpers.superPropGet(_Outer, _unbound, _Outer) + 1, _Outer, 1);
babelHelpers.superPropSet(_Outer, _unbound2 = unbound, babelHelpers.superPropGet(_Outer, _unbound2, _Outer) - 1, _Outer, 1);
babelHelpers.superPropGet(_Outer, _unbound3 = unbound, _Outer) && babelHelpers.superPropSet(_Outer, _unbound3, 1, _Outer, 1);
babelHelpers.superPropGet(_Outer, _unbound4 = unbound, _Outer) || babelHelpers.superPropSet(_Outer, _unbound4, 1, _Outer, 1);

class Inner {
method() {
Expand All @@ -28,11 +34,17 @@ babelHelpers.defineProperty(Outer, "B", () => {
super.A &&= 1;
super.A ||= 1;

super[ident] = 1;
super[ident] += 1;
super[ident] -= 1;
super[ident] &&= 1;
super[ident] ||= 1;
super[bound] = 1;
super[bound] += 1;
super[bound] -= 1;
super[bound] &&= 1;
super[bound] ||= 1;

super[unbound] = 1;
super[unbound] += 1;
super[unbound] -= 1;
super[unbound] &&= 1;
super[unbound] ||= 1;
}

static staticMethod() {
Expand All @@ -43,11 +55,17 @@ babelHelpers.defineProperty(Outer, "B", () => {
super.A &&= 1;
super.A ||= 1;

super[ident] = 1;
super[ident] += 1;
super[ident] -= 1;
super[ident] &&= 1;
super[ident] ||= 1;
super[bound] = 1;
super[bound] += 1;
super[bound] -= 1;
super[bound] &&= 1;
super[bound] ||= 1;

super[unbound] = 1;
super[unbound] += 1;
super[unbound] -= 1;
super[unbound] &&= 1;
super[unbound] ||= 1;
}
}
});

0 comments on commit e9af5ee

Please sign in to comment.