-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
superIsCallableConstructor
- Loading branch information
1 parent
d235f93
commit 8876a37
Showing
10 changed files
with
94 additions
and
3 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
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
12 changes: 12 additions & 0 deletions
12
...plugin-transform-classes/test/fixtures/assumption-superIsCallableConstructor/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,12 @@ | ||
{ | ||
"plugins": [ | ||
["external-helpers", { "helperVersion": "7.100.0" }], | ||
"transform-function-name", | ||
"transform-classes", | ||
["transform-spread", { "loose": true }], | ||
"transform-block-scoping" | ||
], | ||
"assumptions": { | ||
"superIsCallableConstructor": true | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
.../fixtures/assumption-superIsCallableConstructor/super-class-id-member-expression/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,7 @@ | ||
class BaseController extends Chaplin.Controller { | ||
|
||
} | ||
|
||
class BaseController2 extends Chaplin.Controller.Another { | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...fixtures/assumption-superIsCallableConstructor/super-class-id-member-expression/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,25 @@ | ||
var BaseController = /*#__PURE__*/function (_Chaplin$Controller) { | ||
"use strict"; | ||
|
||
babelHelpers.inherits(BaseController, _Chaplin$Controller); | ||
|
||
function BaseController() { | ||
babelHelpers.classCallCheck(this, BaseController); | ||
return _Chaplin$Controller.apply(this, arguments) || this; | ||
} | ||
|
||
return BaseController; | ||
}(Chaplin.Controller); | ||
|
||
var BaseController2 = /*#__PURE__*/function (_Chaplin$Controller$A) { | ||
"use strict"; | ||
|
||
babelHelpers.inherits(BaseController2, _Chaplin$Controller$A); | ||
|
||
function BaseController2() { | ||
babelHelpers.classCallCheck(this, BaseController2); | ||
return _Chaplin$Controller$A.apply(this, arguments) || this; | ||
} | ||
|
||
return BaseController2; | ||
}(Chaplin.Controller.Another); |
9 changes: 9 additions & 0 deletions
9
...asses/test/fixtures/assumption-superIsCallableConstructor/super-class-this-usage/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,9 @@ | ||
class Test extends Foo { | ||
constructor() { | ||
super(); | ||
|
||
this; | ||
|
||
this.prop = 1; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...sses/test/fixtures/assumption-superIsCallableConstructor/super-class-this-usage/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,17 @@ | ||
var Test = /*#__PURE__*/function (_Foo) { | ||
"use strict"; | ||
|
||
babelHelpers.inherits(Test, _Foo); | ||
|
||
function Test() { | ||
var _this; | ||
|
||
babelHelpers.classCallCheck(this, Test); | ||
_this = _Foo.call(this) || this; | ||
babelHelpers.assertThisInitialized(_this); | ||
_this.prop = 1; | ||
return _this; | ||
} | ||
|
||
return Test; | ||
}(Foo); |
1 change: 1 addition & 0 deletions
1
...ransform-classes/test/fixtures/assumption-superIsCallableConstructor/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 @@ | ||
class Test extends Foo { } |
12 changes: 12 additions & 0 deletions
12
...ansform-classes/test/fixtures/assumption-superIsCallableConstructor/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,12 @@ | ||
var Test = /*#__PURE__*/function (_Foo) { | ||
"use strict"; | ||
|
||
babelHelpers.inherits(Test, _Foo); | ||
|
||
function Test() { | ||
babelHelpers.classCallCheck(this, Test); | ||
return _Foo.apply(this, arguments) || this; | ||
} | ||
|
||
return Test; | ||
}(Foo); |