support falsy and null super classes - fixes #284

This commit is contained in:
Sebastian McKenzie
2014-12-14 12:19:24 +11:00
parent 11fc7cd0ce
commit d26f441a5c

View File

@@ -1,5 +1,5 @@
(function (child, parent) {
child.prototype = Object.create(parent.prototype, {
child.prototype = Object.create(parent && parent.prototype, {
constructor: {
value: child,
enumerable: false,
@@ -7,5 +7,5 @@
configurable: true
}
});
child.__proto__ = parent;
if (parent) child.__proto__ = parent;
})