diff --git a/packages/babel-helper-replace-supers/src/index.js b/packages/babel-helper-replace-supers/src/index.js index 25d02e1fa1..2d24a92df7 100644 --- a/packages/babel-helper-replace-supers/src/index.js +++ b/packages/babel-helper-replace-supers/src/index.js @@ -1,4 +1,4 @@ -import type { NodePath, Scope } from "@babel/traverse"; +import type { NodePath } from "@babel/traverse"; import traverse from "@babel/traverse"; import memberExpressionToFunctions from "@babel/helper-member-expression-to-functions"; import optimiseCall from "@babel/helper-optimise-call-expression"; @@ -62,19 +62,9 @@ export const environmentVisitor = { const visitor = traverse.visitors.merge([ environmentVisitor, { - ReturnStatement(path, state) { - // TODO get this shit out of here - if (!path.getFunctionParent().isArrowFunctionExpression()) { - state.returns.push(path); - } - }, - Super(path, state) { const { node, parentPath } = path; - if (parentPath.isCallExpression({ callee: node })) { - state.bareSupers.add(parentPath); - return; - } + if (!parentPath.isMemberExpression({ object: node })) return; state.handle(parentPath); }, }, @@ -99,15 +89,7 @@ const specHandlers = { get(superMember) { const { computed, property } = superMember.node; - let thisExpr = t.thisExpression(); - - // TODO Remove - if (this.inConstructor) { - thisExpr = t.callExpression( - this.file.addHelper("assertThisInitialized"), - [thisExpr], - ); - } + const thisExpr = t.thisExpression(); let prop; if (computed && memoized.has(property)) { @@ -193,26 +175,17 @@ export default class ReplaceSupers { this.methodPath = path; this.isStatic = path.isClassMethod({ static: true }) || path.isObjectMethod(); - this.inClass = path.isClassMethod(); - this.inConstructor = path.isClassMethod({ kind: "constructor" }); - this.scope = this.methodPath.scope; this.file = opts.file; this.superRef = opts.superRef; this.isLoose = opts.isLoose; this.opts = opts; - - this.bareSupers = new Set(); - this.returns = []; } methodPath: NodePath; superRef: Object; isStatic: boolean; - inClass: boolean; - inConstructor: boolean; isLoose: boolean; - scope: Scope; file; opts: { getObjetRef: Function, @@ -229,24 +202,12 @@ export default class ReplaceSupers { replace() { const handler = this.isLoose ? looseHandlers : specHandlers; - memberExpressionToFunctions( - this.methodPath, - visitor, - Object.assign( - { - // Necessary state - file: this.file, - isStatic: this.isStatic, - getObjectRef: this.getObjectRef.bind(this), - superRef: this.superRef, - - // TODO Remove this shit. - inConstructor: this.inConstructor, - returns: this.returns, - bareSupers: this.bareSupers, - }, - handler, - ), - ); + memberExpressionToFunctions(this.methodPath, visitor, { + file: this.file, + isStatic: this.isStatic, + getObjectRef: this.getObjectRef.bind(this), + superRef: this.superRef, + ...handler, + }); } } diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/nested-class/super-property-in-key/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/nested-class/super-property-in-key/output.js index 798436d6c1..196dd8b867 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/nested-class/super-property-in-key/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/nested-class/super-property-in-key/output.js @@ -25,7 +25,7 @@ function (_Hello) { babelHelpers.classCallCheck(this, Outer); _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Outer).call(this)); - var _babelHelpers$get$cal = babelHelpers.get(babelHelpers.getPrototypeOf(Outer.prototype), "toString", babelHelpers.assertThisInitialized(_this)).call(_this); + var _babelHelpers$get$cal = babelHelpers.get(babelHelpers.getPrototypeOf(Outer.prototype), "toString", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this)); let Inner = function Inner() { babelHelpers.classCallCheck(this, Inner); diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/public-loose/super-call/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/public-loose/super-call/output.js index 26b5f8b751..6f7c714b2c 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/public-loose/super-call/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/public-loose/super-call/output.js @@ -25,7 +25,7 @@ function (_A) { var _temp, _this; babelHelpers.classCallCheck(this, B); - return babelHelpers.possibleConstructorReturn(_this, (_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(B).call(this, ...args)), _this.foo = babelHelpers.get(babelHelpers.getPrototypeOf(B.prototype), "foo", babelHelpers.assertThisInitialized(_this)).call(_this), _temp)); + return babelHelpers.possibleConstructorReturn(_this, (_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(B).call(this, ...args)), _this.foo = babelHelpers.get(babelHelpers.getPrototypeOf(B.prototype), "foo", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this)), _temp)); } babelHelpers.inherits(B, _A); diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/public-loose/super-with-collision/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/public-loose/super-with-collision/output.js index 778fd34564..40cfbfca52 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/public-loose/super-with-collision/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/public-loose/super-with-collision/output.js @@ -3,5 +3,5 @@ var A = function A(_force) { babelHelpers.classCallCheck(this, A); this.force = force; - this.foo = babelHelpers.get(babelHelpers.getPrototypeOf(A.prototype), "method", babelHelpers.assertThisInitialized(this)).call(this); + this.foo = babelHelpers.get(babelHelpers.getPrototypeOf(A.prototype), "method", this).call(this); }; diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/public/derived/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/public/derived/output.js index 64c6a1e051..b96ba236a9 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/public/derived/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/public/derived/output.js @@ -7,7 +7,7 @@ function (_Bar) { var _temp, _this; babelHelpers.classCallCheck(this, Foo); - return babelHelpers.possibleConstructorReturn(_this, (_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this, ...args)), babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "bar", "foo"), _temp)); + return babelHelpers.possibleConstructorReturn(_this, (_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this, ...args)), babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "bar", "foo"), _temp)); } babelHelpers.inherits(Foo, _Bar); diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/public/foobar/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/public/foobar/output.js index 5a8b51841f..27d0e760f3 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/public/foobar/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/public/foobar/output.js @@ -8,7 +8,7 @@ function (_Parent) { babelHelpers.classCallCheck(this, Child); _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Child).call(this)); - babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "scopedFunctionWithThis", function () { + babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "scopedFunctionWithThis", function () { _this.name = {}; }); return _this; diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-call/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-call/output.js index 7374d4bfa7..20943983c1 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-call/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-call/output.js @@ -25,7 +25,7 @@ function (_A) { var _temp, _this; babelHelpers.classCallCheck(this, B); - return babelHelpers.possibleConstructorReturn(_this, (_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(B).call(this, ...args)), babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "foo", babelHelpers.get(babelHelpers.getPrototypeOf(B.prototype), "foo", babelHelpers.assertThisInitialized(_this)).call(_this)), _temp)); + return babelHelpers.possibleConstructorReturn(_this, (_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(B).call(this, ...args)), babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "foo", babelHelpers.get(babelHelpers.getPrototypeOf(B.prototype), "foo", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this))), _temp)); } babelHelpers.inherits(B, _A); diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-expression/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-expression/output.js index 7e40b2cebb..93f3ec311f 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-expression/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-expression/output.js @@ -7,7 +7,7 @@ function (_Bar) { var _temp, _this; babelHelpers.classCallCheck(this, Foo); - foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)), babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "bar", "foo"), _temp)); + foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)), babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "bar", "foo"), _temp)); return _this; } diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-statement/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-statement/output.js index 1f61bffc51..5c58c076c0 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-statement/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-statement/output.js @@ -8,7 +8,7 @@ function (_Bar) { babelHelpers.classCallCheck(this, Foo); _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)); - babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "bar", "foo"); + babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "bar", "foo"); return _this; } diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-with-collision/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-with-collision/output.js index 2e53db3b98..ad7c6e8dee 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-with-collision/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/public/super-with-collision/output.js @@ -2,5 +2,5 @@ var A = function A(_force) { "use strict"; babelHelpers.classCallCheck(this, A); - babelHelpers.defineProperty(babelHelpers.defineProperty(this, "force", force), "foo", babelHelpers.get(babelHelpers.getPrototypeOf(A.prototype), "method", babelHelpers.assertThisInitialized(this)).call(this)); + babelHelpers.defineProperty(babelHelpers.defineProperty(this, "force", force), "foo", babelHelpers.get(babelHelpers.getPrototypeOf(A.prototype), "method", this).call(this)); }; diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/6154/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/6154/output.js index df91d0c615..78d74f4783 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/6154/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/6154/output.js @@ -8,6 +8,8 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!_instanceof(instance, Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -18,8 +20,6 @@ function _superPropBase(object, property) { while (!Object.prototype.hasOwnPrope function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); } -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - var Test = function Test() { "use strict"; @@ -41,7 +41,7 @@ var Test = function Test() { args[_key] = arguments[_key]; } - return _possibleConstructorReturn(_this, (_temp = _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Other)).call.apply(_getPrototypeOf2, [this].concat(args))), _defineProperty(_assertThisInitialized(_this), "a", function () { + return _possibleConstructorReturn(_this, (_temp = _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Other)).call.apply(_getPrototypeOf2, [this].concat(args))), _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "a", function () { return _get(_getPrototypeOf(Other.prototype), "test", _assertThisInitialized(_this)); }), _temp)); } @@ -52,6 +52,6 @@ var Test = function Test() { }(Test); _defineProperty(Other, "a", function () { - return _get(_getPrototypeOf(Test.prototype), "test", _assertThisInitialized(_this2)); + return _get(_getPrototypeOf(Test.prototype), "test", _this2); }); }; diff --git a/packages/babel-plugin-transform-classes/src/transformClass.js b/packages/babel-plugin-transform-classes/src/transformClass.js index 60cea832f7..8d3ca6cfe0 100644 --- a/packages/babel-plugin-transform-classes/src/transformClass.js +++ b/packages/babel-plugin-transform-classes/src/transformClass.js @@ -218,8 +218,34 @@ export default function transformClass( replaceSupers.replace(); + // TODO this needs to be cleaned up. But, one step at a time. + const state = { + returns: [], + bareSupers: new Set(), + }; + path.traverse( + traverse.visitors.merge([ + environmentVisitor, + { + ReturnStatement(path, state) { + if (!path.getFunctionParent().isArrowFunctionExpression()) { + state.returns.push(path); + } + }, + + Super(path, state) { + const { node, parentPath } = path; + if (parentPath.isCallExpression({ callee: node })) { + state.bareSupers.add(parentPath); + } + }, + }, + ]), + state, + ); + if (isConstructor) { - pushConstructor(replaceSupers, node, path); + pushConstructor(state, node, path); } else { pushMethod(node, path); } @@ -382,7 +408,16 @@ export default function transformClass( } for (const thisPath of classState.superThises) { - thisPath.replaceWith(thisRef()); + const { node, parentPath } = thisPath; + if (parentPath.isMemberExpression({ object: node })) { + thisPath.replaceWith(thisRef()); + continue; + } + thisPath.replaceWith( + t.callExpression(classState.file.addHelper("assertThisInitialized"), [ + thisRef(), + ]), + ); } let wrapReturn; diff --git a/packages/babel-plugin-transform-classes/test/fixtures/get-set/memoized-assign/output.js b/packages/babel-plugin-transform-classes/test/fixtures/get-set/memoized-assign/output.js index 90c8677d8d..a276d167c8 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/get-set/memoized-assign/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/get-set/memoized-assign/output.js @@ -1,5 +1,9 @@ "use strict"; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } @@ -20,10 +24,6 @@ function _superPropBase(object, property) { while (!Object.prototype.hasOwnPrope function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } let Base = function Base() { @@ -51,8 +51,6 @@ const proper = { let Obj = /*#__PURE__*/ function (_Base) { - _inherits(Obj, _Base); - function Obj() { _classCallCheck(this, Obj); @@ -75,6 +73,8 @@ function (_Base) { } }]); + _inherits(Obj, _Base); + return Obj; }(Base); diff --git a/packages/babel-plugin-transform-classes/test/fixtures/get-set/memoized-update/output.js b/packages/babel-plugin-transform-classes/test/fixtures/get-set/memoized-update/output.js index fbeb44aedc..14ae07736e 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/get-set/memoized-update/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/get-set/memoized-update/output.js @@ -1,5 +1,9 @@ "use strict"; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } @@ -20,10 +24,6 @@ function _superPropBase(object, property) { while (!Object.prototype.hasOwnPrope function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } let Base = function Base() { @@ -51,8 +51,6 @@ const proper = { let Obj = /*#__PURE__*/ function (_Base) { - _inherits(Obj, _Base); - function Obj() { _classCallCheck(this, Obj); @@ -75,6 +73,8 @@ function (_Base) { } }]); + _inherits(Obj, _Base); + return Obj; }(Base); diff --git a/packages/babel-plugin-transform-classes/test/fixtures/loose/accessing-super-class/output.js b/packages/babel-plugin-transform-classes/test/fixtures/loose/accessing-super-class/output.js index 5d3d5755e3..d2dc86f73b 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/loose/accessing-super-class/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/loose/accessing-super-class/output.js @@ -11,14 +11,14 @@ function (_Foo) { woops.super.test(); _this = _Foo.call(this) || this; - _Foo.prototype.test.call(_this); + _Foo.prototype.test.call(babelHelpers.assertThisInitialized(_this)); _this = _Foo.apply(this, arguments) || this; _this = _Foo.call.apply(_Foo, [this, "test"].concat(Array.prototype.slice.call(arguments))) || this; - (_Foo$prototype$test = _Foo.prototype.test).call.apply(_Foo$prototype$test, [_this].concat(Array.prototype.slice.call(arguments))); + (_Foo$prototype$test = _Foo.prototype.test).call.apply(_Foo$prototype$test, [babelHelpers.assertThisInitialized(_this)].concat(Array.prototype.slice.call(arguments))); - (_Foo$prototype$test2 = _Foo.prototype.test).call.apply(_Foo$prototype$test2, [_this, "test"].concat(Array.prototype.slice.call(arguments))); + (_Foo$prototype$test2 = _Foo.prototype.test).call.apply(_Foo$prototype$test2, [babelHelpers.assertThisInitialized(_this), "test"].concat(Array.prototype.slice.call(arguments))); return _this; } diff --git a/packages/babel-plugin-transform-classes/test/fixtures/loose/calling-super-properties/output.js b/packages/babel-plugin-transform-classes/test/fixtures/loose/calling-super-properties/output.js index c27b2cf116..195c5ebe74 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/loose/calling-super-properties/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/loose/calling-super-properties/output.js @@ -10,7 +10,7 @@ function (_Foo) { _Foo.prototype.test.whatever(); - _Foo.prototype.test.call(_this); + _Foo.prototype.test.call(babelHelpers.assertThisInitialized(_this)); return _this; } diff --git a/packages/babel-plugin-transform-classes/test/fixtures/regression/3028/output.js b/packages/babel-plugin-transform-classes/test/fixtures/regression/3028/output.js index 43fbc19b28..87b71049ab 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/regression/3028/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/regression/3028/output.js @@ -19,7 +19,7 @@ function (_b) { _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(a1).call(this)); _this.x = function () { - return babelHelpers.assertThisInitialized(_this); + return babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)); }; return _this; @@ -39,7 +39,7 @@ function (_b2) { _this2 = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(a2).call(this)); _this2.x = function () { - return babelHelpers.assertThisInitialized(_this2); + return babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this2)); }; return _this2; diff --git a/packages/babel-plugin-transform-classes/test/fixtures/regression/5769/output.js b/packages/babel-plugin-transform-classes/test/fixtures/regression/5769/output.js index f7cc158366..1ffa80809d 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/regression/5769/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/regression/5769/output.js @@ -27,7 +27,7 @@ function (_Point) { babelHelpers.classCallCheck(this, ColorPoint); _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(ColorPoint).call(this)); _this.x = 2; - babelHelpers.set(babelHelpers.getPrototypeOf(ColorPoint.prototype), "x", 3, _this, true); + babelHelpers.set(babelHelpers.getPrototypeOf(ColorPoint.prototype), "x", 3, babelHelpers.assertThisInitialized(_this), true); expect(_this.x).toBe(3); // A expect(babelHelpers.get(babelHelpers.getPrototypeOf(ColorPoint.prototype), "x", babelHelpers.assertThisInitialized(_this))).toBeUndefined(); // B diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/accessing-super-class/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/accessing-super-class/output.js index 0bc524c2ad..c8ede2795b 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/accessing-super-class/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/accessing-super-class/output.js @@ -11,12 +11,12 @@ function (_Foo) { babelHelpers.classCallCheck(this, Test); woops.super.test(); _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Test).call(this)); - babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "test", babelHelpers.assertThisInitialized(_this)).call(_this); + babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "test", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this)); _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Test).apply(this, arguments)); _this = babelHelpers.possibleConstructorReturn(this, (_babelHelpers$getProt = babelHelpers.getPrototypeOf(Test)).call.apply(_babelHelpers$getProt, [this, "test"].concat(Array.prototype.slice.call(arguments)))); - babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "test", babelHelpers.assertThisInitialized(_this)).apply(_this, arguments); + babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "test", babelHelpers.assertThisInitialized(_this)).apply(babelHelpers.assertThisInitialized(_this), arguments); - (_babelHelpers$get = babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "test", babelHelpers.assertThisInitialized(_this))).call.apply(_babelHelpers$get, [_this, "test"].concat(Array.prototype.slice.call(arguments))); + (_babelHelpers$get = babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "test", babelHelpers.assertThisInitialized(_this))).call.apply(_babelHelpers$get, [babelHelpers.assertThisInitialized(_this), "test"].concat(Array.prototype.slice.call(arguments))); return _this; } diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/calling-super-properties/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/calling-super-properties/output.js index d7ff3f6b23..8f53419a6e 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/calling-super-properties/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/calling-super-properties/output.js @@ -9,7 +9,7 @@ function (_Foo) { babelHelpers.classCallCheck(this, Test); _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Test).call(this)); babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "test", babelHelpers.assertThisInitialized(_this)).whatever(); - babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "test", babelHelpers.assertThisInitialized(_this)).call(_this); + babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "test", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this)); return _this; } diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/default-super/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/default-super/output.js index ca30a9e88a..8996a90b76 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/default-super/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/default-super/output.js @@ -5,7 +5,7 @@ function () { function Test() { babelHelpers.classCallCheck(this, Test); - return babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "constructor", babelHelpers.assertThisInitialized(this)); + return babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "constructor", this); } babelHelpers.createClass(Test, null, [{ diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/nested-class-super-property-in-key/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/nested-class-super-property-in-key/output.js index b67ef5315e..d6d32d20e8 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/nested-class-super-property-in-key/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/nested-class-super-property-in-key/output.js @@ -33,7 +33,7 @@ function (_Hello) { } babelHelpers.createClass(Inner, [{ - key: babelHelpers.get(babelHelpers.getPrototypeOf(Outer.prototype), "toString", babelHelpers.assertThisInitialized(_this)).call(_this), + key: babelHelpers.get(babelHelpers.getPrototypeOf(Outer.prototype), "toString", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this)), value: function value() { return 'hello'; } diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/nested-object-super-property-in-key/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/nested-object-super-property-in-key/output.js index a1e0f3c64d..86ddf229ce 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/nested-object-super-property-in-key/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/nested-object-super-property-in-key/output.js @@ -25,7 +25,7 @@ function (_Hello) { babelHelpers.classCallCheck(this, Outer); _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Outer).call(this)); var Inner = { - [babelHelpers.get(babelHelpers.getPrototypeOf(Outer.prototype), "toString", babelHelpers.assertThisInitialized(_this)).call(_this)]() { + [babelHelpers.get(babelHelpers.getPrototypeOf(Outer.prototype), "toString", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this))]() { return 'hello'; } diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-function-fallback/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-function-fallback/output.js index 301cbfcf3c..6257c331f0 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-function-fallback/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-function-fallback/output.js @@ -2,5 +2,5 @@ var Test = function Test() { "use strict"; babelHelpers.classCallCheck(this, Test); - babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "hasOwnProperty", babelHelpers.assertThisInitialized(this)).call(this, "test"); + babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "hasOwnProperty", this).call(this, "test"); }; diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super-inline/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super-inline/output.js index b70900db16..5637d600a9 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super-inline/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super-inline/output.js @@ -6,14 +6,14 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); } -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - var Foo = /*#__PURE__*/ function (_Bar) { @@ -24,7 +24,7 @@ function (_Bar) { _classCallCheck(this, Foo); - _get(_getPrototypeOf(Foo.prototype), "foo", _assertThisInitialized(_this)).call(_this, _this = _possibleConstructorReturn(this, _getPrototypeOf(Foo).call(this))); + _get(_getPrototypeOf(Foo.prototype), "foo", _assertThisInitialized(_this)).call(_assertThisInitialized(_this), _this = _possibleConstructorReturn(this, _getPrototypeOf(Foo).call(this))); return _this; } diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super/output.js index 96e10dae44..4d3b5cd506 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super/output.js @@ -6,14 +6,14 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); } -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - var Foo = /*#__PURE__*/ function (_Bar) { @@ -24,7 +24,7 @@ function (_Bar) { _classCallCheck(this, Foo); - _get(_getPrototypeOf(Foo.prototype), "foo", _assertThisInitialized(_this)).call(_this); + _get(_getPrototypeOf(Foo.prototype), "foo", _assertThisInitialized(_this)).call(_assertThisInitialized(_this)); return _this = _possibleConstructorReturn(this, _getPrototypeOf(Foo).call(this)); } diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-in-lambda-2/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-in-lambda-2/output.js index 6fd00bf745..b74f4cb87e 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-in-lambda-2/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-in-lambda-2/output.js @@ -8,9 +8,9 @@ function (_Bar) { babelHelpers.classCallCheck(this, Foo); - var t = () => babelHelpers.get(babelHelpers.getPrototypeOf(Foo.prototype), "test", babelHelpers.assertThisInitialized(_this)).call(_this); + var t = () => babelHelpers.get(babelHelpers.getPrototypeOf(Foo.prototype), "test", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this)); - babelHelpers.get(babelHelpers.getPrototypeOf(Foo.prototype), "foo", babelHelpers.assertThisInitialized(_this)).call(_this); + babelHelpers.get(babelHelpers.getPrototypeOf(Foo.prototype), "foo", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this)); return _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)); } diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-in-lambda-3/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-in-lambda-3/output.js index ed66fcc56a..6dcddcbcef 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-in-lambda-3/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-in-lambda-3/output.js @@ -8,7 +8,7 @@ function (_Bar) { babelHelpers.classCallCheck(this, Foo); - var t = () => babelHelpers.get(babelHelpers.getPrototypeOf(Foo.prototype), "test", babelHelpers.assertThisInitialized(_this)).call(_this); + var t = () => babelHelpers.get(babelHelpers.getPrototypeOf(Foo.prototype), "test", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this)); _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)); t(); diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-in-lambda/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-in-lambda/output.js index 99c043fac9..ae107cecec 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-in-lambda/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-in-lambda/output.js @@ -8,7 +8,7 @@ function (_Bar) { babelHelpers.classCallCheck(this, Foo); - var t = () => babelHelpers.get(babelHelpers.getPrototypeOf(Foo.prototype), "test", babelHelpers.assertThisInitialized(_this)).call(_this); + var t = () => babelHelpers.get(babelHelpers.getPrototypeOf(Foo.prototype), "test", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this)); return _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)); } diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-in-prop-exression/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-in-prop-exression/output.js index 81f301acba..6fa51cc9e7 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-in-prop-exression/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-in-prop-exression/output.js @@ -7,7 +7,7 @@ function (_Bar) { var _this; babelHelpers.classCallCheck(this, Foo); - babelHelpers.get(babelHelpers.getPrototypeOf(Foo.prototype), (_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this))).method, babelHelpers.assertThisInitialized(_this)).call(_this); + babelHelpers.get(babelHelpers.getPrototypeOf(Foo.prototype), (_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this))).method, babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this)); return _this; } diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-2/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-2/output.js index 0792666878..f40a2612a7 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-2/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-2/output.js @@ -7,7 +7,7 @@ function (_Bar) { var _this; babelHelpers.classCallCheck(this, Foo); - return _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this, babelHelpers.assertThisInitialized(_this))); + return _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this, babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)))); } babelHelpers.inherits(Foo, _Bar); diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-3/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-3/output.js index 52edb99b87..20dcf6c80c 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-3/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-3/output.js @@ -8,7 +8,7 @@ function (_Bar) { babelHelpers.classCallCheck(this, Foo); - var fn = () => babelHelpers.assertThisInitialized(_this); + var fn = () => babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)); fn(); return _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)); diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-4/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-4/output.js index 2b58b6d9ed..02248a3a2a 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-4/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-4/output.js @@ -8,7 +8,7 @@ function (_Bar) { babelHelpers.classCallCheck(this, Foo); - var fn = () => babelHelpers.assertThisInitialized(_this); + var fn = () => babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)); _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)); fn(); diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-5/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-5/output.js index 798e18f361..8f24cd867f 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-5/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/this-not-allowed-before-super-in-derived-classes-5/output.js @@ -7,7 +7,7 @@ function (_Bar) { var _this; babelHelpers.classCallCheck(this, Foo); - Foo[babelHelpers.assertThisInitialized(_this)]; + Foo[babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))]; return babelHelpers.possibleConstructorReturn(_this); } diff --git a/packages/babel-plugin-transform-parameters/test/fixtures/regression/6057-expanded/output.js b/packages/babel-plugin-transform-parameters/test/fixtures/regression/6057-expanded/output.js index 68792d93df..3feb0f81d6 100644 --- a/packages/babel-plugin-transform-parameters/test/fixtures/regression/6057-expanded/output.js +++ b/packages/babel-plugin-transform-parameters/test/fixtures/regression/6057-expanded/output.js @@ -45,7 +45,7 @@ function (_Component) { args[_key] = arguments[_key]; } - return _possibleConstructorReturn(_this, (_temp = _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(App)).call.apply(_getPrototypeOf2, [this].concat(args))), _defineProperty(_assertThisInitialized(_this), "exportType", ''), _temp)); + return _possibleConstructorReturn(_this, (_temp = _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(App)).call.apply(_getPrototypeOf2, [this].concat(args))), _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "exportType", ''), _temp)); } _createClass(App, [{