fix super constructor call - fixes #34

This commit is contained in:
Sebastian McKenzie
2014-10-10 20:37:15 +11:00
parent c4a3a08d31
commit 58da989164
7 changed files with 30 additions and 6 deletions

View File

@@ -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);