fix super constructor call - fixes #34
This commit is contained in:
6
test/fixtures/classes/constructor/actual.js
vendored
6
test/fixtures/classes/constructor/actual.js
vendored
@@ -3,3 +3,9 @@ class Test {
|
||||
this.state = "test";
|
||||
}
|
||||
}
|
||||
|
||||
class Foo extends Bar {
|
||||
constructor() {
|
||||
this.state = "test";
|
||||
}
|
||||
}
|
||||
|
||||
18
test/fixtures/classes/constructor/expected.js
vendored
18
test/fixtures/classes/constructor/expected.js
vendored
@@ -4,3 +4,21 @@ var Test = function () {
|
||||
}
|
||||
return Test;
|
||||
}();
|
||||
|
||||
var Foo = function(Bar) {
|
||||
function Foo() {
|
||||
this.state = "test";
|
||||
}
|
||||
|
||||
Foo.prototype = Object.create(Bar.prototype, {
|
||||
constructor: {
|
||||
value: Foo,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
|
||||
Foo.__proto__ = Bar;
|
||||
return Foo;
|
||||
}(Bar);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var BaseController = function (Chaplin) {
|
||||
function BaseController() {
|
||||
Chaplin.Controller.call(this, arguments);
|
||||
Chaplin.Controller.apply(this, arguments);
|
||||
}
|
||||
BaseController.prototype = Object.create(Chaplin.Controller.prototype, {
|
||||
constructor: {
|
||||
@@ -16,7 +16,7 @@ var BaseController = function (Chaplin) {
|
||||
|
||||
var BaseController2 = function (Chaplin) {
|
||||
function BaseController2() {
|
||||
Chaplin.Controller.Another.call(this, arguments);
|
||||
Chaplin.Controller.Another.apply(this, arguments);
|
||||
}
|
||||
BaseController2.prototype = Object.create(Chaplin.Controller.Another.prototype, {
|
||||
constructor: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var Q = function(_ref) {
|
||||
function Q() {
|
||||
_ref.call(this, arguments);
|
||||
_ref.apply(this, arguments);
|
||||
}
|
||||
|
||||
Q.prototype = Object.create(_ref.prototype, {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var Test = function (Foo) {
|
||||
function Test() {
|
||||
Foo.call(this, arguments);
|
||||
Foo.apply(this, arguments);
|
||||
}
|
||||
Test.prototype = Object.create(Foo.prototype, {
|
||||
constructor: {
|
||||
|
||||
Reference in New Issue
Block a user