diff --git a/test/fixtures/transformation/es6-classes/accessing-super-class/expected.js b/test/fixtures/transformation/es6-classes/accessing-super-class/expected.js index 14f12f07e2..1600d655fb 100644 --- a/test/fixtures/transformation/es6-classes/accessing-super-class/expected.js +++ b/test/fixtures/transformation/es6-classes/accessing-super-class/expected.js @@ -2,6 +2,9 @@ var _slice = Array.prototype.slice; var _inherits = 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, diff --git a/test/fixtures/transformation/es6-classes/accessing-super-properties/expected.js b/test/fixtures/transformation/es6-classes/accessing-super-properties/expected.js index 95ba3c53f4..29526be129 100644 --- a/test/fixtures/transformation/es6-classes/accessing-super-properties/expected.js +++ b/test/fixtures/transformation/es6-classes/accessing-super-properties/expected.js @@ -1,6 +1,9 @@ "use strict"; var _inherits = 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, diff --git a/test/fixtures/transformation/es6-classes/calling-super-properties/expected.js b/test/fixtures/transformation/es6-classes/calling-super-properties/expected.js index 1b2b38ce31..7e8f2bfd43 100644 --- a/test/fixtures/transformation/es6-classes/calling-super-properties/expected.js +++ b/test/fixtures/transformation/es6-classes/calling-super-properties/expected.js @@ -1,6 +1,9 @@ "use strict"; var _inherits = 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, diff --git a/test/fixtures/transformation/es6-classes/constructor/expected.js b/test/fixtures/transformation/es6-classes/constructor/expected.js index d43c12f6e7..cc5264d5b6 100644 --- a/test/fixtures/transformation/es6-classes/constructor/expected.js +++ b/test/fixtures/transformation/es6-classes/constructor/expected.js @@ -1,6 +1,9 @@ "use strict"; var _inherits = 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, diff --git a/test/fixtures/transformation/es6-classes/super-class-id-member-expression/expected.js b/test/fixtures/transformation/es6-classes/super-class-id-member-expression/expected.js index a3dc10057d..d9a40e4753 100644 --- a/test/fixtures/transformation/es6-classes/super-class-id-member-expression/expected.js +++ b/test/fixtures/transformation/es6-classes/super-class-id-member-expression/expected.js @@ -1,6 +1,9 @@ "use strict"; var _inherits = 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, diff --git a/test/fixtures/transformation/es6-classes/super-class/expected.js b/test/fixtures/transformation/es6-classes/super-class/expected.js index 50b689e121..01534a385f 100644 --- a/test/fixtures/transformation/es6-classes/super-class/expected.js +++ b/test/fixtures/transformation/es6-classes/super-class/expected.js @@ -1,6 +1,9 @@ "use strict"; var _inherits = 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, diff --git a/test/fixtures/transformation/optional-proto-to-assign/class/expected.js b/test/fixtures/transformation/optional-proto-to-assign/class/expected.js index 2af2a9b699..2d7d562265 100644 --- a/test/fixtures/transformation/optional-proto-to-assign/class/expected.js +++ b/test/fixtures/transformation/optional-proto-to-assign/class/expected.js @@ -11,6 +11,9 @@ var _defaults = function (obj, defaults) { }; var _inherits = 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,