diff --git a/test/expectations/es-next/async-await.js b/test/expectations/es-next/async-await.js index 40897af..bbe416e 100644 --- a/test/expectations/es-next/async-await.js +++ b/test/expectations/es-next/async-await.js @@ -5,18 +5,19 @@ define("es-next/async-await", ["exports"], function (_exports) { value: true }); _exports.default = void 0; - var _ref; function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } - let asyncFunc = function asyncFunc() { - return (_ref = _ref || _asyncToGenerator(function* () { + let asyncFunc = /*#__PURE__*/function () { + var _ref = _asyncToGenerator(function* () { let result = yield Promise.resolve(); return Promise.resolve(); - })).apply(this, arguments); - }; + }); + return function asyncFunc() { + return _ref.apply(this, arguments); + }; + }(); function syncFunc() { return Promise.all([asyncFunc()]); } - var _default = syncFunc; - _exports.default = _default; + var _default = _exports.default = syncFunc; }); diff --git a/test/expectations/es-next/dynamic-import.js b/test/expectations/es-next/dynamic-import.js index cf94d75..b0e9ade 100644 --- a/test/expectations/es-next/dynamic-import.js +++ b/test/expectations/es-next/dynamic-import.js @@ -5,8 +5,8 @@ define("es-next/dynamic-import", ["require", "exports"], function (_require, _ex value: true }); _exports.default = void 0; - function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } let x = './dir'; let y = new Promise((_resolve, _reject) => { try { @@ -15,6 +15,5 @@ define("es-next/dynamic-import", ["require", "exports"], function (_require, _ex _reject(); } }); - var _default = y; - _exports.default = _default; + var _default = _exports.default = y; }); diff --git a/test/expectations/es-next/dynamic-string-import.js b/test/expectations/es-next/dynamic-string-import.js index 297a60e..223619e 100644 --- a/test/expectations/es-next/dynamic-string-import.js +++ b/test/expectations/es-next/dynamic-string-import.js @@ -5,8 +5,8 @@ define("es-next/dynamic-string-import", ["require", "exports"], function (_requi value: true }); _exports.default = void 0; - function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } let x = './dir'; let y = new Promise((_resolve, _reject) => { try { @@ -15,6 +15,5 @@ define("es-next/dynamic-string-import", ["require", "exports"], function (_requi _reject(); } }); - var _default = y; - _exports.default = _default; + var _default = _exports.default = y; }); diff --git a/test/expectations/es-next/import-export.js b/test/expectations/es-next/import-export.js index 557eae4..36d6f82 100644 --- a/test/expectations/es-next/import-export.js +++ b/test/expectations/es-next/import-export.js @@ -7,6 +7,5 @@ define("es-next/import-export", ["exports", "y"], function (_exports, _y) { _exports.default = void 0; _y = _interopRequireDefault(_y); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _default = _y.default; - _exports.default = _default; + var _default = _exports.default = _y.default; }); diff --git a/test/expectations/es-next/module-root.js b/test/expectations/es-next/module-root.js index 65be081..88e42d2 100644 --- a/test/expectations/es-next/module-root.js +++ b/test/expectations/es-next/module-root.js @@ -7,6 +7,5 @@ define("es-next/module-root", ["exports", "import-export"], function (_exports, _exports.default = void 0; _importExport = _interopRequireDefault(_importExport); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _default = _importExport.default; - _exports.default = _default; + var _default = _exports.default = _importExport.default; });