add classProps declaration to simplify/nicen up class property defining - closes #88

This commit is contained in:
Sebastian McKenzie
2014-11-03 13:36:23 +11:00
parent c8139317ee
commit c17878913b
13 changed files with 95 additions and 40 deletions

View File

@@ -1,9 +1,14 @@
"use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var Test = function() {
var Test = function Test() {};
Object.defineProperties(Test.prototype, {
_classProps(Test, null, {
test: {
writable: true,
@@ -14,4 +19,4 @@ var Test = function() {
});
return Test;
}();
}();