add if super check to constructor default

This commit is contained in:
Sebastian McKenzie
2014-12-18 01:09:24 +11:00
parent 2fc8010034
commit a3eb8900a9
3 changed files with 12 additions and 4 deletions

View File

@@ -13,13 +13,17 @@ var _extends = function (child, parent) {
};
var BaseController = function BaseController() {
Chaplin.Controller.apply(this, arguments);
if (Chaplin.Controller) {
Chaplin.Controller.apply(this, arguments);
}
};
_extends(BaseController, Chaplin.Controller);
var BaseController2 = function BaseController2() {
Chaplin.Controller.Another.apply(this, arguments);
if (Chaplin.Controller.Another) {
Chaplin.Controller.Another.apply(this, arguments);
}
};
_extends(BaseController2, Chaplin.Controller.Another);

View File

@@ -15,7 +15,9 @@ var _extends = function (child, parent) {
var _QSuper = function () {};
var Q = function Q() {
_QSuper.apply(this, arguments);
if (_QSuper) {
_QSuper.apply(this, arguments);
}
};
_extends(Q, _QSuper);

View File

@@ -13,7 +13,9 @@ var _extends = function (child, parent) {
};
var Test = function Test() {
Foo.apply(this, arguments);
if (Foo) {
Foo.apply(this, arguments);
}
};
_extends(Test, Foo);