define class methods instead of assigning them - fixes #454

This commit is contained in:
Sebastian McKenzie
2015-01-12 11:44:23 +11:00
parent d093dc8231
commit 545c8c3adb
8 changed files with 136 additions and 59 deletions

View File

@@ -1,5 +1,10 @@
"use strict";
var _prototypeProperties = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var BaseView = function BaseView() {
this.autoRender = true;
};
@@ -11,9 +16,16 @@ var BaseView = function () {
var BaseView = (function () {
var _class2 = function () {};
_class2.prototype.foo = function () {
this.autoRender = true;
};
_prototypeProperties(_class2, null, {
foo: {
value: function () {
this.autoRender = true;
},
writable: true,
enumerable: true,
configurable: true
}
});
return _class2;
})();