Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't duplicate the base class when using
constantSuper
- Loading branch information
1 parent
7c9f618
commit cdb3474
Showing
10 changed files
with
77 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...osal-class-properties/test/fixtures/assumption-constantSuper/complex-super-class/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class A extends class B {} { | ||
static x = super.x; | ||
} |
5 changes: 5 additions & 0 deletions
5
...sal-class-properties/test/fixtures/assumption-constantSuper/complex-super-class/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var _B; | ||
|
||
class A extends (_B = class B {}) {} | ||
|
||
babelHelpers.defineProperty(A, "x", _B.x); |
3 changes: 3 additions & 0 deletions
3
...-proposal-class-properties/test/fixtures/assumption-constantSuper/instance-field/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class A extends B { | ||
foo = super.bar; | ||
} |
7 changes: 7 additions & 0 deletions
7
...proposal-class-properties/test/fixtures/assumption-constantSuper/instance-field/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class A extends B { | ||
constructor(...args) { | ||
super(...args); | ||
babelHelpers.defineProperty(this, "foo", super.bar); | ||
} | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
...abel-plugin-proposal-class-properties/test/fixtures/assumption-constantSuper/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"assumptions": { | ||
"constantSuper": true | ||
}, | ||
"plugins": ["proposal-class-properties"] | ||
} |
3 changes: 3 additions & 0 deletions
3
...in-proposal-class-properties/test/fixtures/assumption-constantSuper/static-field/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class A extends B { | ||
static foo = super.bar; | ||
} |
3 changes: 3 additions & 0 deletions
3
...n-proposal-class-properties/test/fixtures/assumption-constantSuper/static-field/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class A extends B {} | ||
|
||
babelHelpers.defineProperty(A, "foo", B.bar); |
15 changes: 4 additions & 11 deletions
15
...-proposal-class-static-block/test/fixtures/integration-loose/super-static-block/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,19 @@ | ||
var _class, _2, _temp; | ||
var _ref, _class, _2, _temp; | ||
|
||
var _ = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("_"); | ||
|
||
class Foo extends (_temp = (_2 = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("_"), _class = class {}), Object.defineProperty(_class, _2, { | ||
class Foo extends (_ref = (_temp = (_2 = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("_"), _class = class _ref {}), Object.defineProperty(_class, _2, { | ||
writable: true, | ||
value: (() => { | ||
_class.bar = 42; | ||
})() | ||
}), _temp) {} | ||
}), _temp)) {} | ||
|
||
Foo.bar = 21; | ||
Object.defineProperty(Foo, _, { | ||
writable: true, | ||
value: (() => { | ||
var _class2, _3, _temp2; | ||
|
||
Foo.foo = (_temp2 = (_3 = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("_"), _class2 = class {}), Object.defineProperty(_class2, _3, { | ||
writable: true, | ||
value: (() => { | ||
_class2.bar = 42; | ||
})() | ||
}), _temp2).bar; | ||
Foo.foo = _ref.bar; | ||
})() | ||
}); | ||
expect(Foo.foo).toBe(42); |