diff --git a/packages/babel-helpers/src/helpers.js b/packages/babel-helpers/src/helpers.js index 24531f015e58..500a37007d09 100644 --- a/packages/babel-helpers/src/helpers.js +++ b/packages/babel-helpers/src/helpers.js @@ -472,7 +472,7 @@ helpers.wrapNativeSuper = () => template.program.ast` constructor: { value: Wrapper, enumerable: false, - writeable: true, + writable: true, configurable: true, } }); diff --git a/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/loose/output.js b/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/loose/output.js index 90a34b02cd60..81b85f71b97b 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/loose/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/loose/output.js @@ -8,7 +8,7 @@ var _construct = typeof Reflect === "object" && Reflect.construct || function _c var _cache = typeof Map === "function" && new Map(); -function _wrapNativeSuper(Class) { if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() {} Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writeable: true, configurable: true } }); return _sPO(Wrapper, _sPO(function Super() { return _construct(Class, arguments, _gPO(this).constructor); }, Class)); } +function _wrapNativeSuper(Class) { if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() {} Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _sPO(Wrapper, _sPO(function Super() { return _construct(Class, arguments, _gPO(this).constructor); }, Class)); } var List = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/spec/output.js b/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/spec/output.js index 4b7fbb1def64..80508563d2d6 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/spec/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/spec/output.js @@ -14,7 +14,7 @@ var _construct = typeof Reflect === "object" && Reflect.construct || function _c var _cache = typeof Map === "function" && new Map(); -function _wrapNativeSuper(Class) { if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() {} Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writeable: true, configurable: true } }); return _sPO(Wrapper, _sPO(function Super() { return _construct(Class, arguments, _gPO(this).constructor); }, Class)); } +function _wrapNativeSuper(Class) { if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() {} Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _sPO(Wrapper, _sPO(function Super() { return _construct(Class, arguments, _gPO(this).constructor); }, Class)); } var List = /*#__PURE__*/ diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/output.js b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/output.js index 309d39b13468..e34f1abbd4a0 100644 --- a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/output.js +++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/output.js @@ -20,7 +20,7 @@ var _construct = (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect var _cache = typeof Map === "function" && new Map(); -function _wrapNativeSuper(Class) { if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() {} Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writeable: true, configurable: true } }); return _sPO(Wrapper, _sPO(function Super() { return _construct(Class, arguments, _gPO(this).constructor); }, Class)); } +function _wrapNativeSuper(Class) { if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() {} Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _sPO(Wrapper, _sPO(function Super() { return _construct(Class, arguments, _gPO(this).constructor); }, Class)); } var MyDate = /*#__PURE__*/