From 77f959668205ced6b144e00ec3c51b8ef65ff985 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 14 Dec 2014 14:49:37 +1100 Subject: [PATCH] update classes tests to work with new _extends method --- .../es6-classes/accessing-super-class/expected.js | 4 ++-- .../es6-classes/accessing-super-properties/expected.js | 4 ++-- .../es6-classes/calling-super-properties/expected.js | 4 ++-- .../transformation/es6-classes/constructor/expected.js | 4 ++-- .../es6-classes/super-class-id-member-expression/expected.js | 4 ++-- .../es6-classes/super-class-id-non-identifiers/expected.js | 4 ++-- .../transformation/es6-classes/super-class/expected.js | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) 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 ad8532015c..14523f5053 100644 --- a/test/fixtures/transformation/es6-classes/accessing-super-class/expected.js +++ b/test/fixtures/transformation/es6-classes/accessing-super-class/expected.js @@ -2,7 +2,7 @@ var _slice = Array.prototype.slice; var _extends = function (child, parent) { - child.prototype = Object.create(parent.prototype, { + child.prototype = Object.create(parent && parent.prototype, { constructor: { value: child, enumerable: false, @@ -10,7 +10,7 @@ var _extends = function (child, parent) { configurable: true } }); - child.__proto__ = parent; + if (parent) child.__proto__ = parent; }; var Test = function Test() { 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 5ffb26c5c6..b04502c5e3 100644 --- a/test/fixtures/transformation/es6-classes/accessing-super-properties/expected.js +++ b/test/fixtures/transformation/es6-classes/accessing-super-properties/expected.js @@ -1,7 +1,7 @@ "use strict"; var _extends = function (child, parent) { - child.prototype = Object.create(parent.prototype, { + child.prototype = Object.create(parent && parent.prototype, { constructor: { value: child, enumerable: false, @@ -9,7 +9,7 @@ var _extends = function (child, parent) { configurable: true } }); - child.__proto__ = parent; + if (parent) child.__proto__ = parent; }; var Test = function Test() { 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 8387489528..424555b3f4 100644 --- a/test/fixtures/transformation/es6-classes/calling-super-properties/expected.js +++ b/test/fixtures/transformation/es6-classes/calling-super-properties/expected.js @@ -1,7 +1,7 @@ "use strict"; var _extends = function (child, parent) { - child.prototype = Object.create(parent.prototype, { + child.prototype = Object.create(parent && parent.prototype, { constructor: { value: child, enumerable: false, @@ -9,7 +9,7 @@ var _extends = function (child, parent) { configurable: true } }); - child.__proto__ = parent; + if (parent) child.__proto__ = parent; }; var Test = function Test() { diff --git a/test/fixtures/transformation/es6-classes/constructor/expected.js b/test/fixtures/transformation/es6-classes/constructor/expected.js index 47eb5a927e..5771cc0767 100644 --- a/test/fixtures/transformation/es6-classes/constructor/expected.js +++ b/test/fixtures/transformation/es6-classes/constructor/expected.js @@ -1,7 +1,7 @@ "use strict"; var _extends = function (child, parent) { - child.prototype = Object.create(parent.prototype, { + child.prototype = Object.create(parent && parent.prototype, { constructor: { value: child, enumerable: false, @@ -9,7 +9,7 @@ var _extends = function (child, parent) { configurable: true } }); - child.__proto__ = parent; + if (parent) child.__proto__ = parent; }; var Test = function Test() { 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 5108133980..27635243a2 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,7 +1,7 @@ "use strict"; var _extends = function (child, parent) { - child.prototype = Object.create(parent.prototype, { + child.prototype = Object.create(parent && parent.prototype, { constructor: { value: child, enumerable: false, @@ -9,7 +9,7 @@ var _extends = function (child, parent) { configurable: true } }); - child.__proto__ = parent; + if (parent) child.__proto__ = parent; }; var BaseController = function BaseController() { diff --git a/test/fixtures/transformation/es6-classes/super-class-id-non-identifiers/expected.js b/test/fixtures/transformation/es6-classes/super-class-id-non-identifiers/expected.js index aa3f6fdfc2..83a25652fb 100644 --- a/test/fixtures/transformation/es6-classes/super-class-id-non-identifiers/expected.js +++ b/test/fixtures/transformation/es6-classes/super-class-id-non-identifiers/expected.js @@ -1,7 +1,7 @@ "use strict"; var _extends = function (child, parent) { - child.prototype = Object.create(parent.prototype, { + child.prototype = Object.create(parent && parent.prototype, { constructor: { value: child, enumerable: false, @@ -9,7 +9,7 @@ var _extends = function (child, parent) { configurable: true } }); - child.__proto__ = parent; + if (parent) child.__proto__ = parent; }; var _QSuper = function () {}; diff --git a/test/fixtures/transformation/es6-classes/super-class/expected.js b/test/fixtures/transformation/es6-classes/super-class/expected.js index 82b40d6a4a..a4e3858bd8 100644 --- a/test/fixtures/transformation/es6-classes/super-class/expected.js +++ b/test/fixtures/transformation/es6-classes/super-class/expected.js @@ -1,7 +1,7 @@ "use strict"; var _extends = function (child, parent) { - child.prototype = Object.create(parent.prototype, { + child.prototype = Object.create(parent && parent.prototype, { constructor: { value: child, enumerable: false, @@ -9,7 +9,7 @@ var _extends = function (child, parent) { configurable: true } }); - child.__proto__ = parent; + if (parent) child.__proto__ = parent; }; var Test = function Test() {