inherit super class static properties - fixes #31

This commit is contained in:
Sebastian McKenzie
2014-10-10 15:07:55 +11:00
parent 76f1abe5b0
commit 35bb0bc71d
8 changed files with 15 additions and 2 deletions

View File

@@ -0,0 +1 @@
CLASS_NAME.__proto__ = SUPER_NAME;

View File

@@ -46,7 +46,14 @@ var buildClass = function (node, generateUid) {
var returnStatement = body.pop();
if (superName) {
body.push(util.template("inherits", {
// inherit prototype
body.push(util.template("class-inherits-prototype", {
SUPER_NAME: superName,
CLASS_NAME: className
}, true));
// inherit static properties
body.push(util.template("class-inherits-properties", {
SUPER_NAME: superName,
CLASS_NAME: className
}, true));