add type check to inherits template

This commit is contained in:
Sebastian McKenzie
2015-01-05 10:23:06 +11:00
parent 77add8704e
commit 16024242b0

View File

@@ -1,4 +1,7 @@
(function (child, parent) {
if (typeof parent !== "function" && parent !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof parent);
}
child.prototype = Object.create(parent && parent.prototype, {
constructor: {
value: child,