diff --git a/crates/swc/src/builder.rs b/crates/swc/src/builder.rs index 9175c5e949d..37844936174 100644 --- a/crates/swc/src/builder.rs +++ b/crates/swc/src/builder.rs @@ -265,6 +265,7 @@ impl<'a, 'b, P: swc_ecma_visit::Fold> PassBuilder<'a, 'b, P> { ignore_function_length: assumptions.ignore_function_length }, }, + comments, self.unresolved_mark ), should_enable(self.target, EsVersion::Es2017) diff --git a/crates/swc/tests/fixture/config/regenerator/import-path/1/output/index.js b/crates/swc/tests/fixture/config/regenerator/import-path/1/output/index.js index 241d4ea4fea..bb756e799f7 100644 --- a/crates/swc/tests/fixture/config/regenerator/import-path/1/output/index.js +++ b/crates/swc/tests/fixture/config/regenerator/import-path/1/output/index.js @@ -1,5 +1,5 @@ import regeneratorRuntime from "custom"; -var _marked = regeneratorRuntime.mark(gen); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(gen); function gen() { return regeneratorRuntime.wrap(function gen$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-1xxx/1216/case-1/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1216/case-1/output/index.js index 38bdcdd7631..f3851a2fa9b 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1216/case-1/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1216/case-1/output/index.js @@ -8,7 +8,7 @@ function request(path) { return _request.apply(this, arguments); } function _request() { - _request = _async_to_generator(regeneratorRuntime.mark(function _callee(path) { + _request = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(path) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -21,7 +21,7 @@ function _request() { })); return _request.apply(this, arguments); } -_async_to_generator(regeneratorRuntime.mark(function _callee() { +_async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var obj; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-1xxx/1216/case-2/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1216/case-2/output/index.js index 38bdcdd7631..f3851a2fa9b 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1216/case-2/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1216/case-2/output/index.js @@ -8,7 +8,7 @@ function request(path) { return _request.apply(this, arguments); } function _request() { - _request = _async_to_generator(regeneratorRuntime.mark(function _callee(path) { + _request = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(path) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -21,7 +21,7 @@ function _request() { })); return _request.apply(this, arguments); } -_async_to_generator(regeneratorRuntime.mark(function _callee() { +_async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var obj; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-1xxx/1216/case-3/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1216/case-3/output/index.js index f3094780009..2b5e6a908ab 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1216/case-3/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1216/case-3/output/index.js @@ -1,5 +1,5 @@ import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(foo); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo); function foo() { var val; return regeneratorRuntime.wrap(function foo$(_ctx) { diff --git a/crates/swc/tests/fixture/issues-1xxx/1449/case1/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1449/case1/output/index.js index d2d80e2721c..18aaeb778da 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1449/case1/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1449/case1/output/index.js @@ -5,7 +5,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var tmp, ref, ref; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-1xxx/1455/case2/output/index.ts b/crates/swc/tests/fixture/issues-1xxx/1455/case2/output/index.ts index 6b16dd8f0ba..966966438ed 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1455/case2/output/index.ts +++ b/crates/swc/tests/fixture/issues-1xxx/1455/case2/output/index.ts @@ -8,7 +8,7 @@ var obj = { }; }, byPlatform: function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(platform) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(platform) { var result; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-1xxx/1477/case1/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1477/case1/output/index.js index 8b2dbde7330..cd0bb1ee5b2 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1477/case1/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1477/case1/output/index.js @@ -5,7 +5,7 @@ function f(a, b) { return _f.apply(this, arguments); } function _f() { - _f = _async_to_generator(regeneratorRuntime.mark(function _callee(a, b) { + _f = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(a, b) { var ref, ref1, tmp, a_; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-1xxx/1575/case1/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1575/case1/output/index.js index 9d25a3f48a7..cbfa25d968d 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1575/case1/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1575/case1/output/index.js @@ -3,7 +3,7 @@ import regeneratorRuntime from "regenerator-runtime"; Vue.component("test", { methods: { onSend: function onSend() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/fixture/issues-1xxx/1575/case2/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1575/case2/output/index.js index 9ec3b39e6a0..ab641b22fe1 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1575/case2/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1575/case2/output/index.js @@ -3,7 +3,7 @@ import regeneratorRuntime from "regenerator-runtime"; var obj = { foo: 5, method: function method() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/fixture/issues-1xxx/1687/output/input.tsx b/crates/swc/tests/fixture/issues-1xxx/1687/output/input.tsx index fd05a7631b7..ff357ee5190 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1687/output/input.tsx +++ b/crates/swc/tests/fixture/issues-1xxx/1687/output/input.tsx @@ -11,7 +11,7 @@ import { Button, ConfigProvider } from "antd"; function App() { var ref = _sliced_to_array(useState({}), 2), state = ref[0], setState = ref[1]; useEffect(function() { - _async_to_generator(regeneratorRuntime.mark(function _callee() { + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/fixture/issues-1xxx/1718/case1/output/index.ts b/crates/swc/tests/fixture/issues-1xxx/1718/case1/output/index.ts index 4c49dbce734..42eb4702d84 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1718/case1/output/index.ts +++ b/crates/swc/tests/fixture/issues-1xxx/1718/case1/output/index.ts @@ -4,13 +4,13 @@ function scanUser(groups) { return _scanUser.apply(this, arguments); } function _scanUser() { - _scanUser = _async_to_generator(regeneratorRuntime.mark(function _callee(groups) { + _scanUser = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(groups) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: _ctx.next = 2; return Promise.all(groups.map(function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(param) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(param) { var users, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, user; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-1xxx/1721/case1/async-generator/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1721/case1/async-generator/output/index.js index 1f3971053f6..5290e69b4ef 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1721/case1/async-generator/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1721/case1/async-generator/output/index.js @@ -4,7 +4,7 @@ function lol() { return _lol.apply(this, arguments); } function _lol() { - _lol = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _lol = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/fixture/issues-1xxx/1721/case1/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1721/case1/output/index.js index 915136773cc..1285e095d26 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1721/case1/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1721/case1/output/index.js @@ -6,7 +6,7 @@ function lol() { return _lol.apply(this, arguments); } function _lol() { - _lol = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _lol = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -27,7 +27,7 @@ function main() { return _main.apply(this, arguments); } function _main() { - _main = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _main = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-1xxx/1722/case1/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1722/case1/output/index.js index bea83da715c..b3ed32f9d5b 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1722/case1/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1722/case1/output/index.js @@ -1,7 +1,7 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; (function() { - var _main = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _main = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/fixture/issues-1xxx/1799/case1/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1799/case1/output/index.js index 41488988517..87066e60150 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1799/case1/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1799/case1/output/index.js @@ -14,7 +14,7 @@ var _regeneratorRuntime = /*#__PURE__*/ _interopRequireDefault(require("regenera var _react = /*#__PURE__*/ _interopRequireDefault(require("react")); function Foo() { return /*#__PURE__*/ _react.default.createElement("div", { - onClick: _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee(e) { + onClick: /*#__PURE__*/ _asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _callee(e) { return _regeneratorRuntime.default.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/fixture/issues-1xxx/1799/case2/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1799/case2/output/index.js index c0a09a30f3f..bd8610d0484 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1799/case2/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1799/case2/output/index.js @@ -11,7 +11,7 @@ const _interopRequireDefault = require("@swc/helpers/lib/_interop_require_defaul const _react = /*#__PURE__*/ _interopRequireDefault(require("react")); function Foo() { return /*#__PURE__*/ _react.default.createElement("div", { - onClick: _asyncToGenerator(function*(e) { + onClick: /*#__PURE__*/ _asyncToGenerator(function*(e) { yield doSomething(); }) }); diff --git a/crates/swc/tests/fixture/issues-1xxx/1799/case3/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1799/case3/output/index.js index c0a09a30f3f..bd8610d0484 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1799/case3/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1799/case3/output/index.js @@ -11,7 +11,7 @@ const _interopRequireDefault = require("@swc/helpers/lib/_interop_require_defaul const _react = /*#__PURE__*/ _interopRequireDefault(require("react")); function Foo() { return /*#__PURE__*/ _react.default.createElement("div", { - onClick: _asyncToGenerator(function*(e) { + onClick: /*#__PURE__*/ _asyncToGenerator(function*(e) { yield doSomething(); }) }); diff --git a/crates/swc/tests/fixture/issues-1xxx/1799/case6-no-jsx/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1799/case6-no-jsx/output/index.js index bd3b8e4afbc..a957c1c6ca4 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1799/case6-no-jsx/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1799/case6-no-jsx/output/index.js @@ -13,7 +13,7 @@ var _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default. var _regeneratorRuntime = /*#__PURE__*/ _interopRequireDefault(require("regenerator-runtime")); var _react = /*#__PURE__*/ _interopRequireDefault(require("react")); function Foo() { - return call(_asyncToGenerator(_regeneratorRuntime.default.mark(function _callee(e) { + return call(/*#__PURE__*/ _asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _callee(e) { return _regeneratorRuntime.default.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/fixture/issues-1xxx/1918/es5-after-other/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1918/es5-after-other/output/index.js index b2fa7eb6f65..4773c5b0a52 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1918/es5-after-other/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1918/es5-after-other/output/index.js @@ -48,7 +48,7 @@ function _asyncToGenerator(fn) { }); }; } -_asyncToGenerator(_regeneratorRuntime.default.mark(function _callee() { +_asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _callee() { var counter, resolve, promise, iterable, res, _i, _iter, v, oldresolve; return _regeneratorRuntime.default.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -65,7 +65,7 @@ _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee() { } }; }); - res = _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee() { + res = _asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _callee() { var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, value; return _regeneratorRuntime.default.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-1xxx/1918/es5/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1918/es5/output/index.js index 2acda374162..84fe8b88a56 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1918/es5/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1918/es5/output/index.js @@ -7,7 +7,7 @@ var _asyncToGenerator = require("@swc/helpers/lib/_async_to_generator.js").defau var _defineProperty = require("@swc/helpers/lib/_define_property.js").default; var _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default; var _regeneratorRuntime = /*#__PURE__*/ _interopRequireDefault(require("regenerator-runtime")); -_asyncToGenerator(_regeneratorRuntime.default.mark(function _callee() { +_asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _callee() { var counter, resolve, promise, iterable, res, _i, _iter, v, oldresolve; return _regeneratorRuntime.default.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -24,7 +24,7 @@ _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee() { } }; }); - res = _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee() { + res = _asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _callee() { var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, value; return _regeneratorRuntime.default.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-1xxx/1924/case1/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1924/case1/output/index.js index 95607cc239e..a617e8b3ebc 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1924/case1/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1924/case1/output/index.js @@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { }); var _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default; var _regeneratorRuntime = /*#__PURE__*/ _interopRequireDefault(require("regenerator-runtime")); -var _marked = _regeneratorRuntime.default.mark(foo); +var _marked = /*#__PURE__*/ _regeneratorRuntime.default.mark(foo); function foo() { return _regeneratorRuntime.default.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-2xxx/2024/full/output/index.js b/crates/swc/tests/fixture/issues-2xxx/2024/full/output/index.js index 6852a685574..cdff570579b 100644 --- a/crates/swc/tests/fixture/issues-2xxx/2024/full/output/index.js +++ b/crates/swc/tests/fixture/issues-2xxx/2024/full/output/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { var _asyncToGenerator = require("@swc/helpers/lib/_async_to_generator.js").default; var _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default; var _regeneratorRuntime = /*#__PURE__*/ _interopRequireDefault(require("regenerator-runtime")); -_asyncToGenerator(_regeneratorRuntime.default.mark(function _callee() { +_asyncToGenerator(/*#__PURE__*/ _regeneratorRuntime.default.mark(function _callee() { var sleep, result; return _regeneratorRuntime.default.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-2xxx/2024/no-module/output/index.js b/crates/swc/tests/fixture/issues-2xxx/2024/no-module/output/index.js index 3abea1cc737..537484e772d 100644 --- a/crates/swc/tests/fixture/issues-2xxx/2024/no-module/output/index.js +++ b/crates/swc/tests/fixture/issues-2xxx/2024/no-module/output/index.js @@ -1,6 +1,6 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { +_async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var sleep, result; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-2xxx/2164/es5/output/index.js b/crates/swc/tests/fixture/issues-2xxx/2164/es5/output/index.js index 883798ab7a4..1521221edf6 100644 --- a/crates/swc/tests/fixture/issues-2xxx/2164/es5/output/index.js +++ b/crates/swc/tests/fixture/issues-2xxx/2164/es5/output/index.js @@ -4,7 +4,7 @@ function fn() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var key; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-2xxx/2232/case1/output/index.js b/crates/swc/tests/fixture/issues-2xxx/2232/case1/output/index.js index 8d8904c0ad0..655334f061f 100644 --- a/crates/swc/tests/fixture/issues-2xxx/2232/case1/output/index.js +++ b/crates/swc/tests/fixture/issues-2xxx/2232/case1/output/index.js @@ -12,7 +12,7 @@ var Foo = /*#__PURE__*/ function() { { key: "sendSomeMessage", value: function sendSomeMessage(_parent, _param, _param1) { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var _input, toNumber, messageBody, all, dataSources; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-2xxx/2232/case2/output/index.ts b/crates/swc/tests/fixture/issues-2xxx/2232/case2/output/index.ts index e4a322b6369..7a0345e20c2 100644 --- a/crates/swc/tests/fixture/issues-2xxx/2232/case2/output/index.ts +++ b/crates/swc/tests/fixture/issues-2xxx/2232/case2/output/index.ts @@ -3,7 +3,7 @@ import _object_without_properties from "@swc/helpers/src/_object_without_propert import regeneratorRuntime from "regenerator-runtime"; var resolver = { sendSomeMessage: function sendSomeMessage(_parent, _param, _param1) { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var _input, toNumber, messageBody, all, dataSources; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-2xxx/2248/es5/output/index.js b/crates/swc/tests/fixture/issues-2xxx/2248/es5/output/index.js index 889eea88f76..d88217e93d1 100644 --- a/crates/swc/tests/fixture/issues-2xxx/2248/es5/output/index.js +++ b/crates/swc/tests/fixture/issues-2xxx/2248/es5/output/index.js @@ -1,7 +1,7 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; export var foo = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/fixture/issues-2xxx/2413/1/output/index.js b/crates/swc/tests/fixture/issues-2xxx/2413/1/output/index.js index 9eb23f1414e..4ba66269c4c 100644 --- a/crates/swc/tests/fixture/issues-2xxx/2413/1/output/index.js +++ b/crates/swc/tests/fixture/issues-2xxx/2413/1/output/index.js @@ -1,6 +1,6 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var handleSubmit = useMutation(_async_to_generator(regeneratorRuntime.mark(function _callee() { +var handleSubmit = useMutation(/*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var res, errors; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-4xxx/4108/1/output/index.ts b/crates/swc/tests/fixture/issues-4xxx/4108/1/output/index.ts index 7e943dd077e..7711a6ce863 100644 --- a/crates/swc/tests/fixture/issues-4xxx/4108/1/output/index.ts +++ b/crates/swc/tests/fixture/issues-4xxx/4108/1/output/index.ts @@ -5,7 +5,7 @@ import regeneratorRuntime from "regenerator-runtime"; import { Transaction } from "@solana/web3.js"; import { WalletNotConnectedError } from "@solana/wallet-adapter-base"; export var getErrorForTransaction = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(connection, txid) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(connection, txid) { var tx, errors; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -54,7 +54,7 @@ export function sendTransactionsWithManualRetry(connection, wallet, instructions return _sendTransactionsWithManualRetry.apply(this, arguments); } function _sendTransactionsWithManualRetry() { - _sendTransactionsWithManualRetry = _async_to_generator(regeneratorRuntime.mark(function _callee(connection, wallet, instructions, signers) { + _sendTransactionsWithManualRetry = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(connection, wallet, instructions, signers) { var stopPoint, tries, lastInstructionsLength, toRemoveSigners, ids, filteredSigners, id, txs; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -133,7 +133,7 @@ function _sendTransactionsWithManualRetry() { return _sendTransactionsWithManualRetry.apply(this, arguments); } export var sendTransactions = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(connection, wallet, instructionSet, signersSet) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(connection, wallet, instructionSet, signersSet) { var _loop, sequenceType, commitment, successCallback, failCallback, block, beforeTransactions, afterTransactions, _unsignedTxns, unsignedTxns, i, partiallySignedTransactions, fullySignedTransactions, signedTxns, pendingTxns, i1, signedTxnPromise, result, _args = arguments; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -294,7 +294,7 @@ export var sendTransactions = function() { }; }(); export var sendTransaction = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(connection, wallet, instructions, signers) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(connection, wallet, instructions, signers) { var awaitConfirmation, commitment, includesFeePayer, block, transaction, _transaction, _transaction1, _transaction2, rawTransaction, options, txid, slot, confirmation, errors, _args = arguments; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -410,7 +410,7 @@ export var sendTransaction = function() { }; }(); export var sendTransactionWithRetry = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(connection, wallet, instructions, signers) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(connection, wallet, instructions, signers) { var commitment, includesFeePayer, block, beforeSend, transaction, _transaction, _transaction1, _transaction2, ref, txid, slot, _args = arguments; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -498,7 +498,7 @@ export function sendSignedTransaction(_) { return _sendSignedTransaction.apply(this, arguments); } function _sendSignedTransaction() { - _sendSignedTransaction = _async_to_generator(regeneratorRuntime.mark(function _callee(param) { + _sendSignedTransaction = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(param) { var signedTransaction, connection, _timeout, timeout, rawTransaction, startTime, slot, txid, done, confirmation, simulateResult, i, line; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -515,7 +515,7 @@ function _sendSignedTransaction() { txid = _ctx.sent; console.log("Started awaiting confirmation for", txid); done = false; - _async_to_generator(regeneratorRuntime.mark(function _callee() { + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -639,7 +639,7 @@ function simulateTransaction(connection, transaction, commitment) { return _simulateTransaction.apply(this, arguments); } function _simulateTransaction() { - _simulateTransaction = _async_to_generator(regeneratorRuntime.mark(function _callee(connection, transaction, commitment) { + _simulateTransaction = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(connection, transaction, commitment) { var signData, wireTransaction, encodedTransaction, config, args, res; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -684,7 +684,7 @@ function awaitTransactionSignatureConfirmation(txid, timeout, connection) { return _awaitTransactionSignatureConfirmation.apply(this, arguments); } function _awaitTransactionSignatureConfirmation() { - _awaitTransactionSignatureConfirmation = _async_to_generator(regeneratorRuntime.mark(function _callee(txid, timeout, connection) { + _awaitTransactionSignatureConfirmation = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(txid, timeout, connection) { var commitment, queryStatus, done, status, subId, _args = arguments; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -699,7 +699,7 @@ function _awaitTransactionSignatureConfirmation() { subId = 0; _ctx.next = 6; return new Promise(function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(resolve, reject) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(resolve, reject) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -739,7 +739,7 @@ function _awaitTransactionSignatureConfirmation() { break; } // eslint-disable-next-line no-loop-func - _async_to_generator(regeneratorRuntime.mark(function _callee() { + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var signatureStatuses; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/issues-4xxx/4224/1/output/index.js b/crates/swc/tests/fixture/issues-4xxx/4224/1/output/index.js index b3c66d8c85e..c146e355b9b 100644 --- a/crates/swc/tests/fixture/issues-4xxx/4224/1/output/index.js +++ b/crates/swc/tests/fixture/issues-4xxx/4224/1/output/index.js @@ -5,7 +5,7 @@ var A = function A() { "use strict"; _class_call_check(this, A); var _this = this; - this.foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + this.foo = /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -17,7 +17,7 @@ var A = function A() { }, _callee); })); var _this1 = this; - this.bar = _async_to_generator(regeneratorRuntime.mark(function _callee() { + this.bar = /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/fixture/issues-4xxx/4224/2/output/index.js b/crates/swc/tests/fixture/issues-4xxx/4224/2/output/index.js index af1d26856d6..758ce9f024c 100644 --- a/crates/swc/tests/fixture/issues-4xxx/4224/2/output/index.js +++ b/crates/swc/tests/fixture/issues-4xxx/4224/2/output/index.js @@ -2,11 +2,11 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; class A { constructor(){ var _this = this; - this.foo = _async_to_generator(function*() { + this.foo = /*#__PURE__*/ _async_to_generator(function*() { _this.x(); }); var _this1 = this; - this.bar = _async_to_generator(function*() { + this.bar = /*#__PURE__*/ _async_to_generator(function*() { _this1.x(); }); } diff --git a/crates/swc/tests/fixture/issues-4xxx/4224/3/output/index.js b/crates/swc/tests/fixture/issues-4xxx/4224/3/output/index.js index 7de4fdd0493..d3e773bcf60 100644 --- a/crates/swc/tests/fixture/issues-4xxx/4224/3/output/index.js +++ b/crates/swc/tests/fixture/issues-4xxx/4224/3/output/index.js @@ -12,7 +12,7 @@ var A = /*#__PURE__*/ function() { key: "method", value: function method() { var _this = this; - this.foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + this.foo = /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -24,7 +24,7 @@ var A = /*#__PURE__*/ function() { }, _callee); })); var _this1 = this; - this.bar = _async_to_generator(regeneratorRuntime.mark(function _callee() { + this.bar = /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/fixture/next.js/shared/lib/router/1/output/index.ts b/crates/swc/tests/fixture/next.js/shared/lib/router/1/output/index.ts index 7405c5df08a..9581782c765 100644 --- a/crates/swc/tests/fixture/next.js/shared/lib/router/1/output/index.ts +++ b/crates/swc/tests/fixture/next.js/shared/lib/router/1/output/index.ts @@ -9,7 +9,7 @@ var Router = /*#__PURE__*/ function() { var _proto = Router.prototype; _proto.change = function change(method, url, as, options, forcedScroll) { var _this = this; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var shouldResolveHref, prevLocale, parsedAs, localePathResult, didNavigate, ref, detectedDomain, asNoBasePath, _shallow, shallow, routeProps, cleanedAs, localeChange, parsed, pathname, query, pages, rewrites, ref1, resolvedAs, rewritesResult, route, parsedAs1, asPathname, routeRegex, routeMatch, shouldInterpolate, interpolatedAs, missingParams, ref2, ref3, routeInfo, error, props, __N_SSG, __N_SSP, destination, parsedHref, ref4, newUrl, newAs, notFoundRoute, isValidShallowRoute, _scroll, shouldScroll, resetScroll; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/sourcemap/002/output/index.js b/crates/swc/tests/fixture/sourcemap/002/output/index.js index 53c3f9114db..ee6ac248061 100644 --- a/crates/swc/tests/fixture/sourcemap/002/output/index.js +++ b/crates/swc/tests/fixture/sourcemap/002/output/index.js @@ -8,7 +8,7 @@ export function getStaticProps() { return _getStaticProps.apply(this, arguments); } function _getStaticProps() { - _getStaticProps = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _getStaticProps = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/fixture/sourcemap/002/output/index.map b/crates/swc/tests/fixture/sourcemap/002/output/index.map index f9e03d8d85a..e7c630cd89f 100644 --- a/crates/swc/tests/fixture/sourcemap/002/output/index.map +++ b/crates/swc/tests/fixture/sourcemap/002/output/index.map @@ -1,5 +1,5 @@ { - "mappings": "AAAA;;AAAA,eAAe,SAASA,UAAU,CAAC,KAAQ,EAAE;QAAV,AAAEC,IAAI,GAAN,KAAQ,CAANA,IAAI,AAAE;IACvC,qBAAO,oBAACC,KAAG,QAAED,IAAI,CAACE,GAAG,CAAO,CAAC;CAChC,CAAA;AAED,gBAAsBC,cAAc;WAAdA,eAAc;CAQnC;SARqBA,eAAc;IAAdA,eAAc,GAA7B,4CAAA,mBAAgC;;;;iDAC5B;wBACHC,KAAK,EAAE;4BACHJ,IAAI,EAAE;gCACFE,GAAG,EAAE,KAAK;6BACb;yBACJ;qBACJ;;;;;;KACJ,EAAA;WARqBC,eAAc", + "mappings": "AAAA;;AAAA,eAAe,SAASA,UAAU,CAAC,KAAQ,EAAE;QAAV,AAAEC,IAAI,GAAN,KAAQ,CAANA,IAAI,AAAE;IACvC,qBAAO,oBAACC,KAAG,QAAED,IAAI,CAACE,GAAG,CAAO,CAAC;CAChC,CAAA;AAED,gBAAsBC,cAAc;WAAdA,eAAc;CAQnC;SARqBA,eAAc;IAAdA,eAAc,GAA7B,0DAAA,mBAAgC;;;;iDAC5B;wBACHC,KAAK,EAAE;4BACHJ,IAAI,EAAE;gCACFE,GAAG,EAAE,KAAK;6BACb;yBACJ;qBACJ;;;;;;KACJ,EAAA;WARqBC,eAAc", "names": [ "StaticPage", "data", diff --git a/crates/swc/tests/fixture/sourcemap/005/output/index.js b/crates/swc/tests/fixture/sourcemap/005/output/index.js index a76dd1cfb15..293e6eb01c9 100644 --- a/crates/swc/tests/fixture/sourcemap/005/output/index.js +++ b/crates/swc/tests/fixture/sourcemap/005/output/index.js @@ -1,6 +1,6 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -it("should compress avif smaller than webp and smaller than jpg", _async_to_generator(regeneratorRuntime.mark(function _callee() { +it("should compress avif smaller than webp and smaller than jpg", /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var query, res1, res2, res3, avif, webp, jpeg; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/sourcemap/005/output/index.map b/crates/swc/tests/fixture/sourcemap/005/output/index.map index 050da2dbb49..1ce0ce19a2a 100644 --- a/crates/swc/tests/fixture/sourcemap/005/output/index.map +++ b/crates/swc/tests/fixture/sourcemap/005/output/index.map @@ -1,5 +1,5 @@ { - "mappings": "AAAAA;;AAAAA,EAAE,CAAC,6DAA6D,EAAE,4CAAA,mBAAY;QACpEC,KAAK,EACLC,IAAI,EAQJC,IAAI,EAQJC,IAAI,EAQJC,IAAI,EACJC,IAAI,EACJC,IAAI;;;;gBA3BJN,KAAK,GAAG;oBAAEO,GAAG,EAAE,WAAW;oBAAEC,CAAC,EAADA,CAAC;oBAAEC,CAAC,EAAE,EAAE;iBAAE,CAAC;;uBAC1BC,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIZ,IAAI,YAIR,CAAA;gBACFa,MAAM,CAACb,IAAI,CAACc,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACb,IAAI,CAACW,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAEzCN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIX,IAAI,YAIR,CAAA;gBACFY,MAAM,CAACZ,IAAI,CAACa,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACZ,IAAI,CAACU,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAEzCN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIV,IAAI,YAIR,CAAA;gBACFW,MAAM,CAACX,IAAI,CAACY,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACX,IAAI,CAACS,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAExCf,IAAI,CAACiB,MAAM,EAAE;;gBAA3Bd,IAAI,GAAG,UAAsBe,UAAU,CAAA;;uBACzBjB,IAAI,CAACgB,MAAM,EAAE;;gBAA3Bb,IAAI,GAAG,UAAsBc,UAAU,CAAA;;uBACzBhB,IAAI,CAACe,MAAM,EAAE;;gBAA3BZ,IAAI,GAAG,UAAsBa,UAAU,CAAA;gBAE7CC,OAAO,CAACC,GAAG,CAAC;oBAAEC,OAAO,EAAPA,OAAO;oBAAEd,CAAC,EAADA,CAAC;oBAAEJ,IAAI,EAAJA,IAAI;oBAAEC,IAAI,EAAJA,IAAI;oBAAEC,IAAI,EAAJA,IAAI;iBAAE,CAAC,CAAC;gBAE9CQ,MAAM,CAACT,IAAI,CAAC,CAACkB,YAAY,CAACjB,IAAI,CAAC,CAAC;gBAChCQ,MAAM,CAACV,IAAI,CAAC,CAACmB,YAAY,CAAClB,IAAI,CAAC,CAAC;;;;;;CACnC,EAAA,CAAC,CAAC", + "mappings": "AAAAA;;AAAAA,EAAE,CAAC,6DAA6D,gBAAE,0DAAA,mBAAY;QACpEC,KAAK,EACLC,IAAI,EAQJC,IAAI,EAQJC,IAAI,EAQJC,IAAI,EACJC,IAAI,EACJC,IAAI;;;;gBA3BJN,KAAK,GAAG;oBAAEO,GAAG,EAAE,WAAW;oBAAEC,CAAC,EAADA,CAAC;oBAAEC,CAAC,EAAE,EAAE;iBAAE,CAAC;;uBAC1BC,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIZ,IAAI,YAIR,CAAA;gBACFa,MAAM,CAACb,IAAI,CAACc,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACb,IAAI,CAACW,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAEzCN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIX,IAAI,YAIR,CAAA;gBACFY,MAAM,CAACZ,IAAI,CAACa,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACZ,IAAI,CAACU,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAEzCN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIV,IAAI,YAIR,CAAA;gBACFW,MAAM,CAACX,IAAI,CAACY,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACX,IAAI,CAACS,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAExCf,IAAI,CAACiB,MAAM,EAAE;;gBAA3Bd,IAAI,GAAG,UAAsBe,UAAU,CAAA;;uBACzBjB,IAAI,CAACgB,MAAM,EAAE;;gBAA3Bb,IAAI,GAAG,UAAsBc,UAAU,CAAA;;uBACzBhB,IAAI,CAACe,MAAM,EAAE;;gBAA3BZ,IAAI,GAAG,UAAsBa,UAAU,CAAA;gBAE7CC,OAAO,CAACC,GAAG,CAAC;oBAAEC,OAAO,EAAPA,OAAO;oBAAEd,CAAC,EAADA,CAAC;oBAAEJ,IAAI,EAAJA,IAAI;oBAAEC,IAAI,EAAJA,IAAI;oBAAEC,IAAI,EAAJA,IAAI;iBAAE,CAAC,CAAC;gBAE9CQ,MAAM,CAACT,IAAI,CAAC,CAACkB,YAAY,CAACjB,IAAI,CAAC,CAAC;gBAChCQ,MAAM,CAACV,IAAI,CAAC,CAACmB,YAAY,CAAClB,IAAI,CAAC,CAAC;;;;;;CACnC,EAAA,CAAC,CAAC", "names": [ "it", "query", diff --git a/crates/swc/tests/fixture/sourcemap/006/output/index.js b/crates/swc/tests/fixture/sourcemap/006/output/index.js index a76dd1cfb15..293e6eb01c9 100644 --- a/crates/swc/tests/fixture/sourcemap/006/output/index.js +++ b/crates/swc/tests/fixture/sourcemap/006/output/index.js @@ -1,6 +1,6 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -it("should compress avif smaller than webp and smaller than jpg", _async_to_generator(regeneratorRuntime.mark(function _callee() { +it("should compress avif smaller than webp and smaller than jpg", /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var query, res1, res2, res3, avif, webp, jpeg; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/fixture/sourcemap/006/output/index.map b/crates/swc/tests/fixture/sourcemap/006/output/index.map index 5257a00f2fc..ffb0098909c 100644 --- a/crates/swc/tests/fixture/sourcemap/006/output/index.map +++ b/crates/swc/tests/fixture/sourcemap/006/output/index.map @@ -1,5 +1,5 @@ { - "mappings": "AAAAA;;AAAAA,EAAE,CAAC,6DAA6D,EAAE,4CAAA,mBAAY;QAOpEC,KAAK,EACLC,IAAI,EAQJC,IAAI,EAQJC,IAAI,EAQJC,IAAI,EACJC,IAAI,EACJC,IAAI;;;;gBA3BJN,KAAK,GAAG;oBAAEO,GAAG,EAAE,WAAW;oBAAEC,CAAC,EAADA,CAAC;oBAAEC,CAAC,EAAE,EAAE;iBAAE,CAAC;;uBAC1BC,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIZ,IAAI,YAIR,CAAA;gBACFa,MAAM,CAACb,IAAI,CAACc,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACb,IAAI,CAACW,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAEzCN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIX,IAAI,YAIR,CAAA;gBACFY,MAAM,CAACZ,IAAI,CAACa,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACZ,IAAI,CAACU,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAEzCN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIV,IAAI,YAIR,CAAA;gBACFW,MAAM,CAACX,IAAI,CAACY,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACX,IAAI,CAACS,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAExCf,IAAI,CAACiB,MAAM,EAAE;;gBAA3Bd,IAAI,GAAG,UAAsBe,UAAU,CAAA;;uBACzBjB,IAAI,CAACgB,MAAM,EAAE;;gBAA3Bb,IAAI,GAAG,UAAsBc,UAAU,CAAA;;uBACzBhB,IAAI,CAACe,MAAM,EAAE;;gBAA3BZ,IAAI,GAAG,UAAsBa,UAAU,CAAA;gBAE7CC,OAAO,CAACC,GAAG,CAAC;oBAAEC,OAAO,EAAPA,OAAO;oBAAEd,CAAC,EAADA,CAAC;oBAAEJ,IAAI,EAAJA,IAAI;oBAAEC,IAAI,EAAJA,IAAI;oBAAEC,IAAI,EAAJA,IAAI;iBAAE,CAAC,CAAC;gBAE9CQ,MAAM,CAACT,IAAI,CAAC,CAACkB,YAAY,CAACjB,IAAI,CAAC,CAAC;gBAChCQ,MAAM,CAACV,IAAI,CAAC,CAACmB,YAAY,CAAClB,IAAI,CAAC,CAAC;;;;;;CACnC,EAAA,CAAC,CAAC", + "mappings": "AAAAA;;AAAAA,EAAE,CAAC,6DAA6D,gBAAE,0DAAA,mBAAY;QAOpEC,KAAK,EACLC,IAAI,EAQJC,IAAI,EAQJC,IAAI,EAQJC,IAAI,EACJC,IAAI,EACJC,IAAI;;;;gBA3BJN,KAAK,GAAG;oBAAEO,GAAG,EAAE,WAAW;oBAAEC,CAAC,EAADA,CAAC;oBAAEC,CAAC,EAAE,EAAE;iBAAE,CAAC;;uBAC1BC,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIZ,IAAI,YAIR,CAAA;gBACFa,MAAM,CAACb,IAAI,CAACc,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACb,IAAI,CAACW,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAEzCN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIX,IAAI,YAIR,CAAA;gBACFY,MAAM,CAACZ,IAAI,CAACa,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACZ,IAAI,CAACU,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAEzCN,YAAY,CAACC,OAAO,EAAE,cAAc,EAAEX,KAAK,EAAE;oBAC5DY,OAAO,EAAE;wBACLC,MAAM,EAAE,YAAY;qBACvB;iBACJ,CAAC;;gBAJIV,IAAI,YAIR,CAAA;gBACFW,MAAM,CAACX,IAAI,CAACY,MAAM,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9BF,MAAM,CAACX,IAAI,CAACS,OAAO,CAACK,GAAG,CAAC,cAAc,CAAC,CAAC,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC;;uBAExCf,IAAI,CAACiB,MAAM,EAAE;;gBAA3Bd,IAAI,GAAG,UAAsBe,UAAU,CAAA;;uBACzBjB,IAAI,CAACgB,MAAM,EAAE;;gBAA3Bb,IAAI,GAAG,UAAsBc,UAAU,CAAA;;uBACzBhB,IAAI,CAACe,MAAM,EAAE;;gBAA3BZ,IAAI,GAAG,UAAsBa,UAAU,CAAA;gBAE7CC,OAAO,CAACC,GAAG,CAAC;oBAAEC,OAAO,EAAPA,OAAO;oBAAEd,CAAC,EAADA,CAAC;oBAAEJ,IAAI,EAAJA,IAAI;oBAAEC,IAAI,EAAJA,IAAI;oBAAEC,IAAI,EAAJA,IAAI;iBAAE,CAAC,CAAC;gBAE9CQ,MAAM,CAACT,IAAI,CAAC,CAACkB,YAAY,CAACjB,IAAI,CAAC,CAAC;gBAChCQ,MAAM,CAACV,IAAI,CAAC,CAACmB,YAAY,CAAClB,IAAI,CAAC,CAAC;;;;;;CACnC,EAAA,CAAC,CAAC", "names": [ "it", "query", diff --git a/crates/swc/tests/tsc-references/FunctionDeclaration13_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/FunctionDeclaration13_es6_es5.1.normal.js index 2eac9583084..46bafa5d272 100644 --- a/crates/swc/tests/tsc-references/FunctionDeclaration13_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionDeclaration13_es6_es5.1.normal.js @@ -1,6 +1,6 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(foo); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo); function foo() { var v; return regeneratorRuntime.wrap(function foo$(_ctx) { diff --git a/crates/swc/tests/tsc-references/FunctionDeclaration1_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/FunctionDeclaration1_es6_es5.1.normal.js index f2298385423..617d437c222 100644 --- a/crates/swc/tests/tsc-references/FunctionDeclaration1_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionDeclaration1_es6_es5.1.normal.js @@ -1,6 +1,6 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(foo); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo); function foo() { return regeneratorRuntime.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/FunctionDeclaration9_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/FunctionDeclaration9_es6_es5.1.normal.js index caec14c4cf9..b9388217a18 100644 --- a/crates/swc/tests/tsc-references/FunctionDeclaration9_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionDeclaration9_es6_es5.1.normal.js @@ -1,7 +1,7 @@ // @target: es6 import _define_property from "@swc/helpers/src/_define_property.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(foo); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo); function foo() { var v; return regeneratorRuntime.wrap(function foo$(_ctx) { diff --git a/crates/swc/tests/tsc-references/FunctionExpression1_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/FunctionExpression1_es6_es5.1.normal.js index e55710bccce..ea79c1c36bc 100644 --- a/crates/swc/tests/tsc-references/FunctionExpression1_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionExpression1_es6_es5.1.normal.js @@ -1,6 +1,6 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; -var v = regeneratorRuntime.mark(function v() { +var v = /*#__PURE__*/ regeneratorRuntime.mark(function v() { return regeneratorRuntime.wrap(function v$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/FunctionExpression2_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/FunctionExpression2_es6_es5.1.normal.js index 9b97d29721c..9ff0fbc807d 100644 --- a/crates/swc/tests/tsc-references/FunctionExpression2_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionExpression2_es6_es5.1.normal.js @@ -1,6 +1,6 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; -var v = regeneratorRuntime.mark(function foo() { +var v = /*#__PURE__*/ regeneratorRuntime.mark(function foo() { return regeneratorRuntime.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/FunctionExpression2_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/FunctionExpression2_es6_es5.2.minified.js index 2028381db9c..4b227d072cd 100644 --- a/crates/swc/tests/tsc-references/FunctionExpression2_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/FunctionExpression2_es6_es5.2.minified.js @@ -1,10 +1 @@ import regeneratorRuntime from "regenerator-runtime"; -regeneratorRuntime.mark(function foo() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, foo); -}); diff --git a/crates/swc/tests/tsc-references/FunctionPropertyAssignments1_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/FunctionPropertyAssignments1_es6_es5.1.normal.js index 514a2616458..67d598a527a 100644 --- a/crates/swc/tests/tsc-references/FunctionPropertyAssignments1_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionPropertyAssignments1_es6_es5.1.normal.js @@ -1,7 +1,7 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; var v = { - foo: regeneratorRuntime.mark(function foo() { + foo: /*#__PURE__*/ regeneratorRuntime.mark(function foo() { return regeneratorRuntime.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/FunctionPropertyAssignments1_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/FunctionPropertyAssignments1_es6_es5.2.minified.js index 2028381db9c..4b227d072cd 100644 --- a/crates/swc/tests/tsc-references/FunctionPropertyAssignments1_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/FunctionPropertyAssignments1_es6_es5.2.minified.js @@ -1,10 +1 @@ import regeneratorRuntime from "regenerator-runtime"; -regeneratorRuntime.mark(function foo() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, foo); -}); diff --git a/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es5.1.normal.js index 0f060de5b52..c8a90fb5e5b 100644 --- a/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/FunctionPropertyAssignments5_es6_es5.1.normal.js @@ -1,7 +1,7 @@ // @target: es6 import _define_property from "@swc/helpers/src/_define_property.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var v = _define_property({}, foo(), regeneratorRuntime.mark(function _callee() { +var v = _define_property({}, foo(), /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/MemberFunctionDeclaration1_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/MemberFunctionDeclaration1_es6_es5.1.normal.js index df495d434fc..e4eb6f78a4c 100644 --- a/crates/swc/tests/tsc-references/MemberFunctionDeclaration1_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/MemberFunctionDeclaration1_es6_es5.1.normal.js @@ -7,7 +7,7 @@ var C = /*#__PURE__*/ function() { _class_call_check(this, C); } var _proto = C.prototype; - _proto.foo = regeneratorRuntime.mark(function foo() { + _proto.foo = /*#__PURE__*/ regeneratorRuntime.mark(function foo() { return regeneratorRuntime.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/MemberFunctionDeclaration2_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/MemberFunctionDeclaration2_es6_es5.1.normal.js index df495d434fc..e4eb6f78a4c 100644 --- a/crates/swc/tests/tsc-references/MemberFunctionDeclaration2_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/MemberFunctionDeclaration2_es6_es5.1.normal.js @@ -7,7 +7,7 @@ var C = /*#__PURE__*/ function() { _class_call_check(this, C); } var _proto = C.prototype; - _proto.foo = regeneratorRuntime.mark(function foo() { + _proto.foo = /*#__PURE__*/ regeneratorRuntime.mark(function foo() { return regeneratorRuntime.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/MemberFunctionDeclaration3_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/MemberFunctionDeclaration3_es6_es5.1.normal.js index 942c6478423..af1e2ad1845 100644 --- a/crates/swc/tests/tsc-references/MemberFunctionDeclaration3_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/MemberFunctionDeclaration3_es6_es5.1.normal.js @@ -7,7 +7,7 @@ var C = /*#__PURE__*/ function() { _class_call_check(this, C); } var _proto = C.prototype; - _proto[foo] = regeneratorRuntime.mark(function _callee() { + _proto[foo] = /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/MemberFunctionDeclaration7_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/MemberFunctionDeclaration7_es6_es5.1.normal.js index df495d434fc..e4eb6f78a4c 100644 --- a/crates/swc/tests/tsc-references/MemberFunctionDeclaration7_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/MemberFunctionDeclaration7_es6_es5.1.normal.js @@ -7,7 +7,7 @@ var C = /*#__PURE__*/ function() { _class_call_check(this, C); } var _proto = C.prototype; - _proto.foo = regeneratorRuntime.mark(function foo() { + _proto.foo = /*#__PURE__*/ regeneratorRuntime.mark(function foo() { return regeneratorRuntime.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/YieldExpression10_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/YieldExpression10_es6_es5.1.normal.js index 1f488585fd6..3b2b09bc98e 100644 --- a/crates/swc/tests/tsc-references/YieldExpression10_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/YieldExpression10_es6_es5.1.normal.js @@ -1,7 +1,7 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; var v = { - foo: regeneratorRuntime.mark(function foo1() { + foo: /*#__PURE__*/ regeneratorRuntime.mark(function foo1() { return regeneratorRuntime.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/YieldExpression10_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/YieldExpression10_es6_es5.2.minified.js index 17bdff0aabb..4b227d072cd 100644 --- a/crates/swc/tests/tsc-references/YieldExpression10_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/YieldExpression10_es6_es5.2.minified.js @@ -1,12 +1 @@ import regeneratorRuntime from "regenerator-runtime"; -regeneratorRuntime.mark(function foo1() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, foo; - case 2: - case "end": - return _ctx.stop(); - } - }, foo1); -}); diff --git a/crates/swc/tests/tsc-references/YieldExpression11_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/YieldExpression11_es6_es5.1.normal.js index b2dd16d4210..2b8dbf8d728 100644 --- a/crates/swc/tests/tsc-references/YieldExpression11_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/YieldExpression11_es6_es5.1.normal.js @@ -7,7 +7,7 @@ var C = /*#__PURE__*/ function() { _class_call_check(this, C); } var _proto = C.prototype; - _proto.foo = regeneratorRuntime.mark(function foo1() { + _proto.foo = /*#__PURE__*/ regeneratorRuntime.mark(function foo1() { return regeneratorRuntime.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/YieldExpression13_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/YieldExpression13_es6_es5.1.normal.js index cace6959912..c1f63e109dc 100644 --- a/crates/swc/tests/tsc-references/YieldExpression13_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/YieldExpression13_es6_es5.1.normal.js @@ -1,6 +1,6 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(foo); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo); function foo() { return regeneratorRuntime.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/YieldExpression19_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/YieldExpression19_es6_es5.1.normal.js index c70ff398642..cb76dcd9dbf 100644 --- a/crates/swc/tests/tsc-references/YieldExpression19_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/YieldExpression19_es6_es5.1.normal.js @@ -1,13 +1,13 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(foo); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo); function foo() { var bar; return regeneratorRuntime.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: bar = function bar() { - var _marked = regeneratorRuntime.mark(quux); + var _marked = /*#__PURE__*/ regeneratorRuntime.mark(quux); function quux() { return regeneratorRuntime.wrap(function quux$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/YieldExpression3_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/YieldExpression3_es6_es5.1.normal.js index 789070e1f9f..6f9371f50e0 100644 --- a/crates/swc/tests/tsc-references/YieldExpression3_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/YieldExpression3_es6_es5.1.normal.js @@ -1,6 +1,6 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(foo); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo); function foo() { return regeneratorRuntime.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/YieldExpression4_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/YieldExpression4_es6_es5.1.normal.js index 789070e1f9f..6f9371f50e0 100644 --- a/crates/swc/tests/tsc-references/YieldExpression4_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/YieldExpression4_es6_es5.1.normal.js @@ -1,6 +1,6 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(foo); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo); function foo() { return regeneratorRuntime.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/YieldExpression6_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/YieldExpression6_es6_es5.1.normal.js index 6649213cfbf..29b0051f1b2 100644 --- a/crates/swc/tests/tsc-references/YieldExpression6_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/YieldExpression6_es6_es5.1.normal.js @@ -1,6 +1,6 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(foo); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo); function foo() { return regeneratorRuntime.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/YieldExpression7_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/YieldExpression7_es6_es5.1.normal.js index ff1e58d1ba1..1b97724edcd 100644 --- a/crates/swc/tests/tsc-references/YieldExpression7_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/YieldExpression7_es6_es5.1.normal.js @@ -1,6 +1,6 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(foo); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(foo); function foo() { return regeneratorRuntime.wrap(function foo$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/YieldExpression9_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/YieldExpression9_es6_es5.1.normal.js index 2024fa9b5d4..26d71b46d85 100644 --- a/crates/swc/tests/tsc-references/YieldExpression9_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/YieldExpression9_es6_es5.1.normal.js @@ -1,6 +1,6 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; -var v = regeneratorRuntime.mark(function v() { +var v = /*#__PURE__*/ regeneratorRuntime.mark(function v() { return regeneratorRuntime.wrap(function v$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/YieldStarExpression4_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/YieldStarExpression4_es6_es5.1.normal.js index 612a2903b53..76b03a3c45b 100644 --- a/crates/swc/tests/tsc-references/YieldStarExpression4_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/YieldStarExpression4_es6_es5.1.normal.js @@ -1,6 +1,6 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncAliasReturnType_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAliasReturnType_es5_es5.1.normal.js index 00272749b6c..4c552cd2f36 100644 --- a/crates/swc/tests/tsc-references/asyncAliasReturnType_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAliasReturnType_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function f() { return _f.apply(this, arguments); } function _f() { - _f = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncAliasReturnType_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAliasReturnType_es6_es5.1.normal.js index 48209c735de..edad983f8cd 100644 --- a/crates/swc/tests/tsc-references/asyncAliasReturnType_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAliasReturnType_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function f() { return _f.apply(this, arguments); } function _f() { - _f = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es2015.2.minified.js index b6d3f28c0c0..20a0f20505c 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es2015.2.minified.js @@ -1,2 +1 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*() {}); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es5.1.normal.js index 397d06d56ae..de4cf0f1c10 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es5.1.normal.js @@ -3,7 +3,7 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var foo = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var v; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es5.2.minified.js index ce23cd8a321..3417dabd0f2 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction10_es2017_es5.2.minified.js @@ -1,12 +1,2 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es2015.2.minified.js index b6d3f28c0c0..20a0f20505c 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es2015.2.minified.js @@ -1,2 +1 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*() {}); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es5.1.normal.js index cfa51aa7e32..265626ae485 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es5.1.normal.js @@ -4,7 +4,7 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var foo = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var v; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es5.2.minified.js index ce23cd8a321..3417dabd0f2 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction10_es5_es5.2.minified.js @@ -1,12 +1,2 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es2015.2.minified.js index b6d3f28c0c0..20a0f20505c 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es2015.2.minified.js @@ -1,2 +1 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*() {}); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es5.1.normal.js index b51f307b2ce..6af2823b8b0 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es5.1.normal.js @@ -3,7 +3,7 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var foo = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var v; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es5.2.minified.js index ce23cd8a321..3417dabd0f2 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction10_es6_es5.2.minified.js @@ -1,12 +1,2 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es2015.1.normal.js index 9397f8d491b..ecfd5e68e28 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es2015.1.normal.js @@ -6,7 +6,7 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; class A { constructor(){ var _this = this; - this.b = _async_to_generator(function*(...args) { + this.b = /*#__PURE__*/ _async_to_generator(function*(...args) { yield Promise.resolve(); const obj = { ["a"]: ()=>_this diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es5.1.normal.js index 58168609053..dd0ff15f75c 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction11_es5_es5.1.normal.js @@ -10,7 +10,7 @@ var A = function A() { "use strict"; _class_call_check(this, A); var _this = this; - this.b = _async_to_generator(regeneratorRuntime.mark(function _callee() { + this.b = /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var _len, args, _key, obj, _args = arguments; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es2015.2.minified.js index b6d3f28c0c0..20a0f20505c 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es2015.2.minified.js @@ -1,2 +1 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*() {}); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es5.1.normal.js index b0bb965d7b2..48ba0adffe9 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es5.1.normal.js @@ -3,7 +3,7 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var foo = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es5.2.minified.js index 78d7bfcedb4..3417dabd0f2 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es2017_es5.2.minified.js @@ -1,11 +1,2 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es2015.2.minified.js index b6d3f28c0c0..20a0f20505c 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es2015.2.minified.js @@ -1,2 +1 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*() {}); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es5.1.normal.js index 5eb90b533ab..3e306f5e3f3 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es5.1.normal.js @@ -4,7 +4,7 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var foo = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es5.2.minified.js index 78d7bfcedb4..3417dabd0f2 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es5_es5.2.minified.js @@ -1,11 +1,2 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es2015.2.minified.js index b6d3f28c0c0..20a0f20505c 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es2015.2.minified.js @@ -1,2 +1 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*() {}); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es5.1.normal.js index 4adcd6b9a0f..566d319f64a 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es5.1.normal.js @@ -3,7 +3,7 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var foo = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es5.2.minified.js index 78d7bfcedb4..3417dabd0f2 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction1_es6_es5.2.minified.js @@ -1,11 +1,2 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.1.normal.js index 9944ed36cf9..ab16c118ba0 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.1.normal.js @@ -13,7 +13,7 @@ var C = /*#__PURE__*/ function() { var other = function other() {}; var _this = this, _arguments = arguments; var fn = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.2.minified.js index f642f43040d..208728c9fd8 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es2017_es5.2.minified.js @@ -3,9 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; var C = function() { "use strict"; - function C() { - _class_call_check(this, C); - } + function C() {} return C.prototype.method = function() { var other = function() {}, _this = this, _arguments = arguments; _async_to_generator(regeneratorRuntime.mark(function _callee() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.1.normal.js index b0facc82683..a2f09870e1f 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.1.normal.js @@ -14,7 +14,7 @@ var C = /*#__PURE__*/ function() { var other = function other() {}; var _this = this, _arguments = arguments; var fn = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.2.minified.js index f642f43040d..208728c9fd8 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es5_es5.2.minified.js @@ -3,9 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; var C = function() { "use strict"; - function C() { - _class_call_check(this, C); - } + function C() {} return C.prototype.method = function() { var other = function() {}, _this = this, _arguments = arguments; _async_to_generator(regeneratorRuntime.mark(function _callee() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.1.normal.js index 45b45a914ce..91c58eab116 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.1.normal.js @@ -13,7 +13,7 @@ var C = /*#__PURE__*/ function() { var other = function other() {}; var _this = this, _arguments = arguments; var fn = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.2.minified.js index f642f43040d..208728c9fd8 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesArguments_es6_es5.2.minified.js @@ -3,9 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; var C = function() { "use strict"; - function C() { - _class_call_check(this, C); - } + function C() {} return C.prototype.method = function() { var other = function() {}, _this = this, _arguments = arguments; _async_to_generator(regeneratorRuntime.mark(function _callee() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es2017_es5.1.normal.js index 737560a0309..c43c0c921f1 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es2017_es5.1.normal.js @@ -12,7 +12,7 @@ var C = /*#__PURE__*/ function() { _proto.method = function method() { var _this = this; var fn = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es2017_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es2017_es5.2.minified.js index 0c8429a3f87..836691acbab 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es2017_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es2017_es5.2.minified.js @@ -3,9 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; var C = function() { "use strict"; - function C() { - _class_call_check(this, C); - } + function C() {} return C.prototype.method = function() { var _this = this; _async_to_generator(regeneratorRuntime.mark(function _callee() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es5_es5.1.normal.js index de0257f9bd9..bdddf828a67 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es5_es5.1.normal.js @@ -13,7 +13,7 @@ var C = /*#__PURE__*/ function() { _proto.method = function method() { var _this = this; var fn = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es5_es5.2.minified.js index 0c8429a3f87..836691acbab 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es5_es5.2.minified.js @@ -3,9 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; var C = function() { "use strict"; - function C() { - _class_call_check(this, C); - } + function C() {} return C.prototype.method = function() { var _this = this; _async_to_generator(regeneratorRuntime.mark(function _callee() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es6_es5.1.normal.js index 148e97b5a63..79492ffae54 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es6_es5.1.normal.js @@ -12,7 +12,7 @@ var C = /*#__PURE__*/ function() { _proto.method = function method() { var _this = this; var fn = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es6_es5.2.minified.js index 0c8429a3f87..836691acbab 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunctionCapturesThis_es6_es5.2.minified.js @@ -3,9 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; var C = function() { "use strict"; - function C() { - _class_call_check(this, C); - } + function C() {} return C.prototype.method = function() { var _this = this; _async_to_generator(regeneratorRuntime.mark(function _callee() { diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es2015.1.normal.js index 00410f92527..83bf30de58e 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es2015.1.normal.js @@ -26,6 +26,6 @@ const a = ()=>0; }(); /** @type {function(function(): string): void} */ const f = (p)=>{}; // Error (good) -f(_async_to_generator(function*() { +f(/*#__PURE__*/ _async_to_generator(function*() { return 0; })); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es2015.2.minified.js index e94f0a07fdb..20a0f20505c 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es2015.2.minified.js @@ -1,8 +1 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*() { - return 0; -}), _async_to_generator(function*() { - return 0; -}), _async_to_generator(function*() { - return 0; -}); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es5.1.normal.js index 873312cdbf8..4eef2abc32c 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es5.1.normal.js @@ -11,7 +11,7 @@ var a = function() { }; // Error (good) /** @type {function(): string} */ var b = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -28,7 +28,7 @@ var a = function() { }(); // No error (bad) /** @type {function(): string} */ var c = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -45,7 +45,7 @@ var a = function() { }(); /** @type {function(function(): string): void} */ var f = function(p) {}; // Error (good) -f(_async_to_generator(regeneratorRuntime.mark(function _callee() { +f(/*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es5.2.minified.js index 1a6cc85d300..3417dabd0f2 100644 --- a/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncArrowFunction_allowJs_es5.2.minified.js @@ -1,33 +1,2 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", 0); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", 0); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", 0); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es2015.2.minified.js index cd60b4ff8c3..a3dc2c6ecbe 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es2015.2.minified.js @@ -1,18 +1,3 @@ var M; import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() { - return p; -}), _async_to_generator(function*() { - return mp; -}), _async_to_generator(function*() { - return mp; -}), _async_to_generator(function*() { - return p; -}), function(M) { - function _f1() { - return (_f1 = _async_to_generator(function*() {})).apply(this, arguments); - } - M.f1 = function() { - return _f1.apply(this, arguments); - }; -}(M || (M = {})); +M || (M = {}); diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.1.normal.js index e4b32b4f0ad..6ad9eee03e7 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.1.normal.js @@ -7,7 +7,7 @@ function f0() { return _f0.apply(this, arguments); } function _f0() { - _f0 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f0 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -22,7 +22,7 @@ function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -37,7 +37,7 @@ function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f3 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -49,7 +49,7 @@ function _f3() { return _f3.apply(this, arguments); } var f4 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -63,7 +63,7 @@ var f4 = function() { }; }(); var f5 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -77,7 +77,7 @@ var f5 = function() { }; }(); var f6 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -91,7 +91,7 @@ var f6 = function() { }; }(); var f7 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -105,7 +105,7 @@ var f7 = function() { }; }(); var f8 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -119,7 +119,7 @@ var f8 = function() { }; }(); var f9 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -133,7 +133,7 @@ var f9 = function() { }; }(); var f10 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -149,7 +149,7 @@ var f10 = function() { }; }(); var f11 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -165,7 +165,7 @@ var f11 = function() { }; }(); var f12 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -181,7 +181,7 @@ var f12 = function() { }; }(); var f13 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -198,7 +198,7 @@ var f13 = function() { }(); var o = { m1: function m1() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -209,7 +209,7 @@ var o = { }))(); }, m2: function m2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -220,7 +220,7 @@ var o = { }))(); }, m3: function m3() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -238,7 +238,7 @@ var C = /*#__PURE__*/ function() { } var _proto = C.prototype; _proto.m1 = function m1() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -249,7 +249,7 @@ var C = /*#__PURE__*/ function() { }))(); }; _proto.m2 = function m2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -260,7 +260,7 @@ var C = /*#__PURE__*/ function() { }))(); }; _proto.m3 = function m3() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -271,7 +271,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m4 = function m4() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -282,7 +282,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m5 = function m5() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -293,7 +293,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m6 = function m6() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -311,7 +311,7 @@ var M; return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.2.minified.js index 1287cc776bf..d497dea55b8 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es2017_es5.2.minified.js @@ -1,100 +1,9 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", p); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", mp); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", mp); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", p); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); var M, C = function() { "use strict"; - function C() { - _class_call_check(this, C); - } + function C() {} var _proto = C.prototype; return _proto.m1 = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { @@ -158,19 +67,4 @@ var M, C = function() { }))(); }, C; }(); -!function(M) { - function _f1() { - return (_f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); - }))).apply(this, arguments); - } - M.f1 = function() { - return _f1.apply(this, arguments); - }; -}(M || (M = {})); +M || (M = {}); diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es2015.2.minified.js index cd60b4ff8c3..a3dc2c6ecbe 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es2015.2.minified.js @@ -1,18 +1,3 @@ var M; import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() { - return p; -}), _async_to_generator(function*() { - return mp; -}), _async_to_generator(function*() { - return mp; -}), _async_to_generator(function*() { - return p; -}), function(M) { - function _f1() { - return (_f1 = _async_to_generator(function*() {})).apply(this, arguments); - } - M.f1 = function() { - return _f1.apply(this, arguments); - }; -}(M || (M = {})); +M || (M = {}); diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.1.normal.js index 39caea1ae89..203cf62fa22 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.1.normal.js @@ -8,7 +8,7 @@ function f0() { return _f0.apply(this, arguments); } function _f0() { - _f0 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f0 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -23,7 +23,7 @@ function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -38,7 +38,7 @@ function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f3 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -50,7 +50,7 @@ function _f3() { return _f3.apply(this, arguments); } var f4 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -64,7 +64,7 @@ var f4 = function() { }; }(); var f5 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -78,7 +78,7 @@ var f5 = function() { }; }(); var f6 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -92,7 +92,7 @@ var f6 = function() { }; }(); var f7 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -106,7 +106,7 @@ var f7 = function() { }; }(); var f8 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -120,7 +120,7 @@ var f8 = function() { }; }(); var f9 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -134,7 +134,7 @@ var f9 = function() { }; }(); var f10 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -150,7 +150,7 @@ var f10 = function() { }; }(); var f11 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -166,7 +166,7 @@ var f11 = function() { }; }(); var f12 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -182,7 +182,7 @@ var f12 = function() { }; }(); var f13 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -199,7 +199,7 @@ var f13 = function() { }(); var o = { m1: function m1() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -210,7 +210,7 @@ var o = { }))(); }, m2: function m2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -221,7 +221,7 @@ var o = { }))(); }, m3: function m3() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -239,7 +239,7 @@ var C = /*#__PURE__*/ function() { } var _proto = C.prototype; _proto.m1 = function m1() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -250,7 +250,7 @@ var C = /*#__PURE__*/ function() { }))(); }; _proto.m2 = function m2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -261,7 +261,7 @@ var C = /*#__PURE__*/ function() { }))(); }; _proto.m3 = function m3() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -272,7 +272,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m4 = function m4() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -283,7 +283,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m5 = function m5() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -294,7 +294,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m6 = function m6() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -312,7 +312,7 @@ var M; return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.2.minified.js index 1287cc776bf..d497dea55b8 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es5_es5.2.minified.js @@ -1,100 +1,9 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", p); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", mp); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", mp); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", p); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); var M, C = function() { "use strict"; - function C() { - _class_call_check(this, C); - } + function C() {} var _proto = C.prototype; return _proto.m1 = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { @@ -158,19 +67,4 @@ var M, C = function() { }))(); }, C; }(); -!function(M) { - function _f1() { - return (_f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); - }))).apply(this, arguments); - } - M.f1 = function() { - return _f1.apply(this, arguments); - }; -}(M || (M = {})); +M || (M = {}); diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es2015.2.minified.js index cd60b4ff8c3..a3dc2c6ecbe 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es2015.2.minified.js @@ -1,18 +1,3 @@ var M; import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() { - return p; -}), _async_to_generator(function*() { - return mp; -}), _async_to_generator(function*() { - return mp; -}), _async_to_generator(function*() { - return p; -}), function(M) { - function _f1() { - return (_f1 = _async_to_generator(function*() {})).apply(this, arguments); - } - M.f1 = function() { - return _f1.apply(this, arguments); - }; -}(M || (M = {})); +M || (M = {}); diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.1.normal.js index f8f0328aad5..8c2b60e83f4 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.1.normal.js @@ -7,7 +7,7 @@ function f0() { return _f0.apply(this, arguments); } function _f0() { - _f0 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f0 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -22,7 +22,7 @@ function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -37,7 +37,7 @@ function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f3 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -49,7 +49,7 @@ function _f3() { return _f3.apply(this, arguments); } var f4 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -63,7 +63,7 @@ var f4 = function() { }; }(); var f5 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -77,7 +77,7 @@ var f5 = function() { }; }(); var f6 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -91,7 +91,7 @@ var f6 = function() { }; }(); var f7 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -105,7 +105,7 @@ var f7 = function() { }; }(); var f8 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -119,7 +119,7 @@ var f8 = function() { }; }(); var f9 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -133,7 +133,7 @@ var f9 = function() { }; }(); var f10 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -149,7 +149,7 @@ var f10 = function() { }; }(); var f11 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -165,7 +165,7 @@ var f11 = function() { }; }(); var f12 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -181,7 +181,7 @@ var f12 = function() { }; }(); var f13 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -198,7 +198,7 @@ var f13 = function() { }(); var o = { m1: function m1() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -209,7 +209,7 @@ var o = { }))(); }, m2: function m2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -220,7 +220,7 @@ var o = { }))(); }, m3: function m3() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -238,7 +238,7 @@ var C = /*#__PURE__*/ function() { } var _proto = C.prototype; _proto.m1 = function m1() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -249,7 +249,7 @@ var C = /*#__PURE__*/ function() { }))(); }; _proto.m2 = function m2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -260,7 +260,7 @@ var C = /*#__PURE__*/ function() { }))(); }; _proto.m3 = function m3() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -271,7 +271,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m4 = function m4() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -282,7 +282,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m5 = function m5() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -293,7 +293,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m6 = function m6() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -311,7 +311,7 @@ var M; return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.2.minified.js index 1287cc776bf..d497dea55b8 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwaitIsolatedModules_es6_es5.2.minified.js @@ -1,100 +1,9 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", p); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", mp); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", mp); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", p); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); var M, C = function() { "use strict"; - function C() { - _class_call_check(this, C); - } + function C() {} var _proto = C.prototype; return _proto.m1 = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { @@ -158,19 +67,4 @@ var M, C = function() { }))(); }, C; }(); -!function(M) { - function _f1() { - return (_f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); - }))).apply(this, arguments); - } - M.f1 = function() { - return _f1.apply(this, arguments); - }; -}(M || (M = {})); +M || (M = {}); diff --git a/crates/swc/tests/tsc-references/asyncAwaitNestedClasses_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAwaitNestedClasses_es5_es5.1.normal.js index 424fdc88644..a4e27fb9f77 100644 --- a/crates/swc/tests/tsc-references/asyncAwaitNestedClasses_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwaitNestedClasses_es5_es5.1.normal.js @@ -27,7 +27,7 @@ A.B = (_B = /*#__PURE__*/ function() { _class_call_check(this, C); } C.func = function func() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncAwait_es2017_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncAwait_es2017_es2015.2.minified.js index cd60b4ff8c3..a3dc2c6ecbe 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es2017_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es2017_es2015.2.minified.js @@ -1,18 +1,3 @@ var M; import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() { - return p; -}), _async_to_generator(function*() { - return mp; -}), _async_to_generator(function*() { - return mp; -}), _async_to_generator(function*() { - return p; -}), function(M) { - function _f1() { - return (_f1 = _async_to_generator(function*() {})).apply(this, arguments); - } - M.f1 = function() { - return _f1.apply(this, arguments); - }; -}(M || (M = {})); +M || (M = {}); diff --git a/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.1.normal.js index e8bcae25b39..554cc0bedd1 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function f0() { return _f0.apply(this, arguments); } function _f0() { - _f0 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f0 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -21,7 +21,7 @@ function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -36,7 +36,7 @@ function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f3 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -48,7 +48,7 @@ function _f3() { return _f3.apply(this, arguments); } var f4 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -62,7 +62,7 @@ var f4 = function() { }; }(); var f5 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -76,7 +76,7 @@ var f5 = function() { }; }(); var f6 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -90,7 +90,7 @@ var f6 = function() { }; }(); var f7 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -104,7 +104,7 @@ var f7 = function() { }; }(); var f8 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -118,7 +118,7 @@ var f8 = function() { }; }(); var f9 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -132,7 +132,7 @@ var f9 = function() { }; }(); var f10 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -148,7 +148,7 @@ var f10 = function() { }; }(); var f11 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -164,7 +164,7 @@ var f11 = function() { }; }(); var f12 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -180,7 +180,7 @@ var f12 = function() { }; }(); var f13 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -197,7 +197,7 @@ var f13 = function() { }(); var o = { m1: function m1() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -208,7 +208,7 @@ var o = { }))(); }, m2: function m2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -219,7 +219,7 @@ var o = { }))(); }, m3: function m3() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -237,7 +237,7 @@ var C = /*#__PURE__*/ function() { } var _proto = C.prototype; _proto.m1 = function m1() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -248,7 +248,7 @@ var C = /*#__PURE__*/ function() { }))(); }; _proto.m2 = function m2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -259,7 +259,7 @@ var C = /*#__PURE__*/ function() { }))(); }; _proto.m3 = function m3() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -270,7 +270,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m4 = function m4() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -281,7 +281,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m5 = function m5() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -292,7 +292,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m6 = function m6() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -310,7 +310,7 @@ var M; return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -327,7 +327,7 @@ function f14() { return _f14.apply(this, arguments); } function _f14() { - _f14 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f14 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.2.minified.js index 1287cc776bf..d497dea55b8 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es2017_es5.2.minified.js @@ -1,100 +1,9 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", p); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", mp); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", mp); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", p); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); var M, C = function() { "use strict"; - function C() { - _class_call_check(this, C); - } + function C() {} var _proto = C.prototype; return _proto.m1 = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { @@ -158,19 +67,4 @@ var M, C = function() { }))(); }, C; }(); -!function(M) { - function _f1() { - return (_f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); - }))).apply(this, arguments); - } - M.f1 = function() { - return _f1.apply(this, arguments); - }; -}(M || (M = {})); +M || (M = {}); diff --git a/crates/swc/tests/tsc-references/asyncAwait_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncAwait_es5_es2015.2.minified.js index cd60b4ff8c3..a3dc2c6ecbe 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es5_es2015.2.minified.js @@ -1,18 +1,3 @@ var M; import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() { - return p; -}), _async_to_generator(function*() { - return mp; -}), _async_to_generator(function*() { - return mp; -}), _async_to_generator(function*() { - return p; -}), function(M) { - function _f1() { - return (_f1 = _async_to_generator(function*() {})).apply(this, arguments); - } - M.f1 = function() { - return _f1.apply(this, arguments); - }; -}(M || (M = {})); +M || (M = {}); diff --git a/crates/swc/tests/tsc-references/asyncAwait_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAwait_es5_es5.1.normal.js index 1129ce8b7fb..2cf1b73d2e6 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function f0() { return _f0.apply(this, arguments); } function _f0() { - _f0 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f0 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -22,7 +22,7 @@ function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -37,7 +37,7 @@ function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f3 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -49,7 +49,7 @@ function _f3() { return _f3.apply(this, arguments); } var f4 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -63,7 +63,7 @@ var f4 = function() { }; }(); var f5 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -77,7 +77,7 @@ var f5 = function() { }; }(); var f6 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -91,7 +91,7 @@ var f6 = function() { }; }(); var f7 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -105,7 +105,7 @@ var f7 = function() { }; }(); var f8 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -119,7 +119,7 @@ var f8 = function() { }; }(); var f9 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -133,7 +133,7 @@ var f9 = function() { }; }(); var f10 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -149,7 +149,7 @@ var f10 = function() { }; }(); var f11 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -165,7 +165,7 @@ var f11 = function() { }; }(); var f12 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -181,7 +181,7 @@ var f12 = function() { }; }(); var f13 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -198,7 +198,7 @@ var f13 = function() { }(); var o = { m1: function m1() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -209,7 +209,7 @@ var o = { }))(); }, m2: function m2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -220,7 +220,7 @@ var o = { }))(); }, m3: function m3() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -238,7 +238,7 @@ var C = /*#__PURE__*/ function() { } var _proto = C.prototype; _proto.m1 = function m1() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -249,7 +249,7 @@ var C = /*#__PURE__*/ function() { }))(); }; _proto.m2 = function m2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -260,7 +260,7 @@ var C = /*#__PURE__*/ function() { }))(); }; _proto.m3 = function m3() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -271,7 +271,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m4 = function m4() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -282,7 +282,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m5 = function m5() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -293,7 +293,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m6 = function m6() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -311,7 +311,7 @@ var M; return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -328,7 +328,7 @@ function f14() { return _f14.apply(this, arguments); } function _f14() { - _f14 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f14 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncAwait_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncAwait_es5_es5.2.minified.js index 1287cc776bf..d497dea55b8 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es5_es5.2.minified.js @@ -1,100 +1,9 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", p); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", mp); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", mp); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", p); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); var M, C = function() { "use strict"; - function C() { - _class_call_check(this, C); - } + function C() {} var _proto = C.prototype; return _proto.m1 = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { @@ -158,19 +67,4 @@ var M, C = function() { }))(); }, C; }(); -!function(M) { - function _f1() { - return (_f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); - }))).apply(this, arguments); - } - M.f1 = function() { - return _f1.apply(this, arguments); - }; -}(M || (M = {})); +M || (M = {}); diff --git a/crates/swc/tests/tsc-references/asyncAwait_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncAwait_es6_es2015.2.minified.js index cd60b4ff8c3..a3dc2c6ecbe 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es6_es2015.2.minified.js @@ -1,18 +1,3 @@ var M; import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() {}), _async_to_generator(function*() { - return p; -}), _async_to_generator(function*() { - return mp; -}), _async_to_generator(function*() { - return mp; -}), _async_to_generator(function*() { - return p; -}), function(M) { - function _f1() { - return (_f1 = _async_to_generator(function*() {})).apply(this, arguments); - } - M.f1 = function() { - return _f1.apply(this, arguments); - }; -}(M || (M = {})); +M || (M = {}); diff --git a/crates/swc/tests/tsc-references/asyncAwait_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncAwait_es6_es5.1.normal.js index 5d132b9b98d..e43ea20288d 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function f0() { return _f0.apply(this, arguments); } function _f0() { - _f0 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f0 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -21,7 +21,7 @@ function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -36,7 +36,7 @@ function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f3 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -48,7 +48,7 @@ function _f3() { return _f3.apply(this, arguments); } var f4 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -62,7 +62,7 @@ var f4 = function() { }; }(); var f5 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -76,7 +76,7 @@ var f5 = function() { }; }(); var f6 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -90,7 +90,7 @@ var f6 = function() { }; }(); var f7 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -104,7 +104,7 @@ var f7 = function() { }; }(); var f8 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -118,7 +118,7 @@ var f8 = function() { }; }(); var f9 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -132,7 +132,7 @@ var f9 = function() { }; }(); var f10 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -148,7 +148,7 @@ var f10 = function() { }; }(); var f11 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -164,7 +164,7 @@ var f11 = function() { }; }(); var f12 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -180,7 +180,7 @@ var f12 = function() { }; }(); var f13 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -197,7 +197,7 @@ var f13 = function() { }(); var o = { m1: function m1() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -208,7 +208,7 @@ var o = { }))(); }, m2: function m2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -219,7 +219,7 @@ var o = { }))(); }, m3: function m3() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -237,7 +237,7 @@ var C = /*#__PURE__*/ function() { } var _proto = C.prototype; _proto.m1 = function m1() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -248,7 +248,7 @@ var C = /*#__PURE__*/ function() { }))(); }; _proto.m2 = function m2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -259,7 +259,7 @@ var C = /*#__PURE__*/ function() { }))(); }; _proto.m3 = function m3() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -270,7 +270,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m4 = function m4() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -281,7 +281,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m5 = function m5() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -292,7 +292,7 @@ var C = /*#__PURE__*/ function() { }))(); }; C.m6 = function m6() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -310,7 +310,7 @@ var M; return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -327,7 +327,7 @@ function f14() { return _f14.apply(this, arguments); } function _f14() { - _f14 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f14 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncAwait_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncAwait_es6_es5.2.minified.js index 1287cc776bf..d497dea55b8 100644 --- a/crates/swc/tests/tsc-references/asyncAwait_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncAwait_es6_es5.2.minified.js @@ -1,100 +1,9 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", p); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", mp); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", mp); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", p); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); var M, C = function() { "use strict"; - function C() { - _class_call_check(this, C); - } + function C() {} var _proto = C.prototype; return _proto.m1 = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { @@ -158,19 +67,4 @@ var M, C = function() { }))(); }, C; }(); -!function(M) { - function _f1() { - return (_f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); - }))).apply(this, arguments); - } - M.f1 = function() { - return _f1.apply(this, arguments); - }; -}(M || (M = {})); +M || (M = {}); diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es2017_es5.1.normal.js index e0f17292b76..522b59abe48 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function _await() { return _await1.apply(this, arguments); } function _await1() { - _await1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _await1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es5_es5.1.normal.js index 8b4f35d8543..5fab31a1a5f 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function _await() { return _await1.apply(this, arguments); } function _await1() { - _await1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _await1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es6_es5.1.normal.js index 643f46e77c3..5b66e7d6e48 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration11_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function _await() { return _await1.apply(this, arguments); } function _await1() { - _await1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _await1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es2017_es5.1.normal.js index 56db760f204..78f3528aadd 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var v; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es5_es5.1.normal.js index d3b42b017f1..1faae05d49a 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var v; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es6_es5.1.normal.js index 5f9c4380f7f..f90b08f20cf 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration13_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var v; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es2017_es5.1.normal.js index 93dd8891ad7..4dac6b9317d 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es5_es5.1.normal.js index 53370107a2d..a8daddbe896 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es6_es5.1.normal.js index c03d9215966..039d46f483b 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration14_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es2017_es5.1.normal.js index 7ca3c806811..6f7db72324d 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es5_es5.1.normal.js index fa2136d588e..526abcec384 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es6_es5.1.normal.js index 6026d1cb497..e5eec66c2e0 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclaration1_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es5.1.normal.js index a0a7370adc4..08a1f3752dd 100644 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncFunctionDeclarationCapturesArguments_es5_es5.1.normal.js @@ -16,7 +16,7 @@ var C = /*#__PURE__*/ function() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var _args = arguments; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncImportedPromise_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncImportedPromise_es5_es5.1.normal.js index 19ca79d0bf7..4e317692d4b 100644 --- a/crates/swc/tests/tsc-references/asyncImportedPromise_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncImportedPromise_es5_es5.1.normal.js @@ -27,7 +27,7 @@ var Test = /*#__PURE__*/ function() { } var _proto = Test.prototype; _proto.example = function example() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncImportedPromise_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncImportedPromise_es6_es5.1.normal.js index 16f94ef8d7f..0da26a44a33 100644 --- a/crates/swc/tests/tsc-references/asyncImportedPromise_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncImportedPromise_es6_es5.1.normal.js @@ -26,7 +26,7 @@ var Test = /*#__PURE__*/ function() { } var _proto = Test.prototype; _proto.example = function example() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es5.1.normal.js index 3edba9a933f..ce22a08d733 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuperConflict_es6_es5.1.normal.js @@ -39,7 +39,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_get = function(_prop) { return _get(_get_prototype_of(B.prototype), _prop, _this); }; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var _super, _superIndex, a, b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -74,7 +74,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_set = function(_prop, _value) { return _set(_get_prototype_of(B.prototype), _prop, _value, _this, true); }; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var _super, _superIndex, f, a, b, ref, ref1; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es5.1.normal.js index 65cd8da2711..dfbc5ad6f4b 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es2017_es5.1.normal.js @@ -40,7 +40,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_get = function(_prop) { return _get(_get_prototype_of(B.prototype), _prop, _this); }; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var a, b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -73,7 +73,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_set = function(_prop, _value) { return _set(_get_prototype_of(B.prototype), _prop, _value, _this, true); }; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var f, a, b, ref, ref1; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es5.1.normal.js index 28a297b7143..8171e52a9e8 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5_es5.1.normal.js @@ -41,7 +41,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_get = function(_prop) { return _get(_get_prototype_of(B.prototype), _prop, _this); }; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var a, b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -74,7 +74,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_set = function(_prop, _value) { return _set(_get_prototype_of(B.prototype), _prop, _value, _this, true); }; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var f, a, b, ref, ref1; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es2015.1.normal.js index b2ffde5f6dc..57e61e82010 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es2015.1.normal.js @@ -53,11 +53,11 @@ class B extends A { (()=>_superprop_get_x().call(_this)); // element access in arrow (()=>_superprop_get("x").call(_this)); - // property access in async arrow + /*#__PURE__*/ // property access in async arrow _async_to_generator(function*() { return _superprop_get_x().call(_this); }); - // element access in async arrow + /*#__PURE__*/ // element access in async arrow _async_to_generator(function*() { return _superprop_get("x").call(_this); }); @@ -72,7 +72,7 @@ class B extends A { const a = _superprop_get_x(); // property access in arrow (()=>_superprop_get_x().call(_this)); - // property access in async arrow + /*#__PURE__*/ // property access in async arrow _async_to_generator(function*() { return _superprop_get_x().call(_this); }); @@ -90,7 +90,7 @@ class B extends A { }); // property access (assign) in arrow (()=>_superprop_set_x(f)); - // property access (assign) in async arrow + /*#__PURE__*/ // property access (assign) in async arrow _async_to_generator(function*() { return _superprop_set_x(f); }); @@ -105,7 +105,7 @@ class B extends A { const a = _superprop_get("x"); // element access in arrow (()=>_superprop_get("x").call(_this)); - // element access in async arrow + /*#__PURE__*/ // element access in async arrow _async_to_generator(function*() { return _superprop_get("x").call(_this); }); @@ -123,7 +123,7 @@ class B extends A { }); // element access (assign) in arrow (()=>_superprop_set("x", f)); - // element access (assign) in async arrow + /*#__PURE__*/ // element access (assign) in async arrow _async_to_generator(function*() { return _superprop_set("x", f); }); @@ -138,7 +138,7 @@ class B extends A { const a = _superprop_get_x(); // property access in arrow (()=>_superprop_get_x().call(_this)); - // property access in async arrow + /*#__PURE__*/ // property access in async arrow _async_to_generator(function*() { return _superprop_get_x().call(_this); }); @@ -156,7 +156,7 @@ class B extends A { }); // property access (assign) in arrow (()=>_superprop_set_x(f)); - // property access (assign) in async arrow + /*#__PURE__*/ // property access (assign) in async arrow _async_to_generator(function*() { return _superprop_set_x(f); }); @@ -171,7 +171,7 @@ class B extends A { const a = _superprop_get("x"); // element access in arrow (()=>_superprop_get("x").call(_this)); - // element access in async arrow + /*#__PURE__*/ // element access in async arrow _async_to_generator(function*() { return _superprop_get("x").call(_this); }); @@ -189,7 +189,7 @@ class B extends A { }); // element access (assign) in arrow (()=>_superprop_set("x", f)); - // element access (assign) in async arrow + /*#__PURE__*/ // element access (assign) in async arrow _async_to_generator(function*() { return _superprop_set("x", f); }); diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.1.normal.js index 991240ab58b..9a4d4649b7e 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.1.normal.js @@ -42,7 +42,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_get = function(_prop) { return _get(_get_prototype_of(B.prototype), _prop, _this); }; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var a, b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -75,7 +75,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_set = function(_prop, _value) { return _set(_get_prototype_of(B.prototype), _prop, _value, _this, true); }; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var f, a, b, ref, ref1; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -105,8 +105,8 @@ var B = /*#__PURE__*/ function(A) { (function() { return _superprop_get("x").call(_this1); }); - // property access in async arrow - _async_to_generator(regeneratorRuntime.mark(function _callee() { + /*#__PURE__*/ // property access in async arrow + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -117,8 +117,8 @@ var B = /*#__PURE__*/ function(A) { } }, _callee); })); - // element access in async arrow - _async_to_generator(regeneratorRuntime.mark(function _callee() { + /*#__PURE__*/ // element access in async arrow + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -142,7 +142,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_get_x = function() { return _get(_get_prototype_of(B.prototype), "x", _this); }; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var a; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -153,8 +153,8 @@ var B = /*#__PURE__*/ function(A) { (function() { return _superprop_get_x().call(_this1); }); - // property access in async arrow - _async_to_generator(regeneratorRuntime.mark(function _callee() { + /*#__PURE__*/ // property access in async arrow + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -180,7 +180,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_set_x = function(_value) { return _set(_get_prototype_of(B.prototype), "x", _value, _this, true); }; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var f, ref; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -196,8 +196,8 @@ var B = /*#__PURE__*/ function(A) { (function() { return _superprop_set_x(f); }); - // property access (assign) in async arrow - _async_to_generator(regeneratorRuntime.mark(function _callee() { + /*#__PURE__*/ // property access (assign) in async arrow + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -221,7 +221,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_get = function(_prop) { return _get(_get_prototype_of(B.prototype), _prop, _this); }; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var a; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -232,8 +232,8 @@ var B = /*#__PURE__*/ function(A) { (function() { return _superprop_get("x").call(_this1); }); - // element access in async arrow - _async_to_generator(regeneratorRuntime.mark(function _callee() { + /*#__PURE__*/ // element access in async arrow + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -259,7 +259,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_set = function(_prop, _value) { return _set(_get_prototype_of(B.prototype), _prop, _value, _this, true); }; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var f, ref; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -275,8 +275,8 @@ var B = /*#__PURE__*/ function(A) { (function() { return _superprop_set("x", f); }); - // element access (assign) in async arrow - _async_to_generator(regeneratorRuntime.mark(function _callee() { + /*#__PURE__*/ // element access (assign) in async arrow + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -300,7 +300,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_get_x = function() { return _get(_get_prototype_of(B.prototype), "x", _this); }; - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var a; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -311,8 +311,8 @@ var B = /*#__PURE__*/ function(A) { (function() { return _superprop_get_x().call(_this1); }); - // property access in async arrow - _async_to_generator(regeneratorRuntime.mark(function _callee() { + /*#__PURE__*/ // property access in async arrow + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -338,7 +338,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_set_x = function(_value) { return _set(_get_prototype_of(B.prototype), "x", _value, _this, true); }; - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var f, ref; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -354,8 +354,8 @@ var B = /*#__PURE__*/ function(A) { (function() { return _superprop_set_x(f); }); - // property access (assign) in async arrow - _async_to_generator(regeneratorRuntime.mark(function _callee() { + /*#__PURE__*/ // property access (assign) in async arrow + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -379,7 +379,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_get = function(_prop) { return _get(_get_prototype_of(B.prototype), _prop, _this); }; - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var a; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -390,8 +390,8 @@ var B = /*#__PURE__*/ function(A) { (function() { return _superprop_get("x").call(_this1); }); - // element access in async arrow - _async_to_generator(regeneratorRuntime.mark(function _callee() { + /*#__PURE__*/ // element access in async arrow + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -417,7 +417,7 @@ var B = /*#__PURE__*/ function(A) { _superprop_set = function(_prop, _value) { return _set(_get_prototype_of(B.prototype), _prop, _value, _this, true); }; - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var f, ref; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -433,8 +433,8 @@ var B = /*#__PURE__*/ function(A) { (function() { return _superprop_set("x", f); }); - // element access (assign) in async arrow - _async_to_generator(regeneratorRuntime.mark(function _callee() { + /*#__PURE__*/ // element access (assign) in async arrow + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.2.minified.js index 602a0a1025d..8307b0caf55 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6_es5.2.minified.js @@ -56,27 +56,7 @@ var A = function() { f: f }, _superprop_get_x() = ref.f, ref1 = { f: f - }, _superprop_get("x") = ref1.f, _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", _superprop_get_x().call(_this1)); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); - })), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", _superprop_get("x").call(_this1)); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); - })); + }, _superprop_get("x") = ref1.f; case 15: case "end": return _ctx.stop(); @@ -92,17 +72,7 @@ var A = function() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - _superprop_get_x().call(_this1), a = _superprop_get_x(), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", _superprop_get_x().call(_this1)); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); - })); + _superprop_get_x().call(_this1), a = _superprop_get_x(); case 4: case "end": return _ctx.stop(); @@ -112,27 +82,16 @@ var A = function() { }, _proto.property_access_only_write_only = function() { var _this = this, _superprop_get_x = function() { return _get(_get_prototype_of(B.prototype), "x", _this); - }, _superprop_set_x = function(_value) { - return _set(_get_prototype_of(B.prototype), "x", _value, _this, !0); }; return _async_to_generator(regeneratorRuntime.mark(function _callee() { var f, ref; return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - _superprop_set_x(f = function() {}), ref = { + var _value; + _value = f = function() {}, _set(_get_prototype_of(B.prototype), "x", _value, _this, !0), ref = { f: f - }, _superprop_get_x() = ref.f, _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", _superprop_set_x(f)); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); - })); + }, _superprop_get_x() = ref.f; case 6: case "end": return _ctx.stop(); @@ -148,17 +107,7 @@ var A = function() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - _superprop_get("x").call(_this1), a = _superprop_get("x"), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", _superprop_get("x").call(_this1)); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); - })); + _superprop_get("x").call(_this1), a = _superprop_get("x"); case 4: case "end": return _ctx.stop(); @@ -168,27 +117,16 @@ var A = function() { }, _proto.element_access_only_write_only = function() { var _this = this, _superprop_get = function(_prop) { return _get(_get_prototype_of(B.prototype), _prop, _this); - }, _superprop_set = function(_prop, _value) { - return _set(_get_prototype_of(B.prototype), _prop, _value, _this, !0); }; return _async_to_generator(regeneratorRuntime.mark(function _callee() { var f, ref; return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - _superprop_set("x", f = function() {}), ref = { + var _value; + _value = f = function() {}, _set(_get_prototype_of(B.prototype), "x", _value, _this, !0), ref = { f: f - }, _superprop_get("x") = ref.f, _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", _superprop_set("x", f)); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); - })); + }, _superprop_get("x") = ref.f; case 6: case "end": return _ctx.stop(); @@ -204,17 +142,7 @@ var A = function() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - _superprop_get_x().call(_this1), a = _superprop_get_x(), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", _superprop_get_x().call(_this1)); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); - })); + _superprop_get_x().call(_this1), a = _superprop_get_x(); case 4: case "end": return _ctx.stop(); @@ -224,27 +152,16 @@ var A = function() { }, _proto.property_access_only_write_only_in_generator = function() { var _this = this, _superprop_get_x = function() { return _get(_get_prototype_of(B.prototype), "x", _this); - }, _superprop_set_x = function(_value) { - return _set(_get_prototype_of(B.prototype), "x", _value, _this, !0); }; return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { var f, ref; return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - _superprop_set_x(f = function() {}), ref = { + var _value; + _value = f = function() {}, _set(_get_prototype_of(B.prototype), "x", _value, _this, !0), ref = { f: f - }, _superprop_get_x() = ref.f, _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", _superprop_set_x(f)); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); - })); + }, _superprop_get_x() = ref.f; case 6: case "end": return _ctx.stop(); @@ -260,17 +177,7 @@ var A = function() { return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - _superprop_get("x").call(_this1), a = _superprop_get("x"), _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", _superprop_get("x").call(_this1)); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); - })); + _superprop_get("x").call(_this1), a = _superprop_get("x"); case 4: case "end": return _ctx.stop(); @@ -280,27 +187,16 @@ var A = function() { }, _proto.element_access_only_write_only_in_generator = function() { var _this = this, _superprop_get = function(_prop) { return _get(_get_prototype_of(B.prototype), _prop, _this); - }, _superprop_set = function(_prop, _value) { - return _set(_get_prototype_of(B.prototype), _prop, _value, _this, !0); }; return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { var f, ref; return regeneratorRuntime.wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: - _superprop_set("x", f = function() {}), ref = { + var _value; + _value = f = function() {}, _set(_get_prototype_of(B.prototype), "x", _value, _this, !0), ref = { f: f - }, _superprop_get("x") = ref.f, _async_to_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", _superprop_set("x", f)); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); - })); + }, _superprop_get("x") = ref.f; case 6: case "end": return _ctx.stop(); diff --git a/crates/swc/tests/tsc-references/asyncMultiFile_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncMultiFile_es5_es5.1.normal.js index 1513fb6a0d8..4adc7b44fb2 100644 --- a/crates/swc/tests/tsc-references/asyncMultiFile_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMultiFile_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function f() { return _f.apply(this, arguments); } function _f() { - _f = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncMultiFile_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncMultiFile_es6_es5.1.normal.js index 30d8efac76a..422fb9875a2 100644 --- a/crates/swc/tests/tsc-references/asyncMultiFile_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMultiFile_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function f() { return _f.apply(this, arguments); } function _f() { - _f = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es2017_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es2017_es2015.2.minified.js index 31ea7d7a7b3..20a0f20505c 100644 --- a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es2017_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es2017_es2015.2.minified.js @@ -1,6 +1 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*(i) { - return yield someOtherFunction(i); -}), _async_to_generator(function*(i) { - return yield someOtherFunction(i); -}); diff --git a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es2017_es5.1.normal.js index 668a1f8b2a2..3e5565cb9e6 100644 --- a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es2017_es5.1.normal.js @@ -3,7 +3,7 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var x = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(i) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(i) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -22,7 +22,7 @@ var x = function() { }; }(); var x1 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(i) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(i) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es2017_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es2017_es5.2.minified.js index c651a77ae7a..3417dabd0f2 100644 --- a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es2017_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es2017_es5.2.minified.js @@ -1,27 +1,2 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee(i) { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, someOtherFunction(i); - case 2: - return _ctx.abrupt("return", _ctx.sent); - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee(i) { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, someOtherFunction(i); - case 2: - return _ctx.abrupt("return", _ctx.sent); - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es5_es2015.2.minified.js index 31ea7d7a7b3..20a0f20505c 100644 --- a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es5_es2015.2.minified.js @@ -1,6 +1 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*(i) { - return yield someOtherFunction(i); -}), _async_to_generator(function*(i) { - return yield someOtherFunction(i); -}); diff --git a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es5_es5.1.normal.js index f30a4f15ed4..3b7cdd786dc 100644 --- a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es5_es5.1.normal.js @@ -4,7 +4,7 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var x = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(i) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(i) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -23,7 +23,7 @@ var x = function() { }; }(); var x1 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(i) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(i) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es5_es5.2.minified.js index c651a77ae7a..3417dabd0f2 100644 --- a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es5_es5.2.minified.js @@ -1,27 +1,2 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee(i) { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, someOtherFunction(i); - case 2: - return _ctx.abrupt("return", _ctx.sent); - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee(i) { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, someOtherFunction(i); - case 2: - return _ctx.abrupt("return", _ctx.sent); - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es6_es2015.2.minified.js index 31ea7d7a7b3..20a0f20505c 100644 --- a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es6_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es6_es2015.2.minified.js @@ -1,6 +1 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -_async_to_generator(function*(i) { - return yield someOtherFunction(i); -}), _async_to_generator(function*(i) { - return yield someOtherFunction(i); -}); diff --git a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es6_es5.1.normal.js index b5c82034a5d..20b9223f1d2 100644 --- a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es6_es5.1.normal.js @@ -3,7 +3,7 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var x = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(i) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(i) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -22,7 +22,7 @@ var x = function() { }; }(); var x1 = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(i) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(i) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es6_es5.2.minified.js index c651a77ae7a..3417dabd0f2 100644 --- a/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es6_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/asyncUnParenthesizedArrowFunction_es6_es5.2.minified.js @@ -1,27 +1,2 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_async_to_generator(regeneratorRuntime.mark(function _callee(i) { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, someOtherFunction(i); - case 2: - return _ctx.abrupt("return", _ctx.sent); - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _async_to_generator(regeneratorRuntime.mark(function _callee(i) { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, someOtherFunction(i); - case 2: - return _ctx.abrupt("return", _ctx.sent); - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/asyncUseStrict_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncUseStrict_es2017_es5.1.normal.js index ff8bbb4e082..f726d7e0789 100644 --- a/crates/swc/tests/tsc-references/asyncUseStrict_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncUseStrict_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncUseStrict_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncUseStrict_es5_es5.1.normal.js index f01eb2774be..6d4e1fe3424 100644 --- a/crates/swc/tests/tsc-references/asyncUseStrict_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncUseStrict_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncUseStrict_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncUseStrict_es6_es5.1.normal.js index d1dc85aaaf9..a673d83d7f1 100644 --- a/crates/swc/tests/tsc-references/asyncUseStrict_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncUseStrict_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es5.1.normal.js index f7c33b7f265..01e3f636186 100644 --- a/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncWithVarShadowing_es6_es5.1.normal.js @@ -10,7 +10,7 @@ function fn1(x) { return _fn1.apply(this, arguments); } function _fn1() { - _fn1 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -28,7 +28,7 @@ function fn2(x) { return _fn2.apply(this, arguments); } function _fn2() { - _fn2 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn2 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x, z; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -46,7 +46,7 @@ function fn3(x) { return _fn3.apply(this, arguments); } function _fn3() { - _fn3 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn3 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var z; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -64,7 +64,7 @@ function fn4(x) { return _fn4.apply(this, arguments); } function _fn4() { - _fn4 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn4 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -82,7 +82,7 @@ function fn5(x) { return _fn5.apply(this, arguments); } function _fn5() { - _fn5 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn5 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -100,7 +100,7 @@ function fn6(x) { return _fn6.apply(this, arguments); } function _fn6() { - _fn6 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn6 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x, z; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -118,7 +118,7 @@ function fn7(x) { return _fn7.apply(this, arguments); } function _fn7() { - _fn7 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn7 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var _x, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -136,7 +136,7 @@ function fn8(x) { return _fn8.apply(this, arguments); } function _fn8() { - _fn8 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn8 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -154,7 +154,7 @@ function fn9(x) { return _fn9.apply(this, arguments); } function _fn9() { - _fn9 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn9 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -172,7 +172,7 @@ function fn10(x) { return _fn10.apply(this, arguments); } function _fn10() { - _fn10 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn10 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var tmp, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -190,7 +190,7 @@ function fn11(x) { return _fn11.apply(this, arguments); } function _fn11() { - _fn11 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn11 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -208,7 +208,7 @@ function fn12(x) { return _fn12.apply(this, arguments); } function _fn12() { - _fn12 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn12 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var _y, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -226,7 +226,7 @@ function fn13(x) { return _fn13.apply(this, arguments); } function _fn13() { - _fn13 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn13 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var _y, tmp, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -244,7 +244,7 @@ function fn14(x) { return _fn14.apply(this, arguments); } function _fn14() { - _fn14 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn14 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var _y, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -262,7 +262,7 @@ function fn15(x) { return _fn15.apply(this, arguments); } function _fn15() { - _fn15 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn15 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var _y, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -280,7 +280,7 @@ function fn16(x) { return _fn16.apply(this, arguments); } function _fn16() { - _fn16 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn16 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var _y, ref, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -298,7 +298,7 @@ function fn17(x) { return _fn17.apply(this, arguments); } function _fn17() { - _fn17 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn17 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var _y, tmp, ref, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -316,7 +316,7 @@ function fn18(_) { return _fn18.apply(this, arguments); } function _fn18() { - _fn18 = _async_to_generator(regeneratorRuntime.mark(function _callee(param) { + _fn18 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(param) { var x, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -335,7 +335,7 @@ function fn19(_) { return _fn19.apply(this, arguments); } function _fn19() { - _fn19 = _async_to_generator(regeneratorRuntime.mark(function _callee(param) { + _fn19 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(param) { var _param, x, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -354,7 +354,7 @@ function fn20(x) { return _fn20.apply(this, arguments); } function _fn20() { - _fn20 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn20 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -374,7 +374,7 @@ function fn21(x) { return _fn21.apply(this, arguments); } function _fn21() { - _fn21 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn21 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -394,7 +394,7 @@ function fn22(x) { return _fn22.apply(this, arguments); } function _fn22() { - _fn22 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn22 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -414,7 +414,7 @@ function fn23(x) { return _fn23.apply(this, arguments); } function _fn23() { - _fn23 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn23 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -434,7 +434,7 @@ function fn24(x) { return _fn24.apply(this, arguments); } function _fn24() { - _fn24 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn24 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -454,7 +454,7 @@ function fn25(x) { return _fn25.apply(this, arguments); } function _fn25() { - _fn25 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn25 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x1; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -474,7 +474,7 @@ function fn26(x) { return _fn26.apply(this, arguments); } function _fn26() { - _fn26 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn26 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x1, x1; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -495,7 +495,7 @@ function fn27(x) { return _fn27.apply(this, arguments); } function _fn27() { - _fn27 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn27 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -515,7 +515,7 @@ function fn28(x) { return _fn28.apply(this, arguments); } function _fn28() { - _fn28 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn28 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -535,7 +535,7 @@ function fn29(x) { return _fn29.apply(this, arguments); } function _fn29() { - _fn29 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn29 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -555,7 +555,7 @@ function fn30(x) { return _fn30.apply(this, arguments); } function _fn30() { - _fn30 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn30 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -573,7 +573,7 @@ function fn31(x) { return _fn31.apply(this, arguments); } function _fn31() { - _fn31 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn31 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -591,7 +591,7 @@ function fn32(x) { return _fn32.apply(this, arguments); } function _fn32() { - _fn32 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn32 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -611,7 +611,7 @@ function fn33(x) { return _fn33.apply(this, arguments); } function _fn33() { - _fn33 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn33 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -629,7 +629,7 @@ function fn34(x) { return _fn34.apply(this, arguments); } function _fn34() { - _fn34 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn34 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var z, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -649,7 +649,7 @@ function fn35(x) { return _fn35.apply(this, arguments); } function _fn35() { - _fn35 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn35 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -708,7 +708,7 @@ function fn36(x) { return _fn36.apply(this, arguments); } function _fn36() { - _fn36 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn36 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -767,7 +767,7 @@ function fn37(x) { return _fn37.apply(this, arguments); } function _fn37() { - _fn37 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn37 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, z, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -827,7 +827,7 @@ function fn38(x) { return _fn38.apply(this, arguments); } function _fn38() { - _fn38 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn38 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -848,7 +848,7 @@ function fn39(x) { return _fn39.apply(this, arguments); } function _fn39() { - _fn39 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn39 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -867,7 +867,7 @@ function fn40(x) { return _fn40.apply(this, arguments); } function _fn40() { - _fn40 = _async_to_generator(regeneratorRuntime.mark(function _callee(x) { + _fn40 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(x) { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression1_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression1_es2017_es5.1.normal.js index 296cd927922..81211828afe 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression1_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression1_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression1_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression1_es5_es5.1.normal.js index 614b4a7d0b7..5fbd3162f27 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression1_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression1_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression1_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression1_es6_es5.1.normal.js index 7cdb1d317c7..79e246f8b5a 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression1_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression1_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression2_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression2_es2017_es5.1.normal.js index aceca641a62..55d20e5e9fe 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression2_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression2_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression2_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression2_es5_es5.1.normal.js index 20c2ba121a1..b99f6f54bc8 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression2_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression2_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression2_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression2_es6_es5.1.normal.js index e2103dca509..44bf2e9c6b2 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression2_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression2_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression3_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression3_es2017_es5.1.normal.js index 8cde9dc666f..669ee120013 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression3_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression3_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression3_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression3_es5_es5.1.normal.js index 913b853ec4e..36c7d6ce578 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression3_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression3_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression3_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression3_es6_es5.1.normal.js index 14d8a0f606d..dd4e78c87a4 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression3_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression3_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression4_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression4_es2017_es5.1.normal.js index c80953d9ff8..8928ac15ea1 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression4_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression4_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression4_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression4_es5_es5.1.normal.js index d3624c9d145..37022c58e26 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression4_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression4_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression4_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression4_es6_es5.1.normal.js index e6437bc9d72..517f8b86384 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression4_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression4_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression5_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression5_es2017_es5.1.normal.js index 6e0651432c8..0850afcf4e3 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression5_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression5_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var o; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression5_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression5_es5_es5.1.normal.js index 151b40170c3..f6976cf8838 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression5_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression5_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var o; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitBinaryExpression5_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitBinaryExpression5_es6_es5.1.normal.js index e3f684c2a3c..c8009520de1 100644 --- a/crates/swc/tests/tsc-references/awaitBinaryExpression5_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitBinaryExpression5_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var o; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression1_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression1_es2017_es5.1.normal.js index 18be2b94a9d..8e623c99ccc 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression1_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression1_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression1_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression1_es5_es5.1.normal.js index 6a75994b89b..8c204724774 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression1_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression1_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression1_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression1_es6_es5.1.normal.js index b068f55721c..b882c24280f 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression1_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression1_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression2_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression2_es2017_es5.1.normal.js index 8a1ea3b9432..d9af219b015 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression2_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression2_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression2_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression2_es5_es5.1.normal.js index dda0362c30e..bcd92e714fa 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression2_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression2_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression2_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression2_es6_es5.1.normal.js index f3f58e21caa..fef4cddc9c2 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression2_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression2_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression3_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression3_es2017_es5.1.normal.js index 1d1514c5675..8410697e58f 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression3_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression3_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression3_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression3_es5_es5.1.normal.js index 9da44defd4a..4598029276a 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression3_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression3_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression3_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression3_es6_es5.1.normal.js index bd8c6ac3ba2..3cd1fd7051a 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression3_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression3_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression4_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression4_es2017_es5.1.normal.js index d4b4309c2bc..913f401ef48 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression4_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression4_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression4_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression4_es5_es5.1.normal.js index c34924edabe..3f35eedae2b 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression4_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression4_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression4_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression4_es6_es5.1.normal.js index 8f1554ce34e..2a4eb1096cf 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression4_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression4_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression5_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression5_es2017_es5.1.normal.js index 1227544dd40..05f31481ddf 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression5_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression5_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression5_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression5_es5_es5.1.normal.js index df2f88f51a2..b49f67aa66b 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression5_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression5_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression5_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression5_es6_es5.1.normal.js index 807ab3409a3..bb7f387e3aa 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression5_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression5_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression6_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression6_es2017_es5.1.normal.js index 1b688cbc193..9143a498842 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression6_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression6_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression6_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression6_es5_es5.1.normal.js index bbc52da0575..31825b63caf 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression6_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression6_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression6_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression6_es6_es5.1.normal.js index 5eba533bf9c..760652bb38e 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression6_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression6_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression7_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression7_es2017_es5.1.normal.js index 0de8d086be3..0ce8e631d3e 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression7_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression7_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression7_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression7_es5_es5.1.normal.js index e621d84c899..81ecd5cf100 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression7_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression7_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression7_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression7_es6_es5.1.normal.js index a1d0d9ef947..68ccb470c09 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression7_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression7_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression8_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression8_es2017_es5.1.normal.js index 0ba7c03bba9..6999f561578 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression8_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression8_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression8_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression8_es5_es5.1.normal.js index 72d9872dc71..bc091fa27f1 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression8_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression8_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitCallExpression8_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitCallExpression8_es6_es5.1.normal.js index cf67c785383..5f5059afcd9 100644 --- a/crates/swc/tests/tsc-references/awaitCallExpression8_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitCallExpression8_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitClassExpression_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitClassExpression_es2017_es5.1.normal.js index 5e05893fea2..9b5e761d47d 100644 --- a/crates/swc/tests/tsc-references/awaitClassExpression_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitClassExpression_es2017_es5.1.normal.js @@ -9,7 +9,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var D; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitClassExpression_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitClassExpression_es5_es5.1.normal.js index c3ab54dadee..eca05dd35dd 100644 --- a/crates/swc/tests/tsc-references/awaitClassExpression_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitClassExpression_es5_es5.1.normal.js @@ -10,7 +10,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var D; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitClassExpression_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitClassExpression_es6_es5.1.normal.js index e08e005da6e..7f7e3041975 100644 --- a/crates/swc/tests/tsc-references/awaitClassExpression_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitClassExpression_es6_es5.1.normal.js @@ -9,7 +9,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var D; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitInheritedPromise_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitInheritedPromise_es2017_es5.1.normal.js index 65369949df7..138ad78bf91 100644 --- a/crates/swc/tests/tsc-references/awaitInheritedPromise_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitInheritedPromise_es2017_es5.1.normal.js @@ -6,7 +6,7 @@ function f() { return _f.apply(this, arguments); } function _f() { - _f = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/awaitUnion_es5_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitUnion_es5_es5.1.normal.js index 596684c95c5..35538455d60 100644 --- a/crates/swc/tests/tsc-references/awaitUnion_es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitUnion_es5_es5.1.normal.js @@ -7,7 +7,7 @@ function f() { return _f.apply(this, arguments); } function _f() { - _f = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var await_a, await_b, await_c, await_d, await_e; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/awaitUnion_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitUnion_es6_es5.1.normal.js index 11ca68f5c45..8ead9003310 100644 --- a/crates/swc/tests/tsc-references/awaitUnion_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/awaitUnion_es6_es5.1.normal.js @@ -6,7 +6,7 @@ function f() { return _f.apply(this, arguments); } function _f() { - _f = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var await_a, await_b, await_c, await_d, await_e; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/await_unaryExpression_es2017_es5.1.normal.js b/crates/swc/tests/tsc-references/await_unaryExpression_es2017_es5.1.normal.js index 88e9b962862..7d49d188ae3 100644 --- a/crates/swc/tests/tsc-references/await_unaryExpression_es2017_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/await_unaryExpression_es2017_es5.1.normal.js @@ -5,7 +5,7 @@ function bar() { return _bar.apply(this, arguments); } function _bar() { - _bar = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _bar = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -25,7 +25,7 @@ function bar1() { return _bar1.apply(this, arguments); } function _bar1() { - _bar1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _bar1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -45,7 +45,7 @@ function bar3() { return _bar3.apply(this, arguments); } function _bar3() { - _bar3 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _bar3 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -65,7 +65,7 @@ function bar4() { return _bar4.apply(this, arguments); } function _bar4() { - _bar4 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _bar4 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/await_unaryExpression_es6_es5.1.normal.js b/crates/swc/tests/tsc-references/await_unaryExpression_es6_es5.1.normal.js index 2b27c7dde49..6fdda589c12 100644 --- a/crates/swc/tests/tsc-references/await_unaryExpression_es6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/await_unaryExpression_es6_es5.1.normal.js @@ -5,7 +5,7 @@ function bar() { return _bar.apply(this, arguments); } function _bar() { - _bar = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _bar = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -25,7 +25,7 @@ function bar1() { return _bar1.apply(this, arguments); } function _bar1() { - _bar1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _bar1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -45,7 +45,7 @@ function bar3() { return _bar3.apply(this, arguments); } function _bar3() { - _bar3 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _bar3 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -65,7 +65,7 @@ function bar4() { return _bar4.apply(this, arguments); } function _bar4() { - _bar4 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _bar4 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBug_es5.1.normal.js b/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBug_es5.1.normal.js index 48c1c3677e7..8eb0da960de 100644 --- a/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBug_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBug_es5.1.normal.js @@ -27,7 +27,7 @@ function load() { return _load.apply(this, arguments); } function _load() { - _load = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _load = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/contextuallyTypeAsyncFunctionAwaitOperand_es5.1.normal.js b/crates/swc/tests/tsc-references/contextuallyTypeAsyncFunctionAwaitOperand_es5.1.normal.js index 778e2dc75b1..847b7595d1b 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypeAsyncFunctionAwaitOperand_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/contextuallyTypeAsyncFunctionAwaitOperand_es5.1.normal.js @@ -7,7 +7,7 @@ function fn1() { return _fn1.apply(this, arguments); } function _fn1() { - _fn1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var obj1, obj2; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/contextuallyTypeAsyncFunctionReturnType_es5.1.normal.js b/crates/swc/tests/tsc-references/contextuallyTypeAsyncFunctionReturnType_es5.1.normal.js index 153b43b1d6c..c389c06ff5d 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypeAsyncFunctionReturnType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/contextuallyTypeAsyncFunctionReturnType_es5.1.normal.js @@ -7,7 +7,7 @@ function fn1() { return _fn1.apply(this, arguments); } function _fn1() { - _fn1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -26,7 +26,7 @@ function fn2() { return _fn2.apply(this, arguments); } function _fn2() { - _fn2 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn2 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -47,7 +47,7 @@ function fn3() { return _fn3.apply(this, arguments); } function _fn3() { - _fn3 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn3 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -69,7 +69,7 @@ function fn4() { return _fn4.apply(this, arguments); } function _fn4() { - _fn4 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn4 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/controlFlowIIFE_es5.1.normal.js b/crates/swc/tests/tsc-references/controlFlowIIFE_es5.1.normal.js index 74366c47d63..62ac7f737c7 100644 --- a/crates/swc/tests/tsc-references/controlFlowIIFE_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowIIFE_es5.1.normal.js @@ -53,7 +53,7 @@ function f4() { } function f5() { var v; - regeneratorRuntime.mark(function _callee() { + /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -71,7 +71,7 @@ function f5() { } function f6() { var v; - _async_to_generator(regeneratorRuntime.mark(function _callee() { + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es5.1.normal.js b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es5.1.normal.js index fb49723ecc2..3a16ebf4d86 100644 --- a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression01_es5.1.normal.js @@ -9,7 +9,7 @@ export default x; import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; import x from "./a"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { +_async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var value; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es5.1.normal.js b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es5.1.normal.js index aea15dc57e8..52c240d92b3 100644 --- a/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/defaultExportInAwaitExpression02_es5.1.normal.js @@ -9,7 +9,7 @@ export default x; import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; import x from "./a"; -_async_to_generator(regeneratorRuntime.mark(function _callee() { +_async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var value; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es5.1.normal.js index 7071b95a04f..fd37b45fdcb 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2015_es5.1.normal.js @@ -11,7 +11,7 @@ var C1 = /*#__PURE__*/ function() { } var _proto = C1.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -34,7 +34,7 @@ var C2 = /*#__PURE__*/ function() { } var _proto = C2.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -63,7 +63,7 @@ var C3 = /*#__PURE__*/ function() { } var _proto = C3.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -95,7 +95,7 @@ var C4 = /*#__PURE__*/ function() { } var _proto = C4.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -128,12 +128,12 @@ var C5 = /*#__PURE__*/ function() { } var _proto = C5.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -168,7 +168,7 @@ var C6 = /*#__PURE__*/ function() { } var _proto = C6.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -197,7 +197,7 @@ var C7 = /*#__PURE__*/ function() { } var _proto = C7.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -224,7 +224,7 @@ var C8 = /*#__PURE__*/ function() { _proto.g = function g() {}; _proto.f = function f() { var _this = this; - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -269,7 +269,7 @@ var C9 = /*#__PURE__*/ function(B9) { var _this1 = this, _superprop_get_g = function() { return _get(_get_prototype_of(C9.prototype), "g", _this); }; - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es5.1.normal.js index ae0b8a1efe3..712e7ee1d8a 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es2018_es5.1.normal.js @@ -11,7 +11,7 @@ var C1 = /*#__PURE__*/ function() { } var _proto = C1.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -34,7 +34,7 @@ var C2 = /*#__PURE__*/ function() { } var _proto = C2.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -63,7 +63,7 @@ var C3 = /*#__PURE__*/ function() { } var _proto = C3.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -95,7 +95,7 @@ var C4 = /*#__PURE__*/ function() { } var _proto = C4.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -128,12 +128,12 @@ var C5 = /*#__PURE__*/ function() { } var _proto = C5.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -168,7 +168,7 @@ var C6 = /*#__PURE__*/ function() { } var _proto = C6.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -197,7 +197,7 @@ var C7 = /*#__PURE__*/ function() { } var _proto = C7.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -224,7 +224,7 @@ var C8 = /*#__PURE__*/ function() { _proto.g = function g() {}; _proto.f = function f() { var _this = this; - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -269,7 +269,7 @@ var C9 = /*#__PURE__*/ function(B9) { var _this1 = this, _superprop_get_g = function() { return _get(_get_prototype_of(C9.prototype), "g", _this); }; - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es5.1.normal.js index 60265d0a620..876c82e8b85 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5_es5.1.normal.js @@ -11,7 +11,7 @@ var C1 = /*#__PURE__*/ function() { } var _proto = C1.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -34,7 +34,7 @@ var C2 = /*#__PURE__*/ function() { } var _proto = C2.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -63,7 +63,7 @@ var C3 = /*#__PURE__*/ function() { } var _proto = C3.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -95,7 +95,7 @@ var C4 = /*#__PURE__*/ function() { } var _proto = C4.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -128,12 +128,12 @@ var C5 = /*#__PURE__*/ function() { } var _proto = C5.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -168,7 +168,7 @@ var C6 = /*#__PURE__*/ function() { } var _proto = C6.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -197,7 +197,7 @@ var C7 = /*#__PURE__*/ function() { } var _proto = C7.prototype; _proto.f = function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -224,7 +224,7 @@ var C8 = /*#__PURE__*/ function() { _proto.g = function g() {}; _proto.f = function f() { var _this = this; - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -269,7 +269,7 @@ var C9 = /*#__PURE__*/ function(B9) { var _this1 = this, _superprop_get_g = function() { return _get(_get_prototype_of(C9.prototype), "g", _this); }; - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2015_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2015_es5.1.normal.js index c063a0ec6c7..412fa0842e8 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2015_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2015_es5.1.normal.js @@ -7,7 +7,7 @@ function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -25,7 +25,7 @@ function f2() { return _f2.apply(this, arguments); } function _f2() { - _f2 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f2 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -49,7 +49,7 @@ function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f3 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -76,7 +76,7 @@ function f4() { return _f4.apply(this, arguments); } function _f4() { - _f4 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f4 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -104,12 +104,12 @@ function f5() { return _f5.apply(this, arguments); } function _f5() { - _f5 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f5 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -139,7 +139,7 @@ function f6() { return _f6.apply(this, arguments); } function _f6() { - _f6 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f6 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -163,7 +163,7 @@ function f7() { return _f7.apply(this, arguments); } function _f7() { - _f7 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f7 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2018_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2018_es5.1.normal.js index 96409d38fd0..7ece0dd9124 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2018_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es2018_es5.1.normal.js @@ -7,7 +7,7 @@ function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -25,7 +25,7 @@ function f2() { return _f2.apply(this, arguments); } function _f2() { - _f2 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f2 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -49,7 +49,7 @@ function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f3 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -76,7 +76,7 @@ function f4() { return _f4.apply(this, arguments); } function _f4() { - _f4 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f4 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -104,12 +104,12 @@ function f5() { return _f5.apply(this, arguments); } function _f5() { - _f5 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f5 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -139,7 +139,7 @@ function f6() { return _f6.apply(this, arguments); } function _f6() { - _f6 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f6 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -163,7 +163,7 @@ function f7() { return _f7.apply(this, arguments); } function _f7() { - _f7 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f7 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es5_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es5_es5.1.normal.js index 876e8fab001..90d72761f27 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionDeclarations.es5_es5.1.normal.js @@ -7,7 +7,7 @@ function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -25,7 +25,7 @@ function f2() { return _f2.apply(this, arguments); } function _f2() { - _f2 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f2 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -49,7 +49,7 @@ function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f3 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -76,7 +76,7 @@ function f4() { return _f4.apply(this, arguments); } function _f4() { - _f4 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f4 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -104,12 +104,12 @@ function f5() { return _f5.apply(this, arguments); } function _f5() { - _f5 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f5 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -139,7 +139,7 @@ function f6() { return _f6.apply(this, arguments); } function _f6() { - _f6 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f6 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -163,7 +163,7 @@ function f7() { return _f7.apply(this, arguments); } function _f7() { - _f7 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f7 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es2015.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es2015.2.minified.js index 5beb8960676..cac6ecb5df5 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es2015.2.minified.js @@ -1,37 +1,14 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() {}); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield; -}); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield 1; -}); import _async_generator_delegate from "@swc/helpers/src/_async_generator_delegate.mjs"; import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator([ - 1 - ]), _await_async_generator); -}); import _async_generator_delegate from "@swc/helpers/src/_async_generator_delegate.mjs"; import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator(_wrap_async_generator(function*() { - yield 1; - })()), _await_async_generator); -}); import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield _await_async_generator(1); -}); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - return 1; -}); diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es5.1.normal.js index 0c0dac7c546..0ce3a0b8826 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es5.1.normal.js @@ -4,7 +4,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f1 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -21,7 +21,7 @@ var f1 = function() { import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f2 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -44,7 +44,7 @@ var f2 = function() { import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f3 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -70,7 +70,7 @@ import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs" import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f4 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -97,12 +97,12 @@ import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs" import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f5 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -131,7 +131,7 @@ import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs" import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f6 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -154,7 +154,7 @@ var f6 = function() { import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f7 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es5.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es5.2.minified.js index 026235901ac..f905629020e 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2015_es5.2.minified.js @@ -1,124 +1,21 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - _ctx.next = 2; - return; - case 2: - x = _ctx.sent; - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, 1; - case 2: - x = _ctx.sent; - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _async_generator_delegate from "@swc/helpers/src/_async_generator_delegate.mjs"; import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator([ - 1 - ]), _await_async_generator), "t0", 1); - case 1: - x = _ctx.t0; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _async_generator_delegate from "@swc/helpers/src/_async_generator_delegate.mjs"; import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, 1; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); - }))()), _await_async_generator), "t0", 1); - case 1: - x = _ctx.t0; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, _await_async_generator(1); - case 2: - x = _ctx.sent; - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es2015.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es2015.2.minified.js index 5beb8960676..cac6ecb5df5 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es2015.2.minified.js @@ -1,37 +1,14 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() {}); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield; -}); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield 1; -}); import _async_generator_delegate from "@swc/helpers/src/_async_generator_delegate.mjs"; import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator([ - 1 - ]), _await_async_generator); -}); import _async_generator_delegate from "@swc/helpers/src/_async_generator_delegate.mjs"; import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator(_wrap_async_generator(function*() { - yield 1; - })()), _await_async_generator); -}); import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield _await_async_generator(1); -}); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - return 1; -}); diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es5.1.normal.js index 3437659b94e..3ccbb1431be 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es5.1.normal.js @@ -4,7 +4,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f1 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -21,7 +21,7 @@ var f1 = function() { import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f2 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -44,7 +44,7 @@ var f2 = function() { import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f3 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -70,7 +70,7 @@ import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs" import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f4 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -97,12 +97,12 @@ import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs" import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f5 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -131,7 +131,7 @@ import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs" import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f6 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -154,7 +154,7 @@ var f6 = function() { import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f7 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es5.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es5.2.minified.js index 026235901ac..f905629020e 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es2018_es5.2.minified.js @@ -1,124 +1,21 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - _ctx.next = 2; - return; - case 2: - x = _ctx.sent; - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, 1; - case 2: - x = _ctx.sent; - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _async_generator_delegate from "@swc/helpers/src/_async_generator_delegate.mjs"; import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator([ - 1 - ]), _await_async_generator), "t0", 1); - case 1: - x = _ctx.t0; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _async_generator_delegate from "@swc/helpers/src/_async_generator_delegate.mjs"; import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, 1; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); - }))()), _await_async_generator), "t0", 1); - case 1: - x = _ctx.t0; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, _await_async_generator(1); - case 2: - x = _ctx.sent; - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es2015.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es2015.2.minified.js index 5beb8960676..cac6ecb5df5 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es2015.2.minified.js @@ -1,37 +1,14 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() {}); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield; -}); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield 1; -}); import _async_generator_delegate from "@swc/helpers/src/_async_generator_delegate.mjs"; import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator([ - 1 - ]), _await_async_generator); -}); import _async_generator_delegate from "@swc/helpers/src/_async_generator_delegate.mjs"; import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator(_wrap_async_generator(function*() { - yield 1; - })()), _await_async_generator); -}); import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield _await_async_generator(1); -}); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - return 1; -}); diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es5.1.normal.js index 3dc73eb7933..8fce940960a 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es5.1.normal.js @@ -4,7 +4,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f1 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -21,7 +21,7 @@ var f1 = function() { import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f2 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -44,7 +44,7 @@ var f2 = function() { import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f3 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -70,7 +70,7 @@ import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs" import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f4 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -97,12 +97,12 @@ import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs" import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f5 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -131,7 +131,7 @@ import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs" import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f6 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -154,7 +154,7 @@ var f6 = function() { import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var f7 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es5.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es5.2.minified.js index 026235901ac..f905629020e 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.functionExpressions.es5_es5.2.minified.js @@ -1,124 +1,21 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - _ctx.next = 2; - return; - case 2: - x = _ctx.sent; - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, 1; - case 2: - x = _ctx.sent; - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _async_generator_delegate from "@swc/helpers/src/_async_generator_delegate.mjs"; import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator([ - 1 - ]), _await_async_generator), "t0", 1); - case 1: - x = _ctx.t0; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _async_generator_delegate from "@swc/helpers/src/_async_generator_delegate.mjs"; import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, 1; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); - }))()), _await_async_generator), "t0", 1); - case 1: - x = _ctx.t0; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - var x; - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, _await_async_generator(1); - case 2: - x = _ctx.sent; - case 3: - case "end": - return _ctx.stop(); - } - }, _callee); -})); import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.abrupt("return", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2015_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2015_es5.1.normal.js index b8b7d6a0ba1..f03662c98ae 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2015_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2015_es5.1.normal.js @@ -5,7 +5,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o1 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -21,7 +21,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o2 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -43,7 +43,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o3 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -68,7 +68,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o4 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -94,12 +94,12 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o5 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -127,7 +127,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o6 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -149,7 +149,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o7 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2018_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2018_es5.1.normal.js index b31022a1b83..5502658cd40 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2018_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es2018_es5.1.normal.js @@ -5,7 +5,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o1 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -21,7 +21,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o2 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -43,7 +43,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o3 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -68,7 +68,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o4 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -94,12 +94,12 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o5 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -127,7 +127,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o6 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -149,7 +149,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o7 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es5_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es5_es5.1.normal.js index 7a846ad0371..043803d1177 100644 --- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.objectLiteralMethods.es5_es5.1.normal.js @@ -5,7 +5,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o1 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -21,7 +21,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o2 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -43,7 +43,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o3 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -68,7 +68,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o4 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -94,12 +94,12 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o5 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -127,7 +127,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o6 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -149,7 +149,7 @@ import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; var o7 = { f: function f() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/emitter.forAwait_es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.forAwait_es5.1.normal.js index 6386660e83e..52f8cf7d963 100644 --- a/crates/swc/tests/tsc-references/emitter.forAwait_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/emitter.forAwait_es5.1.normal.js @@ -8,7 +8,7 @@ function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var y, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -90,7 +90,7 @@ function f2() { return _f2.apply(this, arguments); } function _f2() { - _f2 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f2 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x, y, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -173,7 +173,7 @@ function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f3 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var y, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -256,7 +256,7 @@ function f4() { return _f4.apply(this, arguments); } function _f4() { - _f4 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f4 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x, y, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -339,7 +339,7 @@ function f5() { return _f5.apply(this, arguments); } function _f5() { - _f5 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f5 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var y, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -422,7 +422,7 @@ function f6() { return _f6.apply(this, arguments); } function _f6() { - _f6 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f6 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var y, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -505,7 +505,7 @@ function f7() { return _f7.apply(this, arguments); } function _f7() { - _f7 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f7 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var y, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/errorOnFunctionReturnType_es5.1.normal.js b/crates/swc/tests/tsc-references/errorOnFunctionReturnType_es5.1.normal.js index cdcf712120a..093dcd7908e 100644 --- a/crates/swc/tests/tsc-references/errorOnFunctionReturnType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/errorOnFunctionReturnType_es5.1.normal.js @@ -14,7 +14,7 @@ function testPromise2() { return _testPromise2.apply(this, arguments); } function _testPromise2() { - _testPromise2 = /** @type {FunctionReturningPromise} */ _async_to_generator(regeneratorRuntime.mark(function _callee() { + _testPromise2 = /** @type {FunctionReturningPromise} */ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -41,7 +41,7 @@ function testNever2() { return _testNever2.apply(this, arguments); } function _testNever2() { - _testNever2 = /** @type {FunctionReturningNever} */ _async_to_generator(regeneratorRuntime.mark(function _callee() { + _testNever2 = /** @type {FunctionReturningNever} */ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorAssignability_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorAssignability_es5.1.normal.js index c69be96a214..4587d8f0179 100644 --- a/crates/swc/tests/tsc-references/generatorAssignability_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorAssignability_es5.1.normal.js @@ -11,7 +11,7 @@ import _to_array from "@swc/helpers/src/_to_array.mjs"; import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(f1); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(f1); // spread iterable _to_consumable_array(g1); // error _to_consumable_array(g2); // ok @@ -76,7 +76,7 @@ function asyncfn() { return _asyncfn.apply(this, arguments); } function _asyncfn() { - _asyncfn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _asyncfn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, _iteratorAbruptCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, _value1, _iteratorAbruptCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, _value2, _iteratorAbruptCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, _value3; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -351,7 +351,7 @@ function f2() { return _f2.apply(this, arguments); } function _f2() { - _f2 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f2 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -376,12 +376,12 @@ function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f3 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var syncGenerator, o, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - syncGenerator = regeneratorRuntime.mark(function syncGenerator() { + syncGenerator = /*#__PURE__*/ regeneratorRuntime.mark(function syncGenerator() { return regeneratorRuntime.wrap(function syncGenerator$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorExplicitReturnType_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorExplicitReturnType_es5.1.normal.js index 19e5f1f29d4..ef2b5231e0b 100644 --- a/crates/swc/tests/tsc-references/generatorExplicitReturnType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorExplicitReturnType_es5.1.normal.js @@ -3,10 +3,10 @@ // @noImplicitReturns: true // @noImplicitAny: true import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g4); -var _marked1 = regeneratorRuntime.mark(g3); -var _marked2 = regeneratorRuntime.mark(g2); -var _marked3 = regeneratorRuntime.mark(g1); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g4); +var _marked1 = /*#__PURE__*/ regeneratorRuntime.mark(g3); +var _marked2 = /*#__PURE__*/ regeneratorRuntime.mark(g2); +var _marked3 = /*#__PURE__*/ regeneratorRuntime.mark(g1); function g1() { var x; return regeneratorRuntime.wrap(function g1$(_ctx) { diff --git a/crates/swc/tests/tsc-references/generatorImplicitAny_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorImplicitAny_es5.1.normal.js index ad724dd1c99..6f0d9cbb05e 100644 --- a/crates/swc/tests/tsc-references/generatorImplicitAny_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorImplicitAny_es5.1.normal.js @@ -3,12 +3,12 @@ // @noImplicitReturns: true // @noImplicitAny: true import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g6); -var _marked1 = regeneratorRuntime.mark(g5); -var _marked2 = regeneratorRuntime.mark(g4); -var _marked3 = regeneratorRuntime.mark(g3); -var _marked4 = regeneratorRuntime.mark(g2); -var _marked5 = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g6); +var _marked1 = /*#__PURE__*/ regeneratorRuntime.mark(g5); +var _marked2 = /*#__PURE__*/ regeneratorRuntime.mark(g4); +var _marked3 = /*#__PURE__*/ regeneratorRuntime.mark(g3); +var _marked4 = /*#__PURE__*/ regeneratorRuntime.mark(g2); +var _marked5 = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext5_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorInAmbientContext5_es5.1.normal.js index 8a4c0cef3c2..036a046dcbe 100644 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorInAmbientContext5_es5.1.normal.js @@ -8,7 +8,7 @@ var C = /*#__PURE__*/ function() { _class_call_check(this, C); } var _proto = C.prototype; - _proto.generator = regeneratorRuntime.mark(function generator() { + _proto.generator = /*#__PURE__*/ regeneratorRuntime.mark(function generator() { return regeneratorRuntime.wrap(function generator$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext6_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorInAmbientContext6_es5.1.normal.js index e9d8e87ec06..cddba06beae 100644 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorInAmbientContext6_es5.1.normal.js @@ -3,7 +3,7 @@ import regeneratorRuntime from "regenerator-runtime"; var M; (function(M) { - var generator = regeneratorRuntime.mark(function generator() { + var generator = /*#__PURE__*/ regeneratorRuntime.mark(function generator() { return regeneratorRuntime.wrap(function generator$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorNoImplicitReturns_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorNoImplicitReturns_es5.1.normal.js index e4379229fbe..c4b4fa54d98 100644 --- a/crates/swc/tests/tsc-references/generatorNoImplicitReturns_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorNoImplicitReturns_es5.1.normal.js @@ -2,7 +2,7 @@ // @noImplicitReturns: true // @strictNullChecks: false import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(testGenerator); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(testGenerator); function testGenerator() { return regeneratorRuntime.wrap(function testGenerator$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorOverloads4_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorOverloads4_es5.1.normal.js index 693eb9d8f5a..e7ef9bba469 100644 --- a/crates/swc/tests/tsc-references/generatorOverloads4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorOverloads4_es5.1.normal.js @@ -7,7 +7,7 @@ var C = /*#__PURE__*/ function() { _class_call_check(this, C); } var _proto = C.prototype; - _proto.f = regeneratorRuntime.mark(function f(s) { + _proto.f = /*#__PURE__*/ regeneratorRuntime.mark(function f(s) { return regeneratorRuntime.wrap(function f$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorOverloads5_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorOverloads5_es5.1.normal.js index e8f609879e9..cc248b45d94 100644 --- a/crates/swc/tests/tsc-references/generatorOverloads5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorOverloads5_es5.1.normal.js @@ -2,7 +2,7 @@ import regeneratorRuntime from "regenerator-runtime"; var M; (function(M) { - var f = regeneratorRuntime.mark(function f(s) { + var f = /*#__PURE__*/ regeneratorRuntime.mark(function f(s) { return regeneratorRuntime.wrap(function f$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorReturnContextualType_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorReturnContextualType_es5.1.normal.js index bdb0d5000c2..1fae8ac809d 100644 --- a/crates/swc/tests/tsc-references/generatorReturnContextualType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorReturnContextualType_es5.1.normal.js @@ -3,7 +3,7 @@ // #35995 import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(f1); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(f1); function f1() { return regeneratorRuntime.wrap(function f1$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -21,7 +21,7 @@ function f2() { return _f2.apply(this, arguments); } function _f2() { - _f2 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f2 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -40,7 +40,7 @@ function f3() { return _f3.apply(this, arguments); } function _f3() { - _f3 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f3 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -59,7 +59,7 @@ function f4() { return _f4.apply(this, arguments); } function _f4() { - _f4 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f4 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var ret; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorReturnTypeFallback.1_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorReturnTypeFallback.1_es5.1.normal.js index 8bca5644b1d..b6e57655c40 100644 --- a/crates/swc/tests/tsc-references/generatorReturnTypeFallback.1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorReturnTypeFallback.1_es5.1.normal.js @@ -4,7 +4,7 @@ // @strict: true // Allow generators to fallback to IterableIterator if they do not need a type for the sent value while in strictNullChecks mode. import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(f); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(f); function f() { return regeneratorRuntime.wrap(function f$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorReturnTypeFallback.2_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorReturnTypeFallback.2_es5.1.normal.js index dededfa6558..527ee426cfd 100644 --- a/crates/swc/tests/tsc-references/generatorReturnTypeFallback.2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorReturnTypeFallback.2_es5.1.normal.js @@ -5,7 +5,7 @@ // Allow generators to fallback to IterableIterator if they do not need a type for the sent value while in strictNullChecks mode. // Report an error if IterableIterator cannot be found. import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(f); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(f); function f() { return regeneratorRuntime.wrap(function f$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorReturnTypeFallback.3_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorReturnTypeFallback.3_es5.1.normal.js index 620bd2f1781..d835dbc5a27 100644 --- a/crates/swc/tests/tsc-references/generatorReturnTypeFallback.3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorReturnTypeFallback.3_es5.1.normal.js @@ -5,7 +5,7 @@ // Do not allow generators to fallback to IterableIterator while in strictNullChecks mode if they need a type for the sent value. // NOTE: In non-strictNullChecks mode, `undefined` (the default sent value) is assignable to everything. import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(f); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(f); function f() { var x; return regeneratorRuntime.wrap(function f$(_ctx) { diff --git a/crates/swc/tests/tsc-references/generatorReturnTypeFallback.4_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorReturnTypeFallback.4_es5.1.normal.js index 97c30ef76be..f5f7ab4334f 100644 --- a/crates/swc/tests/tsc-references/generatorReturnTypeFallback.4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorReturnTypeFallback.4_es5.1.normal.js @@ -5,7 +5,7 @@ // Allow generators to fallback to IterableIterator if they are not in strictNullChecks mode // NOTE: In non-strictNullChecks mode, `undefined` (the default sent value) is assignable to everything. import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(f); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(f); function f() { var x; return regeneratorRuntime.wrap(function f$(_ctx) { diff --git a/crates/swc/tests/tsc-references/generatorReturnTypeFallback.5_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorReturnTypeFallback.5_es5.1.normal.js index 8bca5644b1d..b6e57655c40 100644 --- a/crates/swc/tests/tsc-references/generatorReturnTypeFallback.5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorReturnTypeFallback.5_es5.1.normal.js @@ -4,7 +4,7 @@ // @strict: true // Allow generators to fallback to IterableIterator if they do not need a type for the sent value while in strictNullChecks mode. import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(f); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(f); function f() { return regeneratorRuntime.wrap(function f$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorReturnTypeIndirectReferenceToGlobalType_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorReturnTypeIndirectReferenceToGlobalType_es5.1.normal.js index 0d4a46c8c1f..5b9db9ca472 100644 --- a/crates/swc/tests/tsc-references/generatorReturnTypeIndirectReferenceToGlobalType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorReturnTypeIndirectReferenceToGlobalType_es5.1.normal.js @@ -1,7 +1,7 @@ // @strict: true // @target: esnext import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(f1); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(f1); function f1() { var a; return regeneratorRuntime.wrap(function f1$(_ctx) { diff --git a/crates/swc/tests/tsc-references/generatorReturnTypeInferenceNonStrict_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorReturnTypeInferenceNonStrict_es5.1.normal.js index a1d5b6acc58..38c12aa81b8 100644 --- a/crates/swc/tests/tsc-references/generatorReturnTypeInferenceNonStrict_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorReturnTypeInferenceNonStrict_es5.1.normal.js @@ -4,32 +4,32 @@ // @noImplicitAny: true import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g311); -var _marked1 = regeneratorRuntime.mark(g310); -var _marked2 = regeneratorRuntime.mark(g309); -var _marked3 = regeneratorRuntime.mark(g308); -var _marked4 = regeneratorRuntime.mark(g307); -var _marked5 = regeneratorRuntime.mark(g306); -var _marked6 = regeneratorRuntime.mark(g305); -var _marked7 = regeneratorRuntime.mark(g304); -var _marked8 = regeneratorRuntime.mark(g303); -var _marked9 = regeneratorRuntime.mark(g302); -var _marked10 = regeneratorRuntime.mark(g301); -var _marked11 = regeneratorRuntime.mark(g204); -var _marked12 = regeneratorRuntime.mark(g203); -var _marked13 = regeneratorRuntime.mark(g202); -var _marked14 = regeneratorRuntime.mark(g201); -var _marked15 = regeneratorRuntime.mark(g104); -var _marked16 = regeneratorRuntime.mark(g103); -var _marked17 = regeneratorRuntime.mark(g102); -var _marked18 = regeneratorRuntime.mark(g007); -var _marked19 = regeneratorRuntime.mark(g006); -var _marked20 = regeneratorRuntime.mark(g005); -var _marked21 = regeneratorRuntime.mark(g004); -var _marked22 = regeneratorRuntime.mark(g003); -var _marked23 = regeneratorRuntime.mark(g002); -var _marked24 = regeneratorRuntime.mark(g001); -var _marked25 = regeneratorRuntime.mark(g000); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g311); +var _marked1 = /*#__PURE__*/ regeneratorRuntime.mark(g310); +var _marked2 = /*#__PURE__*/ regeneratorRuntime.mark(g309); +var _marked3 = /*#__PURE__*/ regeneratorRuntime.mark(g308); +var _marked4 = /*#__PURE__*/ regeneratorRuntime.mark(g307); +var _marked5 = /*#__PURE__*/ regeneratorRuntime.mark(g306); +var _marked6 = /*#__PURE__*/ regeneratorRuntime.mark(g305); +var _marked7 = /*#__PURE__*/ regeneratorRuntime.mark(g304); +var _marked8 = /*#__PURE__*/ regeneratorRuntime.mark(g303); +var _marked9 = /*#__PURE__*/ regeneratorRuntime.mark(g302); +var _marked10 = /*#__PURE__*/ regeneratorRuntime.mark(g301); +var _marked11 = /*#__PURE__*/ regeneratorRuntime.mark(g204); +var _marked12 = /*#__PURE__*/ regeneratorRuntime.mark(g203); +var _marked13 = /*#__PURE__*/ regeneratorRuntime.mark(g202); +var _marked14 = /*#__PURE__*/ regeneratorRuntime.mark(g201); +var _marked15 = /*#__PURE__*/ regeneratorRuntime.mark(g104); +var _marked16 = /*#__PURE__*/ regeneratorRuntime.mark(g103); +var _marked17 = /*#__PURE__*/ regeneratorRuntime.mark(g102); +var _marked18 = /*#__PURE__*/ regeneratorRuntime.mark(g007); +var _marked19 = /*#__PURE__*/ regeneratorRuntime.mark(g006); +var _marked20 = /*#__PURE__*/ regeneratorRuntime.mark(g005); +var _marked21 = /*#__PURE__*/ regeneratorRuntime.mark(g004); +var _marked22 = /*#__PURE__*/ regeneratorRuntime.mark(g003); +var _marked23 = /*#__PURE__*/ regeneratorRuntime.mark(g002); +var _marked24 = /*#__PURE__*/ regeneratorRuntime.mark(g001); +var _marked25 = /*#__PURE__*/ regeneratorRuntime.mark(g000); function g000() { return regeneratorRuntime.wrap(function g000$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -411,7 +411,7 @@ function g311() { return regeneratorRuntime.wrap(function g311$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var y; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorReturnTypeInference_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorReturnTypeInference_es5.1.normal.js index d4730038015..6ec23fa203b 100644 --- a/crates/swc/tests/tsc-references/generatorReturnTypeInference_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorReturnTypeInference_es5.1.normal.js @@ -4,32 +4,32 @@ // @noImplicitAny: true import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g311); -var _marked1 = regeneratorRuntime.mark(g310); -var _marked2 = regeneratorRuntime.mark(g309); -var _marked3 = regeneratorRuntime.mark(g308); -var _marked4 = regeneratorRuntime.mark(g307); -var _marked5 = regeneratorRuntime.mark(g306); -var _marked6 = regeneratorRuntime.mark(g305); -var _marked7 = regeneratorRuntime.mark(g304); -var _marked8 = regeneratorRuntime.mark(g303); -var _marked9 = regeneratorRuntime.mark(g302); -var _marked10 = regeneratorRuntime.mark(g301); -var _marked11 = regeneratorRuntime.mark(g204); -var _marked12 = regeneratorRuntime.mark(g203); -var _marked13 = regeneratorRuntime.mark(g202); -var _marked14 = regeneratorRuntime.mark(g201); -var _marked15 = regeneratorRuntime.mark(g104); -var _marked16 = regeneratorRuntime.mark(g103); -var _marked17 = regeneratorRuntime.mark(g102); -var _marked18 = regeneratorRuntime.mark(g007); -var _marked19 = regeneratorRuntime.mark(g006); -var _marked20 = regeneratorRuntime.mark(g005); -var _marked21 = regeneratorRuntime.mark(g004); -var _marked22 = regeneratorRuntime.mark(g003); -var _marked23 = regeneratorRuntime.mark(g002); -var _marked24 = regeneratorRuntime.mark(g001); -var _marked25 = regeneratorRuntime.mark(g000); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g311); +var _marked1 = /*#__PURE__*/ regeneratorRuntime.mark(g310); +var _marked2 = /*#__PURE__*/ regeneratorRuntime.mark(g309); +var _marked3 = /*#__PURE__*/ regeneratorRuntime.mark(g308); +var _marked4 = /*#__PURE__*/ regeneratorRuntime.mark(g307); +var _marked5 = /*#__PURE__*/ regeneratorRuntime.mark(g306); +var _marked6 = /*#__PURE__*/ regeneratorRuntime.mark(g305); +var _marked7 = /*#__PURE__*/ regeneratorRuntime.mark(g304); +var _marked8 = /*#__PURE__*/ regeneratorRuntime.mark(g303); +var _marked9 = /*#__PURE__*/ regeneratorRuntime.mark(g302); +var _marked10 = /*#__PURE__*/ regeneratorRuntime.mark(g301); +var _marked11 = /*#__PURE__*/ regeneratorRuntime.mark(g204); +var _marked12 = /*#__PURE__*/ regeneratorRuntime.mark(g203); +var _marked13 = /*#__PURE__*/ regeneratorRuntime.mark(g202); +var _marked14 = /*#__PURE__*/ regeneratorRuntime.mark(g201); +var _marked15 = /*#__PURE__*/ regeneratorRuntime.mark(g104); +var _marked16 = /*#__PURE__*/ regeneratorRuntime.mark(g103); +var _marked17 = /*#__PURE__*/ regeneratorRuntime.mark(g102); +var _marked18 = /*#__PURE__*/ regeneratorRuntime.mark(g007); +var _marked19 = /*#__PURE__*/ regeneratorRuntime.mark(g006); +var _marked20 = /*#__PURE__*/ regeneratorRuntime.mark(g005); +var _marked21 = /*#__PURE__*/ regeneratorRuntime.mark(g004); +var _marked22 = /*#__PURE__*/ regeneratorRuntime.mark(g003); +var _marked23 = /*#__PURE__*/ regeneratorRuntime.mark(g002); +var _marked24 = /*#__PURE__*/ regeneratorRuntime.mark(g001); +var _marked25 = /*#__PURE__*/ regeneratorRuntime.mark(g000); function g000() { return regeneratorRuntime.wrap(function g000$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -409,7 +409,7 @@ function g311() { return regeneratorRuntime.wrap(function g311$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var y; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck10_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck10_es5.1.normal.js index d4475191ff9..ef1dff20785 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck10_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck10_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck11_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck11_es5.1.normal.js index c89237d68ef..0898af3496c 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck11_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck11_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck12_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck12_es5.1.normal.js index d063991128f..9b80017a247 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck12_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck12_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck13_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck13_es5.1.normal.js index a32c426e9a9..105412a0f1c 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck13_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck13_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck14_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck14_es5.1.normal.js index a32c426e9a9..105412a0f1c 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck14_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck14_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck15_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck15_es5.1.normal.js index d063991128f..9b80017a247 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck15_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck15_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck16_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck16_es5.1.normal.js index d4475191ff9..ef1dff20785 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck16_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck16_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck17_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck17_es5.1.normal.js index 84c06e066c7..ddd9105aa92 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck17_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck17_es5.1.normal.js @@ -3,7 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _inherits from "@swc/helpers/src/_inherits.mjs"; import _create_super from "@swc/helpers/src/_create_super.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck18_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck18_es5.1.normal.js index f30a25ba4be..dd6b9aedf37 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck18_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck18_es5.1.normal.js @@ -1,7 +1,7 @@ //@target: ES6 import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck19_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck19_es5.1.normal.js index 64a2c33a807..8257ef78b04 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck19_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck19_es5.1.normal.js @@ -3,7 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _inherits from "@swc/helpers/src/_inherits.mjs"; import _create_super from "@swc/helpers/src/_create_super.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck1_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck1_es5.1.normal.js index e18a3153515..6b6cf1f0f80 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck1_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g1); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g1); function g1() { return regeneratorRuntime.wrap(function g1$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck20_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck20_es5.1.normal.js index eaccb9dccaa..f8bc084a51e 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck20_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck20_es5.1.normal.js @@ -1,7 +1,7 @@ //@target: ES6 import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck21_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck21_es5.1.normal.js index 5d04d47eb83..e6aa512c708 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck21_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck21_es5.1.normal.js @@ -3,7 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _inherits from "@swc/helpers/src/_inherits.mjs"; import _create_super from "@swc/helpers/src/_create_super.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck22_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck22_es5.1.normal.js index d6a74be9852..e498b4d7a9a 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck22_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck22_es5.1.normal.js @@ -3,7 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _inherits from "@swc/helpers/src/_inherits.mjs"; import _create_super from "@swc/helpers/src/_create_super.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g3); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g3); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck23_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck23_es5.1.normal.js index 00d608c62a5..7234b93ee3c 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck23_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck23_es5.1.normal.js @@ -3,7 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _inherits from "@swc/helpers/src/_inherits.mjs"; import _create_super from "@swc/helpers/src/_create_super.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g3); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g3); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck24_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck24_es5.1.normal.js index 827f8dbd01f..08c10b5380a 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck24_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck24_es5.1.normal.js @@ -3,7 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _inherits from "@swc/helpers/src/_inherits.mjs"; import _create_super from "@swc/helpers/src/_create_super.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g3); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g3); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck25_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck25_es5.1.normal.js index a103472c7d3..2f9fc9614a4 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck25_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck25_es5.1.normal.js @@ -21,7 +21,7 @@ var Baz = function Baz() { "use strict"; _class_call_check(this, Baz); }; -var g3 = regeneratorRuntime.mark(function g3() { +var g3 = /*#__PURE__*/ regeneratorRuntime.mark(function g3() { return regeneratorRuntime.wrap(function g3$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck26_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck26_es5.1.normal.js index b178f7bc181..037c2b2f48c 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck26_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck26_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck27_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck27_es5.1.normal.js index 5ef58e634eb..67dcb43a28c 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck27_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck27_es5.1.normal.js @@ -1,11 +1,11 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck28_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck28_es5.1.normal.js index 8a6806aba58..f5f58e42145 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck28_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck28_es5.1.normal.js @@ -1,12 +1,12 @@ //@target: ES6 import _define_property from "@swc/helpers/src/_define_property.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_define_property({}, Symbol.iterator, regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_define_property({}, Symbol.iterator, /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck29_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck29_es5.1.normal.js index e36aacc803b..db6233f7b8b 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck29_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck29_es5.1.normal.js @@ -1,12 +1,12 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g2); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g2); function g2() { return regeneratorRuntime.wrap(function g2$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: _ctx.next = 2; - return regeneratorRuntime.mark(function _callee() { + return /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck2_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck2_es5.1.normal.js index e18a3153515..6b6cf1f0f80 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck2_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g1); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g1); function g1() { return regeneratorRuntime.wrap(function g1$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck30_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck30_es5.1.normal.js index e36aacc803b..db6233f7b8b 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck30_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck30_es5.1.normal.js @@ -1,12 +1,12 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g2); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g2); function g2() { return regeneratorRuntime.wrap(function g2$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: _ctx.next = 2; - return regeneratorRuntime.mark(function _callee() { + return /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck31_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck31_es5.1.normal.js index e36aacc803b..db6233f7b8b 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck31_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck31_es5.1.normal.js @@ -1,12 +1,12 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g2); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g2); function g2() { return regeneratorRuntime.wrap(function g2$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: _ctx.next = 2; - return regeneratorRuntime.mark(function _callee() { + return /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck33_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck33_es5.1.normal.js index 11c0ccce8b9..2084d95c950 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck33_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck33_es5.1.normal.js @@ -1,12 +1,12 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { var g2; return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - g2 = regeneratorRuntime.mark(function g2() { + g2 = /*#__PURE__*/ regeneratorRuntime.mark(function g2() { return regeneratorRuntime.wrap(function g2$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck34_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck34_es5.1.normal.js index c51cd74dc22..0958493cde9 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck34_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck34_es5.1.normal.js @@ -1,12 +1,12 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { var g2; return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - g2 = regeneratorRuntime.mark(function g2() { + g2 = /*#__PURE__*/ regeneratorRuntime.mark(function g2() { return regeneratorRuntime.wrap(function g2$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck35_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck35_es5.1.normal.js index 81120ffa96d..6b7ca0b8066 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck35_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck35_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { var g2; return regeneratorRuntime.wrap(function g$(_ctx) { diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck36_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck36_es5.1.normal.js index f6b129017d5..be9e74f7b2c 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck36_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck36_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck37_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck37_es5.1.normal.js index 1a8e01c7bef..3c4495521ab 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck37_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck37_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck3_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck3_es5.1.normal.js index e18a3153515..6b6cf1f0f80 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck3_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g1); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g1); function g1() { return regeneratorRuntime.wrap(function g1$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck40_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck40_es5.1.normal.js index 186c516534d..d4aac45c76a 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck40_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck40_es5.1.normal.js @@ -3,7 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _inherits from "@swc/helpers/src/_inherits.mjs"; import _create_super from "@swc/helpers/src/_create_super.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { var C; return regeneratorRuntime.wrap(function g$(_ctx) { diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck41_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck41_es5.1.normal.js index c89775bce7f..dc805c5db32 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck41_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck41_es5.1.normal.js @@ -1,7 +1,7 @@ //@target: ES6 import _define_property from "@swc/helpers/src/_define_property.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { var x; return regeneratorRuntime.wrap(function g$(_ctx) { diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck42_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck42_es5.1.normal.js index e43cc07620d..c83f00fd926 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck42_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck42_es5.1.normal.js @@ -1,7 +1,7 @@ //@target: ES6 import _define_property from "@swc/helpers/src/_define_property.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { var x; return regeneratorRuntime.wrap(function g$(_ctx) { diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck43_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck43_es5.1.normal.js index d1ff88d5d7d..e98124413a7 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck43_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck43_es5.1.normal.js @@ -1,7 +1,7 @@ //@target: ES6 import _define_property from "@swc/helpers/src/_define_property.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { var x; return regeneratorRuntime.wrap(function g$(_ctx) { @@ -13,7 +13,7 @@ function g() { return 0; case 4: _ctx.t2 = _ctx.sent; - _ctx.t3 = regeneratorRuntime.mark(function _callee() { + _ctx.t3 = /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck44_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck44_es5.1.normal.js index fd8b9649501..d4b0e62c90b 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck44_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck44_es5.1.normal.js @@ -1,7 +1,7 @@ //@target: ES6 import _define_enumerable_properties from "@swc/helpers/src/_define_enumerable_properties.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { var _obj, _mutatorMap, x; return regeneratorRuntime.wrap(function g$(_ctx) { diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck45_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck45_es5.1.normal.js index a1a17d70033..816f2ec46cb 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck45_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck45_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -foo("", regeneratorRuntime.mark(function _callee() { +foo("", /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck46_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck46_es5.1.normal.js index afa5608b48f..a1a234a798a 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck46_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck46_es5.1.normal.js @@ -1,11 +1,11 @@ //@target: ES6 import _define_property from "@swc/helpers/src/_define_property.mjs"; import regeneratorRuntime from "regenerator-runtime"; -foo("", regeneratorRuntime.mark(function _callee() { +foo("", /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_define_property({}, Symbol.iterator, regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_define_property({}, Symbol.iterator, /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck47_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck47_es5.1.normal.js index f09a3c9f3a6..62c13ab30c4 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck47_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck47_es5.1.normal.js @@ -1,7 +1,7 @@ //@target: ES6 //@noImplicitAny: true import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck48_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck48_es5.1.normal.js index 90a55bb74af..c8d25d08a59 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck48_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck48_es5.1.normal.js @@ -1,8 +1,8 @@ //@target: ES6 //@noImplicitAny: true import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(h); -var _marked1 = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(h); +var _marked1 = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck49_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck49_es5.1.normal.js index 9f5ab91119a..7053194ffeb 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck49_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck49_es5.1.normal.js @@ -1,7 +1,7 @@ //@target: ES6 //@noImplicitAny: true import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck4_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck4_es5.1.normal.js index e18a3153515..6b6cf1f0f80 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck4_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g1); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g1); function g1() { return regeneratorRuntime.wrap(function g1$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck50_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck50_es5.1.normal.js index 7eb4967200c..f33533e7fdd 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck50_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck50_es5.1.normal.js @@ -1,7 +1,7 @@ //@target: ES6 //@noImplicitAny: true import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck51_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck51_es5.1.normal.js index 50434db47d0..70a65ad4d0d 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck51_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck51_es5.1.normal.js @@ -1,13 +1,13 @@ //@target: ES6 //@noImplicitAny: true import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { var h; return regeneratorRuntime.wrap(function g$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - h = regeneratorRuntime.mark(function h() { + h = /*#__PURE__*/ regeneratorRuntime.mark(function h() { return regeneratorRuntime.wrap(function h$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck52_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck52_es5.1.normal.js index 1e885697751..f7fc79a749a 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck52_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck52_es5.1.normal.js @@ -1,7 +1,7 @@ //@target: ES6 import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck53_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck53_es5.1.normal.js index 4cbc96014c4..62acbef41bd 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck53_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck53_es5.1.normal.js @@ -1,7 +1,7 @@ //@target: ES6 import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck54_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck54_es5.1.normal.js index 0943cf4f5b6..9b89380e0ed 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck54_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck54_es5.1.normal.js @@ -1,7 +1,7 @@ //@target: ES6 import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck55_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck55_es5.1.normal.js index 4c4c1c14691..e7425daaf65 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck55_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck55_es5.1.normal.js @@ -3,7 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _inherits from "@swc/helpers/src/_inherits.mjs"; import _create_super from "@swc/helpers/src/_create_super.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { var x; return regeneratorRuntime.wrap(function g$(_ctx) { diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck56_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck56_es5.1.normal.js index 99ce564304a..87949c051b9 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck56_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck56_es5.1.normal.js @@ -1,7 +1,7 @@ //@target: ES6 import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { var x; return regeneratorRuntime.wrap(function g$(_ctx) { @@ -13,7 +13,7 @@ function g() { _class_call_check(this, C); } var _proto = C.prototype; - _proto[yield 0] = regeneratorRuntime.mark(function _callee() { + _proto[yield 0] = /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck5_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck5_es5.1.normal.js index e18a3153515..6b6cf1f0f80 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck5_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g1); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g1); function g1() { return regeneratorRuntime.wrap(function g1$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck60_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck60_es5.1.normal.js index 76c6548aec1..a3239aa312e 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck60_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck60_es5.1.normal.js @@ -3,7 +3,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _inherits from "@swc/helpers/src/_inherits.mjs"; import _create_super from "@swc/helpers/src/_create_super.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { var C; return regeneratorRuntime.wrap(function g$(_ctx) { diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck62_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck62_es5.1.normal.js index 824c45a83ba..22acb417520 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck62_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck62_es5.1.normal.js @@ -3,7 +3,7 @@ // @noImplicitAny: true import regeneratorRuntime from "regenerator-runtime"; export function strategy(stratName, gen) { - return regeneratorRuntime.mark(function _callee(state) { + return /*#__PURE__*/ regeneratorRuntime.mark(function _callee(state) { var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, next; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -71,7 +71,7 @@ export function strategy(stratName, gen) { ]); }); } -export var Nothing1 = strategy("Nothing", regeneratorRuntime.mark(function _callee(state) { +export var Nothing1 = strategy("Nothing", /*#__PURE__*/ regeneratorRuntime.mark(function _callee(state) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -82,7 +82,7 @@ export var Nothing1 = strategy("Nothing", regeneratorRuntime.mark(function _call } }, _callee); })); -export var Nothing2 = strategy("Nothing", regeneratorRuntime.mark(function _callee(state) { +export var Nothing2 = strategy("Nothing", /*#__PURE__*/ regeneratorRuntime.mark(function _callee(state) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -94,7 +94,7 @@ export var Nothing2 = strategy("Nothing", regeneratorRuntime.mark(function _call } }, _callee); })); -export var Nothing3 = strategy("Nothing", regeneratorRuntime.mark(function _callee(state) { +export var Nothing3 = strategy("Nothing", /*#__PURE__*/ regeneratorRuntime.mark(function _callee(state) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck63_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck63_es5.1.normal.js index b8900b1bcd3..335d0cf8951 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck63_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck63_es5.1.normal.js @@ -3,7 +3,7 @@ // @noImplicitAny: true import regeneratorRuntime from "regenerator-runtime"; export function strategy(stratName, gen) { - return regeneratorRuntime.mark(function _callee(state) { + return /*#__PURE__*/ regeneratorRuntime.mark(function _callee(state) { var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, next; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -71,7 +71,7 @@ export function strategy(stratName, gen) { ]); }); } -export var Nothing = strategy("Nothing", regeneratorRuntime.mark(function _callee(state) { +export var Nothing = strategy("Nothing", /*#__PURE__*/ regeneratorRuntime.mark(function _callee(state) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -85,7 +85,7 @@ export var Nothing = strategy("Nothing", regeneratorRuntime.mark(function _calle } }, _callee); })); -export var Nothing1 = strategy("Nothing", regeneratorRuntime.mark(function _callee(state) { +export var Nothing1 = strategy("Nothing", /*#__PURE__*/ regeneratorRuntime.mark(function _callee(state) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -94,7 +94,7 @@ export var Nothing1 = strategy("Nothing", regeneratorRuntime.mark(function _call } }, _callee); })); -export var Nothing2 = strategy("Nothing", regeneratorRuntime.mark(function _callee(state) { +export var Nothing2 = strategy("Nothing", /*#__PURE__*/ regeneratorRuntime.mark(function _callee(state) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -105,7 +105,7 @@ export var Nothing2 = strategy("Nothing", regeneratorRuntime.mark(function _call } }, _callee); })); -export var Nothing3 = strategy("Nothing", regeneratorRuntime.mark(function _callee(state) { +export var Nothing3 = strategy("Nothing", /*#__PURE__*/ regeneratorRuntime.mark(function _callee(state) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck6_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck6_es5.1.normal.js index e18a3153515..6b6cf1f0f80 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck6_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g1); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g1); function g1() { return regeneratorRuntime.wrap(function g1$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck7_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck7_es5.1.normal.js index e18a3153515..6b6cf1f0f80 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck7_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck7_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g1); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g1); function g1() { return regeneratorRuntime.wrap(function g1$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck8_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck8_es5.1.normal.js index 8eecd5c30a2..ae6b10131cf 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck8_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck8_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g3); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g3); function g3() { return regeneratorRuntime.wrap(function g3$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck9_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck9_es5.1.normal.js index 8eecd5c30a2..ae6b10131cf 100644 --- a/crates/swc/tests/tsc-references/generatorTypeCheck9_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorTypeCheck9_es5.1.normal.js @@ -1,6 +1,6 @@ //@target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g3); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g3); function g3() { return regeneratorRuntime.wrap(function g3$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/generatorYieldContextualType_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorYieldContextualType_es2015.1.normal.js index 70339da3222..ab60cbb3282 100644 --- a/crates/swc/tests/tsc-references/generatorYieldContextualType_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorYieldContextualType_es2015.1.normal.js @@ -6,7 +6,7 @@ f1(function*() { const a = yield 0; return 0; }); -f2(_wrap_async_generator(function*() { +f2(/*#__PURE__*/ _wrap_async_generator(function*() { const a = yield 0; return 0; })); diff --git a/crates/swc/tests/tsc-references/generatorYieldContextualType_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorYieldContextualType_es5.1.normal.js index 934ae17207e..965cf73a6ca 100644 --- a/crates/swc/tests/tsc-references/generatorYieldContextualType_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/generatorYieldContextualType_es5.1.normal.js @@ -3,7 +3,7 @@ // @noEmit: true import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -f1(regeneratorRuntime.mark(function _callee() { +f1(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var a; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -19,7 +19,7 @@ f1(regeneratorRuntime.mark(function _callee() { } }, _callee); })); -f2(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { +f2(/*#__PURE__*/ _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var a; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpression3ES2020_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpression3ES2020_es5.1.normal.js index d4aedb7dc44..0f7bb8095dd 100644 --- a/crates/swc/tests/tsc-references/importCallExpression3ES2020_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpression3ES2020_es5.1.normal.js @@ -23,7 +23,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var C, c; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.1.normal.js index b507d5e5986..d5ea21bd52e 100644 --- a/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.1.normal.js @@ -37,7 +37,7 @@ var C = /*#__PURE__*/ function() { this.myModule.then(function(Zero) { console.log(Zero.foo()); }, function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(err) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(err) { var one; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.2.minified.js index 197709aa234..4fc509ea76d 100644 --- a/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.2.minified.js @@ -20,7 +20,7 @@ import regeneratorRuntime from "regenerator-runtime"; var C = function() { "use strict"; function C() { - _class_call_check(this, C), this.myModule = import("./0"); + this.myModule = import("./0"); } return C.prototype.method = function() { var _ref; diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES2020_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES2020_es2015.1.normal.js index e11dc2d667c..0f87f6bef16 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES2020_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES2020_es2015.1.normal.js @@ -21,7 +21,7 @@ export class cl1 { } } export const obj = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // THREE ; }) @@ -29,7 +29,7 @@ export const obj = { export class cl2 { constructor(){ this.p = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // FOUR ; }) diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES2020_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES2020_es5.1.normal.js index 4e10d6fb578..9d6b1ece340 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES2020_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES2020_es5.1.normal.js @@ -8,7 +8,7 @@ export function fn() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -33,7 +33,7 @@ export var cl1 = /*#__PURE__*/ function() { } var _proto = cl1.prototype; _proto.m = function m() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -53,7 +53,7 @@ export var cl1 = /*#__PURE__*/ function() { return cl1; }(); export var obj = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -74,7 +74,7 @@ export var cl2 = function cl2() { "use strict"; _class_call_check(this, cl2); this.p = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -93,7 +93,7 @@ export var cl2 = function cl2() { }; }; export var l = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES2020_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES2020_es5.2.minified.js index 1682d7098ae..d7caac3b781 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES2020_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES2020_es5.2.minified.js @@ -22,9 +22,7 @@ function _fn() { } export var cl1 = function() { "use strict"; - function cl1() { - _class_call_check(this, cl1); - } + function cl1() {} return cl1.prototype.m = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; @@ -60,7 +58,7 @@ export var obj = { }; export var cl2 = function() { "use strict"; - _class_call_check(this, cl2), this.p = { + this.p = { m: _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3AMD_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3AMD_es2015.1.normal.js index b9492fd98b6..425849b3354 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3AMD_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3AMD_es2015.1.normal.js @@ -22,7 +22,7 @@ export class cl1 { } } export const obj = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // THREE ; }) @@ -30,7 +30,7 @@ export const obj = { export class cl2 { constructor(){ this.p = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // FOUR ; }) diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3AMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3AMD_es5.1.normal.js index c123c811abc..6ca3e5496c8 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3AMD_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3AMD_es5.1.normal.js @@ -9,7 +9,7 @@ export function fn() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -34,7 +34,7 @@ export var cl1 = /*#__PURE__*/ function() { } var _proto = cl1.prototype; _proto.m = function m() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -54,7 +54,7 @@ export var cl1 = /*#__PURE__*/ function() { return cl1; }(); export var obj = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -75,7 +75,7 @@ export var cl2 = function cl2() { "use strict"; _class_call_check(this, cl2); this.p = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -94,7 +94,7 @@ export var cl2 = function cl2() { }; }; export var l = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3AMD_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3AMD_es5.2.minified.js index 1682d7098ae..d7caac3b781 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3AMD_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3AMD_es5.2.minified.js @@ -22,9 +22,7 @@ function _fn() { } export var cl1 = function() { "use strict"; - function cl1() { - _class_call_check(this, cl1); - } + function cl1() {} return cl1.prototype.m = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; @@ -60,7 +58,7 @@ export var obj = { }; export var cl2 = function() { "use strict"; - _class_call_check(this, cl2), this.p = { + this.p = { m: _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3CJS_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3CJS_es2015.1.normal.js index c45b3131fec..1c23cb3b5d5 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3CJS_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3CJS_es2015.1.normal.js @@ -22,7 +22,7 @@ export class cl1 { } } export const obj = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // THREE ; }) @@ -30,7 +30,7 @@ export const obj = { export class cl2 { constructor(){ this.p = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // FOUR ; }) diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3CJS_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3CJS_es5.1.normal.js index e5dad133488..fea7f6f56cc 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3CJS_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3CJS_es5.1.normal.js @@ -9,7 +9,7 @@ export function fn() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -34,7 +34,7 @@ export var cl1 = /*#__PURE__*/ function() { } var _proto = cl1.prototype; _proto.m = function m() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -54,7 +54,7 @@ export var cl1 = /*#__PURE__*/ function() { return cl1; }(); export var obj = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -75,7 +75,7 @@ export var cl2 = function cl2() { "use strict"; _class_call_check(this, cl2); this.p = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -94,7 +94,7 @@ export var cl2 = function cl2() { }; }; export var l = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3CJS_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3CJS_es5.2.minified.js index 1682d7098ae..d7caac3b781 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3CJS_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3CJS_es5.2.minified.js @@ -22,9 +22,7 @@ function _fn() { } export var cl1 = function() { "use strict"; - function cl1() { - _class_call_check(this, cl1); - } + function cl1() {} return cl1.prototype.m = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; @@ -60,7 +58,7 @@ export var obj = { }; export var cl2 = function() { "use strict"; - _class_call_check(this, cl2), this.p = { + this.p = { m: _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3System_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3System_es2015.1.normal.js index b37e6601da9..b5515e39d1e 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3System_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3System_es2015.1.normal.js @@ -22,7 +22,7 @@ export class cl1 { } } export const obj = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // THREE ; }) @@ -30,7 +30,7 @@ export const obj = { export class cl2 { constructor(){ this.p = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // FOUR ; }) diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3System_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3System_es5.1.normal.js index ed9cda6130e..39d198a1423 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3System_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3System_es5.1.normal.js @@ -9,7 +9,7 @@ export function fn() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -34,7 +34,7 @@ export var cl1 = /*#__PURE__*/ function() { } var _proto = cl1.prototype; _proto.m = function m() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -54,7 +54,7 @@ export var cl1 = /*#__PURE__*/ function() { return cl1; }(); export var obj = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -75,7 +75,7 @@ export var cl2 = function cl2() { "use strict"; _class_call_check(this, cl2); this.p = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -94,7 +94,7 @@ export var cl2 = function cl2() { }; }; export var l = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3System_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3System_es5.2.minified.js index 1682d7098ae..d7caac3b781 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3System_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3System_es5.2.minified.js @@ -22,9 +22,7 @@ function _fn() { } export var cl1 = function() { "use strict"; - function cl1() { - _class_call_check(this, cl1); - } + function cl1() {} return cl1.prototype.m = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; @@ -60,7 +58,7 @@ export var obj = { }; export var cl2 = function() { "use strict"; - _class_call_check(this, cl2), this.p = { + this.p = { m: _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3UMD_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3UMD_es2015.1.normal.js index a314603a808..2733d398cad 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3UMD_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3UMD_es2015.1.normal.js @@ -22,7 +22,7 @@ export class cl1 { } } export const obj = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // THREE ; }) @@ -30,7 +30,7 @@ export const obj = { export class cl2 { constructor(){ this.p = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // FOUR ; }) diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3UMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3UMD_es5.1.normal.js index a351b1189d5..05a50730efb 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3UMD_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3UMD_es5.1.normal.js @@ -9,7 +9,7 @@ export function fn() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -34,7 +34,7 @@ export var cl1 = /*#__PURE__*/ function() { } var _proto = cl1.prototype; _proto.m = function m() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -54,7 +54,7 @@ export var cl1 = /*#__PURE__*/ function() { return cl1; }(); export var obj = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -75,7 +75,7 @@ export var cl2 = function cl2() { "use strict"; _class_call_check(this, cl2); this.p = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -94,7 +94,7 @@ export var cl2 = function cl2() { }; }; export var l = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3UMD_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3UMD_es5.2.minified.js index 1682d7098ae..d7caac3b781 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES3UMD_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES3UMD_es5.2.minified.js @@ -22,9 +22,7 @@ function _fn() { } export var cl1 = function() { "use strict"; - function cl1() { - _class_call_check(this, cl1); - } + function cl1() {} return cl1.prototype.m = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; @@ -60,7 +58,7 @@ export var obj = { }; export var cl2 = function() { "use strict"; - _class_call_check(this, cl2), this.p = { + this.p = { m: _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5AMD_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5AMD_es2015.1.normal.js index 659d688a336..fc6fb7b9382 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5AMD_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5AMD_es2015.1.normal.js @@ -22,7 +22,7 @@ export class cl1 { } } export const obj = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // THREE ; }) @@ -30,7 +30,7 @@ export const obj = { export class cl2 { constructor(){ this.p = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // FOUR ; }) diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5AMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5AMD_es5.1.normal.js index 566e5437e8a..0c753ee5b6d 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5AMD_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5AMD_es5.1.normal.js @@ -9,7 +9,7 @@ export function fn() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -34,7 +34,7 @@ export var cl1 = /*#__PURE__*/ function() { } var _proto = cl1.prototype; _proto.m = function m() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -54,7 +54,7 @@ export var cl1 = /*#__PURE__*/ function() { return cl1; }(); export var obj = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -75,7 +75,7 @@ export var cl2 = function cl2() { "use strict"; _class_call_check(this, cl2); this.p = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -94,7 +94,7 @@ export var cl2 = function cl2() { }; }; export var l = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5AMD_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5AMD_es5.2.minified.js index 1682d7098ae..d7caac3b781 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5AMD_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5AMD_es5.2.minified.js @@ -22,9 +22,7 @@ function _fn() { } export var cl1 = function() { "use strict"; - function cl1() { - _class_call_check(this, cl1); - } + function cl1() {} return cl1.prototype.m = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; @@ -60,7 +58,7 @@ export var obj = { }; export var cl2 = function() { "use strict"; - _class_call_check(this, cl2), this.p = { + this.p = { m: _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5CJS_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5CJS_es2015.1.normal.js index ded22ce7db9..d16bf083f99 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5CJS_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5CJS_es2015.1.normal.js @@ -22,7 +22,7 @@ export class cl1 { } } export const obj = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // THREE ; }) @@ -30,7 +30,7 @@ export const obj = { export class cl2 { constructor(){ this.p = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // FOUR ; }) diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5CJS_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5CJS_es5.1.normal.js index 0e9cca5cc27..b1d6f650db0 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5CJS_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5CJS_es5.1.normal.js @@ -9,7 +9,7 @@ export function fn() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -34,7 +34,7 @@ export var cl1 = /*#__PURE__*/ function() { } var _proto = cl1.prototype; _proto.m = function m() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -54,7 +54,7 @@ export var cl1 = /*#__PURE__*/ function() { return cl1; }(); export var obj = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -75,7 +75,7 @@ export var cl2 = function cl2() { "use strict"; _class_call_check(this, cl2); this.p = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -94,7 +94,7 @@ export var cl2 = function cl2() { }; }; export var l = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5CJS_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5CJS_es5.2.minified.js index 1682d7098ae..d7caac3b781 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5CJS_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5CJS_es5.2.minified.js @@ -22,9 +22,7 @@ function _fn() { } export var cl1 = function() { "use strict"; - function cl1() { - _class_call_check(this, cl1); - } + function cl1() {} return cl1.prototype.m = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; @@ -60,7 +58,7 @@ export var obj = { }; export var cl2 = function() { "use strict"; - _class_call_check(this, cl2), this.p = { + this.p = { m: _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System_es2015.1.normal.js index 8dbbcfbe489..c12afd28507 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System_es2015.1.normal.js @@ -22,7 +22,7 @@ export class cl1 { } } export const obj = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // THREE ; }) @@ -30,7 +30,7 @@ export const obj = { export class cl2 { constructor(){ this.p = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // FOUR ; }) diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System_es5.1.normal.js index 4d6b4f85906..fcc0e1a3bf7 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System_es5.1.normal.js @@ -9,7 +9,7 @@ export function fn() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -34,7 +34,7 @@ export var cl1 = /*#__PURE__*/ function() { } var _proto = cl1.prototype; _proto.m = function m() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -54,7 +54,7 @@ export var cl1 = /*#__PURE__*/ function() { return cl1; }(); export var obj = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -75,7 +75,7 @@ export var cl2 = function cl2() { "use strict"; _class_call_check(this, cl2); this.p = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -94,7 +94,7 @@ export var cl2 = function cl2() { }; }; export var l = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System_es5.2.minified.js index 1682d7098ae..d7caac3b781 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System_es5.2.minified.js @@ -22,9 +22,7 @@ function _fn() { } export var cl1 = function() { "use strict"; - function cl1() { - _class_call_check(this, cl1); - } + function cl1() {} return cl1.prototype.m = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; @@ -60,7 +58,7 @@ export var obj = { }; export var cl2 = function() { "use strict"; - _class_call_check(this, cl2), this.p = { + this.p = { m: _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD_es2015.1.normal.js index b18761451a1..118104925ea 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD_es2015.1.normal.js @@ -22,7 +22,7 @@ export class cl1 { } } export const obj = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // THREE ; }) @@ -30,7 +30,7 @@ export const obj = { export class cl2 { constructor(){ this.p = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // FOUR ; }) diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD_es5.1.normal.js index 177057dbb53..86a68b6e155 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD_es5.1.normal.js @@ -9,7 +9,7 @@ export function fn() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -34,7 +34,7 @@ export var cl1 = /*#__PURE__*/ function() { } var _proto = cl1.prototype; _proto.m = function m() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -54,7 +54,7 @@ export var cl1 = /*#__PURE__*/ function() { return cl1; }(); export var obj = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -75,7 +75,7 @@ export var cl2 = function cl2() { "use strict"; _class_call_check(this, cl2); this.p = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -94,7 +94,7 @@ export var cl2 = function cl2() { }; }; export var l = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD_es5.2.minified.js index 1682d7098ae..d7caac3b781 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD_es5.2.minified.js @@ -22,9 +22,7 @@ function _fn() { } export var cl1 = function() { "use strict"; - function cl1() { - _class_call_check(this, cl1); - } + function cl1() {} return cl1.prototype.m = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; @@ -60,7 +58,7 @@ export var obj = { }; export var cl2 = function() { "use strict"; - _class_call_check(this, cl2), this.p = { + this.p = { m: _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6AMD_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6AMD_es2015.1.normal.js index 36f5aa17872..1b0a4102cdc 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6AMD_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6AMD_es2015.1.normal.js @@ -21,7 +21,7 @@ export class cl1 { } } export const obj = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // THREE ; }) @@ -29,7 +29,7 @@ export const obj = { export class cl2 { constructor(){ this.p = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // FOUR ; }) diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6AMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6AMD_es5.1.normal.js index 108990e74c9..82f435e4502 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6AMD_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6AMD_es5.1.normal.js @@ -8,7 +8,7 @@ export function fn() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -33,7 +33,7 @@ export var cl1 = /*#__PURE__*/ function() { } var _proto = cl1.prototype; _proto.m = function m() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -53,7 +53,7 @@ export var cl1 = /*#__PURE__*/ function() { return cl1; }(); export var obj = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -74,7 +74,7 @@ export var cl2 = function cl2() { "use strict"; _class_call_check(this, cl2); this.p = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -93,7 +93,7 @@ export var cl2 = function cl2() { }; }; export var l = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6AMD_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6AMD_es5.2.minified.js index 1682d7098ae..d7caac3b781 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6AMD_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6AMD_es5.2.minified.js @@ -22,9 +22,7 @@ function _fn() { } export var cl1 = function() { "use strict"; - function cl1() { - _class_call_check(this, cl1); - } + function cl1() {} return cl1.prototype.m = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; @@ -60,7 +58,7 @@ export var obj = { }; export var cl2 = function() { "use strict"; - _class_call_check(this, cl2), this.p = { + this.p = { m: _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6CJS_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6CJS_es2015.1.normal.js index 1f0aeb5bd16..6c8ad07e1ac 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6CJS_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6CJS_es2015.1.normal.js @@ -21,7 +21,7 @@ export class cl1 { } } export const obj = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // THREE ; }) @@ -29,7 +29,7 @@ export const obj = { export class cl2 { constructor(){ this.p = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // FOUR ; }) diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6CJS_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6CJS_es5.1.normal.js index 72b021fbca9..68730563251 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6CJS_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6CJS_es5.1.normal.js @@ -8,7 +8,7 @@ export function fn() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -33,7 +33,7 @@ export var cl1 = /*#__PURE__*/ function() { } var _proto = cl1.prototype; _proto.m = function m() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -53,7 +53,7 @@ export var cl1 = /*#__PURE__*/ function() { return cl1; }(); export var obj = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -74,7 +74,7 @@ export var cl2 = function cl2() { "use strict"; _class_call_check(this, cl2); this.p = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -93,7 +93,7 @@ export var cl2 = function cl2() { }; }; export var l = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6CJS_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6CJS_es5.2.minified.js index 1682d7098ae..d7caac3b781 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6CJS_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6CJS_es5.2.minified.js @@ -22,9 +22,7 @@ function _fn() { } export var cl1 = function() { "use strict"; - function cl1() { - _class_call_check(this, cl1); - } + function cl1() {} return cl1.prototype.m = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; @@ -60,7 +58,7 @@ export var obj = { }; export var cl2 = function() { "use strict"; - _class_call_check(this, cl2), this.p = { + this.p = { m: _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6System_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6System_es2015.1.normal.js index eb633921a8b..40894339bfb 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6System_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6System_es2015.1.normal.js @@ -21,7 +21,7 @@ export class cl1 { } } export const obj = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // THREE ; }) @@ -29,7 +29,7 @@ export const obj = { export class cl2 { constructor(){ this.p = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // FOUR ; }) diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6System_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6System_es5.1.normal.js index 77388c4bec3..275d82a6ab3 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6System_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6System_es5.1.normal.js @@ -8,7 +8,7 @@ export function fn() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -33,7 +33,7 @@ export var cl1 = /*#__PURE__*/ function() { } var _proto = cl1.prototype; _proto.m = function m() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -53,7 +53,7 @@ export var cl1 = /*#__PURE__*/ function() { return cl1; }(); export var obj = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -74,7 +74,7 @@ export var cl2 = function cl2() { "use strict"; _class_call_check(this, cl2); this.p = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -93,7 +93,7 @@ export var cl2 = function cl2() { }; }; export var l = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6System_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6System_es5.2.minified.js index 1682d7098ae..d7caac3b781 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6System_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6System_es5.2.minified.js @@ -22,9 +22,7 @@ function _fn() { } export var cl1 = function() { "use strict"; - function cl1() { - _class_call_check(this, cl1); - } + function cl1() {} return cl1.prototype.m = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; @@ -60,7 +58,7 @@ export var obj = { }; export var cl2 = function() { "use strict"; - _class_call_check(this, cl2), this.p = { + this.p = { m: _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6UMD_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6UMD_es2015.1.normal.js index 58c3620c0fd..7dfad29ae35 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6UMD_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6UMD_es2015.1.normal.js @@ -21,7 +21,7 @@ export class cl1 { } } export const obj = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // THREE ; }) @@ -29,7 +29,7 @@ export const obj = { export class cl2 { constructor(){ this.p = { - m: _async_to_generator(function*() { + m: /*#__PURE__*/ _async_to_generator(function*() { const req = yield import('./test') // FOUR ; }) diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6UMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6UMD_es5.1.normal.js index cf8b907c686..536a8416a66 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6UMD_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6UMD_es5.1.normal.js @@ -8,7 +8,7 @@ export function fn() { return _fn.apply(this, arguments); } function _fn() { - _fn = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _fn = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -33,7 +33,7 @@ export var cl1 = /*#__PURE__*/ function() { } var _proto = cl1.prototype; _proto.m = function m() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -53,7 +53,7 @@ export var cl1 = /*#__PURE__*/ function() { return cl1; }(); export var obj = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -74,7 +74,7 @@ export var cl2 = function cl2() { "use strict"; _class_call_check(this, cl2); this.p = { - m: _async_to_generator(regeneratorRuntime.mark(function _callee() { + m: /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -93,7 +93,7 @@ export var cl2 = function cl2() { }; }; export var l = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6UMD_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6UMD_es5.2.minified.js index 1682d7098ae..d7caac3b781 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES6UMD_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES6UMD_es5.2.minified.js @@ -22,9 +22,7 @@ function _fn() { } export var cl1 = function() { "use strict"; - function cl1() { - _class_call_check(this, cl1); - } + function cl1() {} return cl1.prototype.m = function() { return _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; @@ -60,7 +58,7 @@ export var obj = { }; export var cl2 = function() { "use strict"; - _class_call_check(this, cl2), this.p = { + this.p = { m: _async_to_generator(regeneratorRuntime.mark(function _callee() { var req; return regeneratorRuntime.wrap(function(_ctx) { diff --git a/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es5.1.normal.js index 244d61e144d..8d6622d5ee7 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es5.1.normal.js @@ -23,7 +23,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var C, c; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.1.normal.js index 5c45b04c7f3..81c1c203e7d 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.1.normal.js @@ -37,7 +37,7 @@ var C = /*#__PURE__*/ function() { this.myModule.then(function(Zero) { console.log(Zero.foo()); }, function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(err) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(err) { var one; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -73,7 +73,7 @@ export var D = /*#__PURE__*/ function() { this.myModule.then(function(Zero) { console.log(Zero.foo()); }, function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(err) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(err) { var one; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.2.minified.js index e3d755642f7..7a3eed298f8 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.2.minified.js @@ -20,7 +20,7 @@ import regeneratorRuntime from "regenerator-runtime"; var C = function() { "use strict"; function C() { - _class_call_check(this, C), this.myModule = import("./0"); + this.myModule = import("./0"); } return C.prototype.method = function() { var _ref; @@ -47,7 +47,7 @@ var C = function() { export var D = function() { "use strict"; function D() { - _class_call_check(this, D), this.myModule = import("./0"); + this.myModule = import("./0"); } return D.prototype.method = function() { var _ref; diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es5.1.normal.js index 092434018b3..e7e1a9b2675 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es5.1.normal.js @@ -15,7 +15,7 @@ function compute(promise) { return _compute.apply(this, arguments); } function _compute() { - _compute = _async_to_generator(regeneratorRuntime.mark(function _callee(promise) { + _compute = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(promise) { var j; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es5.1.normal.js index 2e5d854f91e..7c12b107f9c 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es5.1.normal.js @@ -23,7 +23,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var C, c; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.1.normal.js index fd4780abf88..7ea5fe1f260 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.1.normal.js @@ -37,7 +37,7 @@ var C = /*#__PURE__*/ function() { this.myModule.then(function(Zero) { console.log(Zero.foo()); }, function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(err) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(err) { var one; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -73,7 +73,7 @@ export var D = /*#__PURE__*/ function() { this.myModule.then(function(Zero) { console.log(Zero.foo()); }, function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(err) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(err) { var one; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.2.minified.js index e3d755642f7..7a3eed298f8 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.2.minified.js @@ -20,7 +20,7 @@ import regeneratorRuntime from "regenerator-runtime"; var C = function() { "use strict"; function C() { - _class_call_check(this, C), this.myModule = import("./0"); + this.myModule = import("./0"); } return C.prototype.method = function() { var _ref; @@ -47,7 +47,7 @@ var C = function() { export var D = function() { "use strict"; function D() { - _class_call_check(this, D), this.myModule = import("./0"); + this.myModule = import("./0"); } return D.prototype.method = function() { var _ref; diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es2015.1.normal.js index e04cd5894bc..48f996eee5b 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es2015.1.normal.js @@ -5,7 +5,7 @@ module.exports = 42; export { }; // @filename: index.ts import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -module.exports = _async_to_generator(function*() { +module.exports = /*#__PURE__*/ _async_to_generator(function*() { const something = yield import("./something"); }); export { }; diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es5.1.normal.js index d0d229e6a52..a38e5bdf5a8 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es5.1.normal.js @@ -6,7 +6,7 @@ export { }; // @filename: index.ts import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -module.exports = _async_to_generator(regeneratorRuntime.mark(function _callee() { +module.exports = /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var something; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es2015.1.normal.js index 6422c9be936..a9192a78e88 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es2015.1.normal.js @@ -5,7 +5,7 @@ module.exports = 42; export { }; // @filename: index.ts import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -module.exports = _async_to_generator(function*() { +module.exports = /*#__PURE__*/ _async_to_generator(function*() { const something = yield import("./something"); }); export { }; diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es5.1.normal.js index 5991266b90c..c521cd1d08d 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es5.1.normal.js @@ -6,7 +6,7 @@ export { }; // @filename: index.ts import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -module.exports = _async_to_generator(regeneratorRuntime.mark(function _callee() { +module.exports = /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var something; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es2015.1.normal.js index 507b6349d53..0f4e4d35df6 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es2015.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es2015.1.normal.js @@ -5,7 +5,7 @@ module.exports = 42; export { }; // @filename: index.ts import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -module.exports = _async_to_generator(function*() { +module.exports = /*#__PURE__*/ _async_to_generator(function*() { const something = yield import("./something"); }); export { }; diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es5.1.normal.js index f39fe9c8fa2..3d9a1c41edf 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es5.1.normal.js @@ -6,7 +6,7 @@ export { }; // @filename: index.ts import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -module.exports = _async_to_generator(regeneratorRuntime.mark(function _callee() { +module.exports = /*#__PURE__*/ _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var something; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es5.1.normal.js index 586ced3e69b..6e5f166c426 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es5.1.normal.js @@ -23,7 +23,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var C, c; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.1.normal.js index dc7e667d781..b608ea9201b 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.1.normal.js @@ -37,7 +37,7 @@ var C = /*#__PURE__*/ function() { this.myModule.then(function(Zero) { console.log(Zero.foo()); }, function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(err) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(err) { var one; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -73,7 +73,7 @@ export var D = /*#__PURE__*/ function() { this.myModule.then(function(Zero) { console.log(Zero.foo()); }, function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(err) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(err) { var one; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.2.minified.js index e3d755642f7..7a3eed298f8 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.2.minified.js @@ -20,7 +20,7 @@ import regeneratorRuntime from "regenerator-runtime"; var C = function() { "use strict"; function C() { - _class_call_check(this, C), this.myModule = import("./0"); + this.myModule = import("./0"); } return C.prototype.method = function() { var _ref; @@ -47,7 +47,7 @@ var C = function() { export var D = function() { "use strict"; function D() { - _class_call_check(this, D), this.myModule = import("./0"); + this.myModule = import("./0"); } return D.prototype.method = function() { var _ref; diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es5.1.normal.js index 65597344837..1dcd6424e0a 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es5.1.normal.js @@ -23,7 +23,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var C, c; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.1.normal.js index 8161591baa5..1eada77e526 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.1.normal.js @@ -37,7 +37,7 @@ var C = /*#__PURE__*/ function() { this.myModule.then(function(Zero) { console.log(Zero.foo()); }, function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(err) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(err) { var one; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -73,7 +73,7 @@ export var D = /*#__PURE__*/ function() { this.myModule.then(function(Zero) { console.log(Zero.foo()); }, function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(err) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(err) { var one; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.2.minified.js index e3d755642f7..7a3eed298f8 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.2.minified.js @@ -20,7 +20,7 @@ import regeneratorRuntime from "regenerator-runtime"; var C = function() { "use strict"; function C() { - _class_call_check(this, C), this.myModule = import("./0"); + this.myModule = import("./0"); } return C.prototype.method = function() { var _ref; @@ -47,7 +47,7 @@ var C = function() { export var D = function() { "use strict"; function D() { - _class_call_check(this, D), this.myModule = import("./0"); + this.myModule = import("./0"); } return D.prototype.method = function() { var _ref; diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es5.1.normal.js index c20d640f642..673566358d2 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es5.1.normal.js @@ -12,7 +12,7 @@ function func() { return _func.apply(this, arguments); } function _func() { - _func = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _func = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var packageName, packageJson; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es5.1.normal.js index 10c3fac3b8c..db2560b7819 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es5.1.normal.js @@ -11,7 +11,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es5.1.normal.js index a86847cb51c..98eaf9dbd12 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es5.1.normal.js @@ -11,7 +11,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es5.1.normal.js index e22db33d4ed..41465ce3dc6 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es5.1.normal.js @@ -11,7 +11,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es5.1.normal.js index 11151d6c9e4..4bc5ffbfaf1 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es5.1.normal.js @@ -11,7 +11,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es5.1.normal.js index f353106d9d8..d346662e024 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es5.1.normal.js @@ -11,7 +11,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es5.1.normal.js index 46f12fb39df..0c23aaa03ab 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es5.1.normal.js @@ -11,7 +11,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es5.1.normal.js index 762832b4807..a54f186b018 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es5.1.normal.js @@ -11,7 +11,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es5.1.normal.js index 341e2f00988..d19dc52e654 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es5.1.normal.js @@ -11,7 +11,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es5.1.normal.js index 2dbb80a0d0b..37cad87a2ac 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es5.1.normal.js @@ -11,7 +11,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es5.1.normal.js index 0374ac81ae3..207415b798c 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es5.1.normal.js @@ -11,7 +11,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es5.1.normal.js index c7d9fff4639..9cf71c99cf4 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es5.1.normal.js @@ -11,7 +11,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es5.1.normal.js index 1dbc5084879..483354521c4 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es5.1.normal.js @@ -11,7 +11,7 @@ function foo() { return _foo.apply(this, arguments); } function _foo() { - _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _foo = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.1.normal.js index ab990c23475..ea5d167df96 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.1.normal.js @@ -35,7 +35,7 @@ var C = /*#__PURE__*/ function() { this.myModule.then(function(Zero) { console.log(Zero.foo()); }, function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(err) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(err) { var one; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.2.minified.js index 197709aa234..4fc509ea76d 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.2.minified.js @@ -20,7 +20,7 @@ import regeneratorRuntime from "regenerator-runtime"; var C = function() { "use strict"; function C() { - _class_call_check(this, C), this.myModule = import("./0"); + this.myModule = import("./0"); } return C.prototype.method = function() { var _ref; diff --git a/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es5.1.normal.js index ca9b18d56cc..45edb7d57c2 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es5.1.normal.js @@ -9,7 +9,7 @@ export var C = function C() { }; // @filename: 1.ts import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(loadModule); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(loadModule); import("".concat(directory, "\\").concat(moduleFile)); import(getSpecifier()); var p1 = import(ValidSomeCondition() ? "./0" : "externalModule"); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.1.normal.js index 7ec252cd17e..71a9d879e43 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.1.normal.js @@ -41,7 +41,7 @@ export var Argument = /*#__PURE__*/ function(Base) { var _proto = Argument.prototype; /** * @param {*} defs - */ _proto.validate = regeneratorRuntime.mark(function validate(defs) { + */ _proto.validate = /*#__PURE__*/ regeneratorRuntime.mark(function validate(defs) { return regeneratorRuntime.wrap(function validate$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/jsDeclarationsNestedParams_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsNestedParams_es5.1.normal.js index 53e3f50dc1d..9f58e46583d 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsNestedParams_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsNestedParams_es5.1.normal.js @@ -21,7 +21,7 @@ var X = /*#__PURE__*/ function() { * @returns {Promise.<*>} resolves when the event has been sent. */ _proto.cancel = function cancel(param) { var reason = param.reason, code = param.code; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -49,7 +49,7 @@ var Y = /*#__PURE__*/ function() { * @returns {Promise.<*>} resolves when the event has been sent. */ _proto.cancel = function cancel(param) { var reason = param.reason, suberr = param.suberr; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperatorInAsyncGenerator_es5.1.normal.js b/crates/swc/tests/tsc-references/nullishCoalescingOperatorInAsyncGenerator_es5.1.normal.js index c5d93e501dd..fbdfb1a95b5 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperatorInAsyncGenerator_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperatorInAsyncGenerator_es5.1.normal.js @@ -9,7 +9,7 @@ function f(a) { return _f.apply(this, arguments); } function _f() { - _f = _wrap_async_generator(regeneratorRuntime.mark(function _callee(a) { + _f = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(a) { var _b, c; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/objectRest2_es5.1.normal.js b/crates/swc/tests/tsc-references/objectRest2_es5.1.normal.js index 0820773884a..2dab29a27d2 100644 --- a/crates/swc/tests/tsc-references/objectRest2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRest2_es5.1.normal.js @@ -7,7 +7,7 @@ import regeneratorRuntime from "regenerator-runtime"; function rootConnection(name) { return { resolve: function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(context, args) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(context, args) { var objects; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression7_es5.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression7_es5.1.normal.js index 66317f8e422..e114689b063 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression7_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression7_es5.1.normal.js @@ -3,7 +3,7 @@ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; ({ m: function m() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/privateNameMethodAsync_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNameMethodAsync_es5.1.normal.js index 4c15eb5552e..ae459532e3f 100644 --- a/crates/swc/tests/tsc-references/privateNameMethodAsync_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameMethodAsync_es5.1.normal.js @@ -6,7 +6,7 @@ import _class_private_method_get from "@swc/helpers/src/_class_private_method_ge import _class_private_method_init from "@swc/helpers/src/_class_private_method_init.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(baz); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(baz); var _bar, _baz, _qux, _class; var C = (_bar = /*#__PURE__*/ new WeakSet(), _baz = /*#__PURE__*/ new WeakSet(), _qux = /*#__PURE__*/ new WeakSet(), _class = /*#__PURE__*/ function() { "use strict"; @@ -19,7 +19,7 @@ var C = (_bar = /*#__PURE__*/ new WeakSet(), _baz = /*#__PURE__*/ new WeakSet(), var _proto = _class.prototype; _proto.foo = function foo() { var _this = this; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var b; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -55,7 +55,7 @@ function bar() { return _bar1.apply(this, arguments); } function _bar1() { - _bar1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _bar1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -87,7 +87,7 @@ function qux() { return _qux1.apply(this, arguments); } function _qux1() { - _qux1 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _qux1 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/privateNameStaticsAndStaticMethods_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNameStaticsAndStaticMethods_es5.1.normal.js index c0e2fe5de7f..b9910c01e9a 100644 --- a/crates/swc/tests/tsc-references/privateNameStaticsAndStaticMethods_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameStaticsAndStaticMethods_es5.1.normal.js @@ -34,7 +34,7 @@ function bar(a) { return _bar.apply(this, arguments); } function _bar() { - _bar = _async_to_generator(regeneratorRuntime.mark(function _callee(a) { + _bar = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(a) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -49,7 +49,7 @@ function baz(a) { return _baz.apply(this, arguments); } function _baz() { - _baz = _wrap_async_generator(regeneratorRuntime.mark(function _callee(a) { + _baz = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(a) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/privateNamesAndMethods_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNamesAndMethods_es5.1.normal.js index 60cd7acf4b4..9402704c6ba 100644 --- a/crates/swc/tests/tsc-references/privateNamesAndMethods_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNamesAndMethods_es5.1.normal.js @@ -40,7 +40,7 @@ function bar(a) { return _bar1.apply(this, arguments); } function _bar1() { - _bar1 = _async_to_generator(regeneratorRuntime.mark(function _callee(a) { + _bar1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(a) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -55,7 +55,7 @@ function baz(a) { return _baz1.apply(this, arguments); } function _baz1() { - _baz1 = _wrap_async_generator(regeneratorRuntime.mark(function _callee(a) { + _baz1 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(a) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/privateNamesAndStaticMethods_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNamesAndStaticMethods_es5.1.normal.js index c0e2fe5de7f..b9910c01e9a 100644 --- a/crates/swc/tests/tsc-references/privateNamesAndStaticMethods_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNamesAndStaticMethods_es5.1.normal.js @@ -34,7 +34,7 @@ function bar(a) { return _bar.apply(this, arguments); } function _bar() { - _bar = _async_to_generator(regeneratorRuntime.mark(function _callee(a) { + _bar = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(a) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -49,7 +49,7 @@ function baz(a) { return _baz.apply(this, arguments); } function _baz() { - _baz = _wrap_async_generator(regeneratorRuntime.mark(function _callee(a) { + _baz = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(a) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/restParameterInDownlevelGenerator_es5.1.normal.js b/crates/swc/tests/tsc-references/restParameterInDownlevelGenerator_es5.1.normal.js index f4dd6797398..fa45d98fbb0 100644 --- a/crates/swc/tests/tsc-references/restParameterInDownlevelGenerator_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/restParameterInDownlevelGenerator_es5.1.normal.js @@ -4,7 +4,7 @@ // @noEmitHelpers: true // https://github.com/Microsoft/TypeScript/issues/30653 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(mergeStringLists); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(mergeStringLists); function mergeStringLists() { var _len, strings, _key, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, str, _args = arguments; return regeneratorRuntime.wrap(function mergeStringLists$(_ctx) { diff --git a/crates/swc/tests/tsc-references/superMethodCall_es5.1.normal.js b/crates/swc/tests/tsc-references/superMethodCall_es5.1.normal.js index 0c3b2ec15d9..7c4d53fcbe7 100644 --- a/crates/swc/tests/tsc-references/superMethodCall_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/superMethodCall_es5.1.normal.js @@ -34,7 +34,7 @@ var Derived = /*#__PURE__*/ function(Base) { var _this1 = this, _superprop_get_method = function() { return _get(_get_prototype_of(Derived.prototype), "method", _this); }; - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var ref; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/templateStringInYieldKeyword_es5.1.normal.js b/crates/swc/tests/tsc-references/templateStringInYieldKeyword_es5.1.normal.js index 07dece6eca9..0052e5c52dc 100644 --- a/crates/swc/tests/tsc-references/templateStringInYieldKeyword_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/templateStringInYieldKeyword_es5.1.normal.js @@ -1,6 +1,6 @@ // @target: es6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(gen); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(gen); function gen() { var x; return regeneratorRuntime.wrap(function gen$(_ctx) { diff --git a/crates/swc/tests/tsc-references/templateStringWithEmbeddedYieldKeywordES6_es5.1.normal.js b/crates/swc/tests/tsc-references/templateStringWithEmbeddedYieldKeywordES6_es5.1.normal.js index b20ed29e382..356853c35c0 100644 --- a/crates/swc/tests/tsc-references/templateStringWithEmbeddedYieldKeywordES6_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/templateStringWithEmbeddedYieldKeywordES6_es5.1.normal.js @@ -1,6 +1,6 @@ // @target: ES6 import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(gen); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(gen); function gen() { var x; return regeneratorRuntime.wrap(function gen$(_ctx) { diff --git a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es2015.2.minified.js b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es2015.2.minified.js index 0e3859abf65..d30380729ff 100644 --- a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es2015.2.minified.js @@ -2,55 +2,3 @@ import _async_generator_delegate from "@swc/helpers/src/_async_generator_delegat import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; -_wrap_async_generator(function*() { - yield 1; -}), _wrap_async_generator(function*() { - yield Promise.resolve(1); -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator([ - 1, - 2 - ]), _await_async_generator); -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator([ - Promise.resolve(1) - ]), _await_async_generator); -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator(_wrap_async_generator(function*() { - yield 1; - })()), _await_async_generator); -}), _wrap_async_generator(function*() { - yield 1; -}), _wrap_async_generator(function*() { - yield Promise.resolve(1); -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator([ - 1, - 2 - ]), _await_async_generator); -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator([ - Promise.resolve(1) - ]), _await_async_generator); -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator(_wrap_async_generator(function*() { - yield 1; - })()), _await_async_generator); -}), _wrap_async_generator(function*() { - yield 1; -}), _wrap_async_generator(function*() { - yield Promise.resolve(1); -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator([ - 1, - 2 - ]), _await_async_generator); -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator([ - Promise.resolve(1) - ]), _await_async_generator); -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator(_wrap_async_generator(function*() { - yield 1; - })()), _await_async_generator); -}); diff --git a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es5.1.normal.js b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es5.1.normal.js index f629d7aa983..d954a90054f 100644 --- a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es5.1.normal.js @@ -10,7 +10,7 @@ function inferReturnType1() { return _inferReturnType1.apply(this, arguments); } function _inferReturnType1() { - _inferReturnType1 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _inferReturnType1 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -25,7 +25,7 @@ function inferReturnType2() { return _inferReturnType2.apply(this, arguments); } function _inferReturnType2() { - _inferReturnType2 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _inferReturnType2 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -43,7 +43,7 @@ function inferReturnType3() { return _inferReturnType3.apply(this, arguments); } function _inferReturnType3() { - _inferReturnType3 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _inferReturnType3 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -61,7 +61,7 @@ function inferReturnType4() { return _inferReturnType4.apply(this, arguments); } function _inferReturnType4() { - _inferReturnType4 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _inferReturnType4 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -79,7 +79,7 @@ function inferReturnType5() { return _inferReturnType5.apply(this, arguments); } function _inferReturnType5() { - _inferReturnType5 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _inferReturnType5 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -100,7 +100,7 @@ function inferReturnType6() { return _inferReturnType6.apply(this, arguments); } function _inferReturnType6() { - _inferReturnType6 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _inferReturnType6 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -120,7 +120,7 @@ function inferReturnType7() { return _inferReturnType7.apply(this, arguments); } function _inferReturnType7() { - _inferReturnType7 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _inferReturnType7 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -139,11 +139,11 @@ function inferReturnType8() { return _inferReturnType8.apply(this, arguments); } function _inferReturnType8() { - _inferReturnType8 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _inferReturnType8 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -164,7 +164,7 @@ function _inferReturnType8() { return _inferReturnType8.apply(this, arguments); } var assignability1 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -181,7 +181,7 @@ var assignability1 = function() { }; }(); var assignability2 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -198,7 +198,7 @@ var assignability2 = function() { }; }(); var assignability3 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -217,7 +217,7 @@ var assignability3 = function() { }; }(); var assignability4 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -235,11 +235,11 @@ var assignability4 = function() { }; }(); var assignability5 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -262,7 +262,7 @@ var assignability5 = function() { }; }(); var assignability6 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -279,7 +279,7 @@ var assignability6 = function() { }; }(); var assignability7 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -296,7 +296,7 @@ var assignability7 = function() { }; }(); var assignability8 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -315,7 +315,7 @@ var assignability8 = function() { }; }(); var assignability9 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -333,11 +333,11 @@ var assignability9 = function() { }; }(); var assignability10 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -360,7 +360,7 @@ var assignability10 = function() { }; }(); var assignability11 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -377,7 +377,7 @@ var assignability11 = function() { }; }(); var assignability12 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -394,7 +394,7 @@ var assignability12 = function() { }; }(); var assignability13 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -413,7 +413,7 @@ var assignability13 = function() { }; }(); var assignability14 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -431,11 +431,11 @@ var assignability14 = function() { }; }(); var assignability15 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -461,7 +461,7 @@ function explicitReturnType1() { return _explicitReturnType1.apply(this, arguments); } function _explicitReturnType1() { - _explicitReturnType1 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType1 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -479,7 +479,7 @@ function explicitReturnType2() { return _explicitReturnType2.apply(this, arguments); } function _explicitReturnType2() { - _explicitReturnType2 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType2 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -497,7 +497,7 @@ function explicitReturnType3() { return _explicitReturnType3.apply(this, arguments); } function _explicitReturnType3() { - _explicitReturnType3 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType3 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -517,7 +517,7 @@ function explicitReturnType4() { return _explicitReturnType4.apply(this, arguments); } function _explicitReturnType4() { - _explicitReturnType4 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType4 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -536,11 +536,11 @@ function explicitReturnType5() { return _explicitReturnType5.apply(this, arguments); } function _explicitReturnType5() { - _explicitReturnType5 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType5 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -564,7 +564,7 @@ function explicitReturnType6() { return _explicitReturnType6.apply(this, arguments); } function _explicitReturnType6() { - _explicitReturnType6 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType6 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -582,7 +582,7 @@ function explicitReturnType7() { return _explicitReturnType7.apply(this, arguments); } function _explicitReturnType7() { - _explicitReturnType7 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType7 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -600,7 +600,7 @@ function explicitReturnType8() { return _explicitReturnType8.apply(this, arguments); } function _explicitReturnType8() { - _explicitReturnType8 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType8 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -620,7 +620,7 @@ function explicitReturnType9() { return _explicitReturnType9.apply(this, arguments); } function _explicitReturnType9() { - _explicitReturnType9 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType9 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -639,11 +639,11 @@ function explicitReturnType10() { return _explicitReturnType10.apply(this, arguments); } function _explicitReturnType10() { - _explicitReturnType10 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType10 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -667,7 +667,7 @@ function explicitReturnType11() { return _explicitReturnType11.apply(this, arguments); } function _explicitReturnType11() { - _explicitReturnType11 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType11 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -685,7 +685,7 @@ function explicitReturnType12() { return _explicitReturnType12.apply(this, arguments); } function _explicitReturnType12() { - _explicitReturnType12 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType12 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -703,7 +703,7 @@ function explicitReturnType13() { return _explicitReturnType13.apply(this, arguments); } function _explicitReturnType13() { - _explicitReturnType13 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType13 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -723,7 +723,7 @@ function explicitReturnType14() { return _explicitReturnType14.apply(this, arguments); } function _explicitReturnType14() { - _explicitReturnType14 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType14 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -742,11 +742,11 @@ function explicitReturnType15() { return _explicitReturnType15.apply(this, arguments); } function _explicitReturnType15() { - _explicitReturnType15 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType15 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -770,7 +770,7 @@ function explicitReturnType16() { return _explicitReturnType16.apply(this, arguments); } function _explicitReturnType16() { - _explicitReturnType16 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType16 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -788,7 +788,7 @@ function awaitedType1() { return _awaitedType1.apply(this, arguments); } function _awaitedType1() { - _awaitedType1 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _awaitedType1 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -809,7 +809,7 @@ function awaitedType2() { return _awaitedType2.apply(this, arguments); } function _awaitedType2() { - _awaitedType2 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _awaitedType2 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -830,7 +830,7 @@ function nextType1() { return _nextType1.apply(this, arguments); } function _nextType1() { - _nextType1 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _nextType1 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var x; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es5.2.minified.js b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es5.2.minified.js index a0fcc93406d..de0d8b08415 100644 --- a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.1_es5.2.minified.js @@ -3,199 +3,3 @@ import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, 1; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, Promise.resolve(1); - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator([ - 1, - 2 - ]), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator([ - Promise.resolve(1) - ]), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, 1; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); - }))()), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, 1; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, Promise.resolve(1); - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator([ - 1, - 2 - ]), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator([ - Promise.resolve(1) - ]), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, 1; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); - }))()), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, 1; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, Promise.resolve(1); - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator([ - 1, - 2 - ]), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator([ - Promise.resolve(1) - ]), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, 1; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); - }))()), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es2015.2.minified.js b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es2015.2.minified.js index 86e076753f3..26c0e3ba93a 100644 --- a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es2015.2.minified.js @@ -9,37 +9,3 @@ function _inferReturnType2() { }()), _await_async_generator); })).apply(this, arguments); } -_wrap_async_generator(function*() { - yield "a"; -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator([ - "a", - "b" - ]), _await_async_generator); -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator(_wrap_async_generator(function*() { - yield "a"; - })()), _await_async_generator); -}), _wrap_async_generator(function*() { - yield "a"; -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator([ - "a", - "b" - ]), _await_async_generator); -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator(_wrap_async_generator(function*() { - yield "a"; - })()), _await_async_generator); -}), _wrap_async_generator(function*() { - yield "a"; -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator([ - "a", - "b" - ]), _await_async_generator); -}), _wrap_async_generator(function*() { - yield* _async_generator_delegate(_async_iterator(_wrap_async_generator(function*() { - yield "a"; - })()), _await_async_generator); -}); diff --git a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.1.normal.js b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.1.normal.js index ff728337dde..1eaa42bdee8 100644 --- a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.1.normal.js @@ -10,7 +10,7 @@ function inferReturnType1() { return _inferReturnType1.apply(this, arguments); } function _inferReturnType1() { - _inferReturnType1 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _inferReturnType1 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -27,7 +27,7 @@ function inferReturnType2() { return _inferReturnType2.apply(this, arguments); } function _inferReturnType2() { - _inferReturnType2 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _inferReturnType2 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -44,7 +44,7 @@ function inferReturnType3() { return _inferReturnType3.apply(this, arguments); } function _inferReturnType3() { - _inferReturnType3 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _inferReturnType3 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -61,7 +61,7 @@ function _inferReturnType3() { return _inferReturnType3.apply(this, arguments); } var assignability1 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -78,7 +78,7 @@ var assignability1 = function() { }; }(); var assignability2 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -97,11 +97,11 @@ var assignability2 = function() { }; }(); var assignability3 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -124,7 +124,7 @@ var assignability3 = function() { }; }(); var assignability4 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -141,7 +141,7 @@ var assignability4 = function() { }; }(); var assignability5 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -160,11 +160,11 @@ var assignability5 = function() { }; }(); var assignability6 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -187,7 +187,7 @@ var assignability6 = function() { }; }(); var assignability7 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -204,7 +204,7 @@ var assignability7 = function() { }; }(); var assignability8 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -223,11 +223,11 @@ var assignability8 = function() { }; }(); var assignability9 = function() { - var _ref = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + var _ref = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -253,7 +253,7 @@ function explicitReturnType1() { return _explicitReturnType1.apply(this, arguments); } function _explicitReturnType1() { - _explicitReturnType1 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType1 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -271,7 +271,7 @@ function explicitReturnType2() { return _explicitReturnType2.apply(this, arguments); } function _explicitReturnType2() { - _explicitReturnType2 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType2 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -291,11 +291,11 @@ function explicitReturnType3() { return _explicitReturnType3.apply(this, arguments); } function _explicitReturnType3() { - _explicitReturnType3 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType3 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -319,7 +319,7 @@ function explicitReturnType4() { return _explicitReturnType4.apply(this, arguments); } function _explicitReturnType4() { - _explicitReturnType4 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType4 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -337,7 +337,7 @@ function explicitReturnType5() { return _explicitReturnType5.apply(this, arguments); } function _explicitReturnType5() { - _explicitReturnType5 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType5 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -357,11 +357,11 @@ function explicitReturnType6() { return _explicitReturnType6.apply(this, arguments); } function _explicitReturnType6() { - _explicitReturnType6 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType6 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -385,7 +385,7 @@ function explicitReturnType7() { return _explicitReturnType7.apply(this, arguments); } function _explicitReturnType7() { - _explicitReturnType7 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType7 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -403,7 +403,7 @@ function explicitReturnType8() { return _explicitReturnType8.apply(this, arguments); } function _explicitReturnType8() { - _explicitReturnType8 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType8 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -423,11 +423,11 @@ function explicitReturnType9() { return _explicitReturnType9.apply(this, arguments); } function _explicitReturnType9() { - _explicitReturnType9 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType9 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -451,7 +451,7 @@ function explicitReturnType10() { return _explicitReturnType10.apply(this, arguments); } function _explicitReturnType10() { - _explicitReturnType10 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType10 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -469,7 +469,7 @@ function explicitReturnType11() { return _explicitReturnType11.apply(this, arguments); } function _explicitReturnType11() { - _explicitReturnType11 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType11 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -487,7 +487,7 @@ function explicitReturnType12() { return _explicitReturnType12.apply(this, arguments); } function _explicitReturnType12() { - _explicitReturnType12 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _explicitReturnType12 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -505,7 +505,7 @@ function yieldStar() { return _yieldStar.apply(this, arguments); } function _yieldStar() { - _yieldStar = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _yieldStar = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.2.minified.js b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.2.minified.js index 5dfa290f2d1..e135be91caa 100644 --- a/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/types.asyncGenerators.es2018.2_es5.2.minified.js @@ -19,133 +19,3 @@ function _inferReturnType2() { }, _callee); }))).apply(this, arguments); } -_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, "a"; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator([ - "a", - "b" - ]), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, "a"; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); - }))()), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, "a"; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator([ - "a", - "b" - ]), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, "a"; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); - }))()), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, "a"; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator([ - "a", - "b" - ]), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), _wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.delegateYield(_async_generator_delegate(_async_iterator(_wrap_async_generator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, "a"; - case 2: - case "end": - return _ctx.stop(); - } - }, _callee); - }))()), _await_async_generator), "t0", 1); - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})); diff --git a/crates/swc/tests/tsc-references/types.forAwait.es2018.1_es5.1.normal.js b/crates/swc/tests/tsc-references/types.forAwait.es2018.1_es5.1.normal.js index 46c30961ec9..9c7d4568681 100644 --- a/crates/swc/tests/tsc-references/types.forAwait.es2018.1_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/types.forAwait.es2018.1_es5.1.normal.js @@ -10,7 +10,7 @@ function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var y, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x, _iteratorAbruptCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, _value1, x1, _iteratorAbruptCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, _value2, x2, _iteratorAbruptCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, _value3, _iteratorAbruptCompletion4, _didIteratorError4, _iteratorError4, _iterator4, _step4, _value4, _iteratorAbruptCompletion5, _didIteratorError5, _iteratorError5, _iterator5, _step5, _value5; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -388,7 +388,7 @@ function f2() { return _f2.apply(this, arguments); } function _f2() { - _f2 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f2 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var y, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x, _iteratorAbruptCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, _value1, x1, _iteratorAbruptCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, _value2, x2, _iteratorAbruptCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, _value3, _iteratorAbruptCompletion4, _didIteratorError4, _iteratorError4, _iterator4, _step4, _value4, _iteratorAbruptCompletion5, _didIteratorError5, _iteratorError5, _iterator5, _step5, _value5; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es5.1.normal.js b/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es5.1.normal.js index ba2eb2bf8f5..b9e649234a6 100644 --- a/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/types.forAwait.es2018.2_es5.1.normal.js @@ -8,7 +8,7 @@ function f() { return _f.apply(this, arguments); } function _f() { - _f = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var y, z, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x, _iteratorAbruptCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, _value1, _iteratorAbruptCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, _value2, _iteratorAbruptCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, _value3, _iteratorNormalCompletion, _didIteratorError4, _iteratorError4, _iterator4, _step4, x1, _iteratorNormalCompletion1, _didIteratorError5, _iteratorError5, _iterator5, _step5; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es5.1.normal.js b/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es5.1.normal.js index 0ed2dde7d93..f86dd154e57 100644 --- a/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/types.forAwait.es2018.3_es5.1.normal.js @@ -10,7 +10,7 @@ function f1() { return _f1.apply(this, arguments); } function _f1() { - _f1 = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _f1 = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var y, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x, _iteratorAbruptCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, _value1; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ @@ -148,7 +148,7 @@ function f2() { return _f2.apply(this, arguments); } function _f2() { - _f2 = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _f2 = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var y, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x, _iteratorAbruptCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, _value1; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/unionAndIntersectionInference3_es2015.2.minified.js b/crates/swc/tests/tsc-references/unionAndIntersectionInference3_es2015.2.minified.js index ac214dc0c4b..8758ef4d281 100644 --- a/crates/swc/tests/tsc-references/unionAndIntersectionInference3_es2015.2.minified.js +++ b/crates/swc/tests/tsc-references/unionAndIntersectionInference3_es2015.2.minified.js @@ -3,6 +3,4 @@ concatMaybe([ 1, 2, 3 -], 4), _async_to_generator(function*(com) { - throw com; -}), f2 = f1 = f2, g2 = g1 = g2, foo1(sa), foo1(sx), foo2(sa), foo2(sx), withRouter(MyComponent), foo(ab); +], 4), f2 = f1 = f2, g2 = g1 = g2, foo1(sa), foo1(sx), foo2(sa), foo2(sx), withRouter(MyComponent), foo(ab); diff --git a/crates/swc/tests/tsc-references/unionAndIntersectionInference3_es5.1.normal.js b/crates/swc/tests/tsc-references/unionAndIntersectionInference3_es5.1.normal.js index 9a8ca799300..ebc1faf50a6 100644 --- a/crates/swc/tests/tsc-references/unionAndIntersectionInference3_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/unionAndIntersectionInference3_es5.1.normal.js @@ -10,7 +10,7 @@ concatMaybe([ ], 4); // Repros from #32247 var g = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(com) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(com) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/unionAndIntersectionInference3_es5.2.minified.js b/crates/swc/tests/tsc-references/unionAndIntersectionInference3_es5.2.minified.js index f8d735bcd4c..1d3d8c0270b 100644 --- a/crates/swc/tests/tsc-references/unionAndIntersectionInference3_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/unionAndIntersectionInference3_es5.2.minified.js @@ -4,14 +4,4 @@ concatMaybe([ 1, 2, 3 -], 4), _async_to_generator(regeneratorRuntime.mark(function _callee(com) { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - throw com; - case 1: - case "end": - return _ctx.stop(); - } - }, _callee); -})), f2 = f1 = f2, g2 = g1 = g2, foo1(sa), foo1(sx), foo2(sa), foo2(sx), withRouter(MyComponent), foo(ab); +], 4), f2 = f1 = f2, g2 = g1 = g2, foo1(sa), foo1(sx), foo2(sa), foo2(sx), withRouter(MyComponent), foo(ab); diff --git a/crates/swc/tests/tsc-references/unionTypeInference_es5.1.normal.js b/crates/swc/tests/tsc-references/unionTypeInference_es5.1.normal.js index 0c6a4c7db81..061192d28d3 100644 --- a/crates/swc/tests/tsc-references/unionTypeInference_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypeInference_es5.1.normal.js @@ -32,7 +32,7 @@ function fun(deepPromised) { return _fun.apply(this, arguments); } function _fun() { - _fun = _async_to_generator(regeneratorRuntime.mark(function _callee(deepPromised) { + _fun = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(deepPromised) { var deepPromisedWithIndexer, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, value, awaitedValue; return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ diff --git a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.1.normal.js b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.1.normal.js index 74df452f19d..ca2cda7a8e9 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.1.normal.js @@ -8,10 +8,10 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _define_property from "@swc/helpers/src/_define_property.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(genFuncYieldConstCallWithTypeQuery); -var _marked1 = regeneratorRuntime.mark(genFuncYieldVarCall); -var _marked2 = regeneratorRuntime.mark(genFuncYieldLetCall); -var _marked3 = regeneratorRuntime.mark(genFuncYieldConstCall); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(genFuncYieldConstCallWithTypeQuery); +var _marked1 = /*#__PURE__*/ regeneratorRuntime.mark(genFuncYieldVarCall); +var _marked2 = /*#__PURE__*/ regeneratorRuntime.mark(genFuncYieldLetCall); +var _marked3 = /*#__PURE__*/ regeneratorRuntime.mark(genFuncYieldConstCall); var constCall = Symbol(); var letCall = Symbol(); var varCall = Symbol(); @@ -102,7 +102,7 @@ function asyncFuncReturnConstCall() { } function _asyncFuncReturnConstCall() { _asyncFuncReturnConstCall = // async function return inference - _async_to_generator(regeneratorRuntime.mark(function _callee() { + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -119,7 +119,7 @@ function asyncFuncReturnLetCall() { return _asyncFuncReturnLetCall.apply(this, arguments); } function _asyncFuncReturnLetCall() { - _asyncFuncReturnLetCall = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _asyncFuncReturnLetCall = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -136,7 +136,7 @@ function asyncFuncReturnVarCall() { return _asyncFuncReturnVarCall.apply(this, arguments); } function _asyncFuncReturnVarCall() { - _asyncFuncReturnVarCall = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _asyncFuncReturnVarCall = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -154,7 +154,7 @@ function asyncGenFuncYieldConstCall() { } function _asyncGenFuncYieldConstCall() { _asyncGenFuncYieldConstCall = // async generator function yield inference - _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -172,7 +172,7 @@ function asyncGenFuncYieldLetCall() { return _asyncGenFuncYieldLetCall.apply(this, arguments); } function _asyncGenFuncYieldLetCall() { - _asyncGenFuncYieldLetCall = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _asyncGenFuncYieldLetCall = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -190,7 +190,7 @@ function asyncGenFuncYieldVarCall() { return _asyncGenFuncYieldVarCall.apply(this, arguments); } function _asyncGenFuncYieldVarCall() { - _asyncGenFuncYieldVarCall = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _asyncGenFuncYieldVarCall = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -266,7 +266,7 @@ var o2 = { return s; }, method2: function method2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -279,7 +279,7 @@ var o2 = { }))(); }, method3: function method3() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -292,7 +292,7 @@ var o2 = { }, _callee); }))(); }, - method4: regeneratorRuntime.mark(function method4() { + method4: /*#__PURE__*/ regeneratorRuntime.mark(function method4() { return regeneratorRuntime.wrap(function method4$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -326,7 +326,7 @@ var C0 = /*#__PURE__*/ function() { return s; }; _proto.method2 = function method2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -339,7 +339,7 @@ var C0 = /*#__PURE__*/ function() { }))(); }; _proto.method3 = function method3() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -352,7 +352,7 @@ var C0 = /*#__PURE__*/ function() { }, _callee); }))(); }; - _proto.method4 = regeneratorRuntime.mark(function method4() { + _proto.method4 = /*#__PURE__*/ regeneratorRuntime.mark(function method4() { return regeneratorRuntime.wrap(function method4$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -408,7 +408,7 @@ var o4 = { return s; // return type should not widen due to contextual type }, method2: function method2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -421,7 +421,7 @@ var o4 = { }))(); }, method3: function method3() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -434,7 +434,7 @@ var o4 = { }, _callee); }))(); }, - method4: regeneratorRuntime.mark(function method4() { + method4: /*#__PURE__*/ regeneratorRuntime.mark(function method4() { return regeneratorRuntime.wrap(function method4$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.2.minified.js b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.2.minified.js index 331d6b57562..25649f669c2 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations_es5.2.minified.js @@ -49,17 +49,7 @@ var C = function() { "use strict"; _class_call_check(this, C), this.readonlyCall = Symbol(), this.readwriteCall = Symbol(); }; -C.readonlyStaticCall = Symbol(), C.readonlyStaticTypeAndCall = Symbol(), C.readwriteStaticCall = Symbol(), C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, i.readonlyType, i.readonlyType, i.readonlyType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, Promise.resolve(constCall), f(s), f(N.s), f(N.s), N.s, N.s, N.s, N.s, regeneratorRuntime.mark(function method4() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, s; - case 2: - case "end": - return _ctx.stop(); - } - }, method4); -}); +C.readonlyStaticCall = Symbol(), C.readonlyStaticTypeAndCall = Symbol(), C.readwriteStaticCall = Symbol(), C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, i.readonlyType, i.readonlyType, i.readonlyType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, Promise.resolve(constCall), f(s), f(N.s), f(N.s), N.s, N.s, N.s, N.s; var C0 = function() { "use strict"; function C0() { @@ -112,14 +102,3 @@ var C1 = function() { "use strict"; _class_call_check(this, C1); }; -regeneratorRuntime.mark(function method4() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, s; - case 2: - case "end": - return _ctx.stop(); - } - }, method4); -}); diff --git a/crates/swc/tests/tsc-references/uniqueSymbols_es5.1.normal.js b/crates/swc/tests/tsc-references/uniqueSymbols_es5.1.normal.js index 597a8e55eb7..d452ceaacb2 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbols_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/uniqueSymbols_es5.1.normal.js @@ -8,10 +8,10 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _define_property from "@swc/helpers/src/_define_property.mjs"; import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(genFuncYieldConstCallWithTypeQuery); -var _marked1 = regeneratorRuntime.mark(genFuncYieldVarCall); -var _marked2 = regeneratorRuntime.mark(genFuncYieldLetCall); -var _marked3 = regeneratorRuntime.mark(genFuncYieldConstCall); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(genFuncYieldConstCallWithTypeQuery); +var _marked1 = /*#__PURE__*/ regeneratorRuntime.mark(genFuncYieldVarCall); +var _marked2 = /*#__PURE__*/ regeneratorRuntime.mark(genFuncYieldLetCall); +var _marked3 = /*#__PURE__*/ regeneratorRuntime.mark(genFuncYieldConstCall); var constCall = Symbol(); var letCall = Symbol(); var varCall = Symbol(); @@ -105,7 +105,7 @@ function asyncFuncReturnConstCall() { } function _asyncFuncReturnConstCall() { _asyncFuncReturnConstCall = // async function return inference - _async_to_generator(regeneratorRuntime.mark(function _callee() { + _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -122,7 +122,7 @@ function asyncFuncReturnLetCall() { return _asyncFuncReturnLetCall.apply(this, arguments); } function _asyncFuncReturnLetCall() { - _asyncFuncReturnLetCall = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _asyncFuncReturnLetCall = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -139,7 +139,7 @@ function asyncFuncReturnVarCall() { return _asyncFuncReturnVarCall.apply(this, arguments); } function _asyncFuncReturnVarCall() { - _asyncFuncReturnVarCall = _async_to_generator(regeneratorRuntime.mark(function _callee() { + _asyncFuncReturnVarCall = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -157,7 +157,7 @@ function asyncGenFuncYieldConstCall() { } function _asyncGenFuncYieldConstCall() { _asyncGenFuncYieldConstCall = // async generator function yield inference - _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -175,7 +175,7 @@ function asyncGenFuncYieldLetCall() { return _asyncGenFuncYieldLetCall.apply(this, arguments); } function _asyncGenFuncYieldLetCall() { - _asyncGenFuncYieldLetCall = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _asyncGenFuncYieldLetCall = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -193,7 +193,7 @@ function asyncGenFuncYieldVarCall() { return _asyncGenFuncYieldVarCall.apply(this, arguments); } function _asyncGenFuncYieldVarCall() { - _asyncGenFuncYieldVarCall = _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + _asyncGenFuncYieldVarCall = _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -269,7 +269,7 @@ var o2 = { return s; }, method2: function method2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -282,7 +282,7 @@ var o2 = { }))(); }, method3: function method3() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -295,7 +295,7 @@ var o2 = { }, _callee); }))(); }, - method4: regeneratorRuntime.mark(function method4() { + method4: /*#__PURE__*/ regeneratorRuntime.mark(function method4() { return regeneratorRuntime.wrap(function method4$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -329,7 +329,7 @@ var C0 = /*#__PURE__*/ function() { return s; }; _proto.method2 = function method2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -342,7 +342,7 @@ var C0 = /*#__PURE__*/ function() { }))(); }; _proto.method3 = function method3() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -355,7 +355,7 @@ var C0 = /*#__PURE__*/ function() { }, _callee); }))(); }; - _proto.method4 = regeneratorRuntime.mark(function method4() { + _proto.method4 = /*#__PURE__*/ regeneratorRuntime.mark(function method4() { return regeneratorRuntime.wrap(function method4$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -411,7 +411,7 @@ var o3 = { return s; // return type should not widen due to contextual type }, method2: function method2() { - return _async_to_generator(regeneratorRuntime.mark(function _callee() { + return _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -424,7 +424,7 @@ var o3 = { }))(); }, method3: function method3() { - return _wrap_async_generator(regeneratorRuntime.mark(function _callee() { + return _wrap_async_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: @@ -437,7 +437,7 @@ var o3 = { }, _callee); }))(); }, - method4: regeneratorRuntime.mark(function method4() { + method4: /*#__PURE__*/ regeneratorRuntime.mark(function method4() { return regeneratorRuntime.wrap(function method4$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/tsc-references/uniqueSymbols_es5.2.minified.js b/crates/swc/tests/tsc-references/uniqueSymbols_es5.2.minified.js index 38ef0d9b203..6f74641f144 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbols_es5.2.minified.js +++ b/crates/swc/tests/tsc-references/uniqueSymbols_es5.2.minified.js @@ -49,17 +49,7 @@ var C = function() { "use strict"; _class_call_check(this, C), this.readonlyCall = Symbol(), this.readwriteCall = Symbol(); }; -C.readonlyStaticCall = Symbol(), C.readonlyStaticTypeAndCall = Symbol(), C.readwriteStaticCall = Symbol(), C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, i.readonlyType, i.readonlyType, i.readonlyType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, Promise.resolve(constCall), f(s), f(N.s), f(N.s), N.s, N.s, N.s, N.s, regeneratorRuntime.mark(function method4() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, s; - case 2: - case "end": - return _ctx.stop(); - } - }, method4); -}); +C.readonlyStaticCall = Symbol(), C.readonlyStaticTypeAndCall = Symbol(), C.readwriteStaticCall = Symbol(), C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, i.readonlyType, i.readonlyType, i.readonlyType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, Promise.resolve(constCall), f(s), f(N.s), f(N.s), N.s, N.s, N.s, N.s; var C0 = function() { "use strict"; function C0() { @@ -111,19 +101,7 @@ C0.a = s, C0.b = N.s, C0.c = N.s, C0.d = s, C0.e = N.s, C0.f = N.s, o[s], o[N.s] var C1 = function() { "use strict"; _class_call_check(this, C1); -}; -regeneratorRuntime.mark(function method4() { - return regeneratorRuntime.wrap(function(_ctx) { - for(;;)switch(_ctx.prev = _ctx.next){ - case 0: - return _ctx.next = 2, s; - case 2: - case "end": - return _ctx.stop(); - } - }, method4); -}); -var ce0 = function() { +}, ce0 = function() { "use strict"; function ce0() { _class_call_check(this, ce0); diff --git a/crates/swc/tests/tsc-references/yieldExpressionInControlFlow_es5.1.normal.js b/crates/swc/tests/tsc-references/yieldExpressionInControlFlow_es5.1.normal.js index 9d6e4f3b0e4..725538fca04 100644 --- a/crates/swc/tests/tsc-references/yieldExpressionInControlFlow_es5.1.normal.js +++ b/crates/swc/tests/tsc-references/yieldExpressionInControlFlow_es5.1.normal.js @@ -5,7 +5,7 @@ // @lib: esnext // @Filename: bug25149.js import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(f); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(f); function f() { var o; return regeneratorRuntime.wrap(function f$(_ctx) { @@ -32,7 +32,7 @@ function f() { // @Filename: alsoFails.ts // fails in Typescript too import regeneratorRuntime from "regenerator-runtime"; -var _marked = regeneratorRuntime.mark(g); +var _marked = /*#__PURE__*/ regeneratorRuntime.mark(g); function g() { var o; return regeneratorRuntime.wrap(function g$(_ctx) { diff --git a/crates/swc/tests/vercel/loader-only/regressions/1/full/output/index.js b/crates/swc/tests/vercel/loader-only/regressions/1/full/output/index.js index 4522626f8ff..4b67fe9a865 100644 --- a/crates/swc/tests/vercel/loader-only/regressions/1/full/output/index.js +++ b/crates/swc/tests/vercel/loader-only/regressions/1/full/output/index.js @@ -8,7 +8,7 @@ var Test = function Test(name) { _class_call_check(this, Test); var _this = this; this.print = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(arg) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(arg) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc/tests/vercel/loader-only/regressions/1/simplified/output/index.js b/crates/swc/tests/vercel/loader-only/regressions/1/simplified/output/index.js index 58e36f1e1a1..da7c3f0898d 100644 --- a/crates/swc/tests/vercel/loader-only/regressions/1/simplified/output/index.js +++ b/crates/swc/tests/vercel/loader-only/regressions/1/simplified/output/index.js @@ -6,7 +6,7 @@ var Test = function Test(name) { _class_call_check(this, Test); var _this = this; this.print = function() { - var _ref = _async_to_generator(regeneratorRuntime.mark(function _callee(arg) { + var _ref = _async_to_generator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(arg) { return regeneratorRuntime.wrap(function _callee$(_ctx) { while(1)switch(_ctx.prev = _ctx.next){ case 0: diff --git a/crates/swc_ecma_preset_env/src/lib.rs b/crates/swc_ecma_preset_env/src/lib.rs index fbfcf0ddb4b..e2c3b4b4342 100644 --- a/crates/swc_ecma_preset_env/src/lib.rs +++ b/crates/swc_ecma_preset_env/src/lib.rs @@ -184,6 +184,7 @@ where ignore_function_name: loose || assumptions.ignore_function_name, ignore_function_length: loose || assumptions.ignore_function_length, }, + comments.clone(), global_mark ) ); @@ -206,7 +207,7 @@ where pass, Classes, es2015::classes( - comments, + comments.clone(), es2015::classes::Config { constant_super: loose || assumptions.constant_super, no_class_calls: loose || assumptions.no_class_calls, @@ -262,7 +263,7 @@ where let pass = add!( pass, Regenerator, - es2015::regenerator(Default::default(), global_mark), + es2015::regenerator(Default::default(), comments, global_mark), true ); let pass = add!(pass, BlockScoping, es2015::block_scoping(global_mark), true); diff --git a/crates/swc_ecma_transforms_compat/src/es2015/mod.rs b/crates/swc_ecma_transforms_compat/src/es2015/mod.rs index f37ee7c2fc6..10adcbe3b83 100644 --- a/crates/swc_ecma_transforms_compat/src/es2015/mod.rs +++ b/crates/swc_ecma_transforms_compat/src/es2015/mod.rs @@ -56,7 +56,7 @@ fn exprs(unresolved_mark: Mark) -> impl Fold { #[tracing::instrument(level = "info", skip_all)] pub fn es2015(unresolved_mark: Mark, comments: Option, c: Config) -> impl Fold where - C: Comments, + C: Comments + Clone, { chain!( regexp(regexp::Config { @@ -70,7 +70,7 @@ where }), block_scoped_functions(), template_literal(c.template_literal), - classes(comments, c.classes), + classes(comments.clone(), c.classes), new_target(), spread(c.spread), // https://github.com/Microsoft/TypeScript/issues/5441 @@ -85,7 +85,7 @@ where computed_properties(c.computed_props), destructuring(c.destructuring), block_scoping(unresolved_mark), - regenerator(c.regenerator, unresolved_mark), + regenerator(c.regenerator, comments, unresolved_mark), ) } diff --git a/crates/swc_ecma_transforms_compat/src/es2015/regenerator/mod.rs b/crates/swc_ecma_transforms_compat/src/es2015/regenerator/mod.rs index 6fd160c2bb9..4a37fda974c 100644 --- a/crates/swc_ecma_transforms_compat/src/es2015/regenerator/mod.rs +++ b/crates/swc_ecma_transforms_compat/src/es2015/regenerator/mod.rs @@ -2,7 +2,7 @@ use std::mem::take; use serde::{Deserialize, Serialize}; use swc_atoms::{js_word, JsWord}; -use swc_common::{util::take::Take, Mark, Spanned, DUMMY_SP}; +use swc_common::{comments::Comments, util::take::Take, Mark, Span, Spanned, DUMMY_SP}; use swc_config::merge::Merge; use swc_ecma_ast::*; use swc_ecma_utils::{ @@ -36,9 +36,14 @@ pub struct Config { /// `require` should not be shadowed by other `require` declaration in the /// file. #[tracing::instrument(level = "info", skip_all)] -pub fn regenerator(config: Config, unresolved_mark: Mark) -> impl Fold + VisitMut { +pub fn regenerator( + config: Config, + comments: Option, + unresolved_mark: Mark, +) -> impl Fold + VisitMut { as_folder(Regenerator { config, + comments, unresolved_mark, regenerator_runtime: Default::default(), top_level_vars: Default::default(), @@ -46,8 +51,9 @@ pub fn regenerator(config: Config, unresolved_mark: Mark) -> impl Fold + VisitMu } #[derive(Debug)] -struct Regenerator { +struct Regenerator { config: Config, + comments: Option, unresolved_mark: Mark, /// [Some] if used. regenerator_runtime: Option, @@ -75,7 +81,7 @@ fn require_rt(unresolved_mark: Mark, rt: Ident, src: Option) -> Stmt { } #[swc_trace] -impl Regenerator { +impl Regenerator { fn visit_mut_stmt_like(&mut self, items: &mut Vec) where T: VisitMutWith + StmtLike, @@ -107,10 +113,32 @@ impl Regenerator { *items = new; } + + fn regenerator_mark(&mut self, args: Vec) -> Expr { + let span = if let Some(c) = &mut self.comments { + let span = Span::dummy_with_cmt(); + c.add_pure_comment(span.lo); + span + } else { + DUMMY_SP + }; + + Expr::Call(CallExpr { + span, + callee: self + .regenerator_runtime + .clone() + .unwrap() + .make_member(quote_ident!("mark")) + .as_callee(), + args, + type_args: None, + }) + } } #[swc_trace] -impl VisitMut for Regenerator { +impl VisitMut for Regenerator { noop_visit_mut_type!(); fn visit_mut_expr(&mut self, e: &mut Expr) { @@ -135,21 +163,11 @@ impl VisitMut for Regenerator { function, ); - *e = Expr::Call(CallExpr { - span: DUMMY_SP, - callee: self - .regenerator_runtime - .clone() - .unwrap() - .make_member(quote_ident!("mark")) - .as_callee(), - args: vec![FnExpr { - ident, - function: function.take(), - } - .as_arg()], - type_args: None, - }); + *e = self.regenerator_mark(vec![FnExpr { + ident, + function: function.take(), + } + .as_arg()]); } } @@ -166,21 +184,12 @@ impl VisitMut for Regenerator { if f.function.is_generator { let marked = private_ident!("_marked"); + let init = self.regenerator_mark(vec![f.ident.clone().as_arg()]).into(); self.top_level_vars.push(VarDeclarator { span: DUMMY_SP, name: marked.clone().into(), - init: Some(Box::new(Expr::Call(CallExpr { - span: DUMMY_SP, - callee: self - .regenerator_runtime - .clone() - .unwrap() - .make_member(quote_ident!("mark")) - .as_callee(), - args: vec![f.ident.clone().as_arg()], - type_args: None, - }))), + init: Some(init), definite: false, }); @@ -258,21 +267,11 @@ impl VisitMut for Regenerator { let marked = private_ident!("_callee"); let ident = self.visit_mut_fn(Some(marked.clone()), marked, &mut p.function); - let mark_expr = Expr::Call(CallExpr { - span: DUMMY_SP, - callee: self - .regenerator_runtime - .clone() - .unwrap() - .make_member(quote_ident!("mark")) - .as_callee(), - args: vec![FnExpr { - ident, - function: p.function.take(), - } - .as_arg()], - type_args: None, - }); + let mark_expr = self.regenerator_mark(vec![FnExpr { + ident, + function: p.function.take(), + } + .as_arg()]); p.function = Function { span: DUMMY_SP, @@ -329,7 +328,7 @@ impl VisitMut for Regenerator { } #[swc_trace] -impl Regenerator { +impl Regenerator { fn visit_mut_fn( &mut self, i: Option, diff --git a/crates/swc_ecma_transforms_compat/src/es2017/async_to_generator.rs b/crates/swc_ecma_transforms_compat/src/es2017/async_to_generator.rs index fb9055b9ddb..4e3b1a91528 100644 --- a/crates/swc_ecma_transforms_compat/src/es2017/async_to_generator.rs +++ b/crates/swc_ecma_transforms_compat/src/es2017/async_to_generator.rs @@ -1,7 +1,7 @@ use std::iter; use serde::Deserialize; -use swc_common::{util::take::Take, Mark, Spanned, SyntaxContext, DUMMY_SP}; +use swc_common::{comments::Comments, util::take::Take, Mark, Spanned, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::{helper, helper_expr, perf::Check}; use swc_ecma_transforms_macros::fast_path; @@ -36,9 +36,14 @@ use swc_trace_macro::swc_trace; /// }); /// ``` #[tracing::instrument(level = "info", skip_all)] -pub fn async_to_generator(c: Config, unresolved_mark: Mark) -> impl Fold + VisitMut { +pub fn async_to_generator( + c: Config, + comments: Option, + unresolved_mark: Mark, +) -> impl Fold + VisitMut { as_folder(AsyncToGenerator { c, + comments, unresolved_ctxt: SyntaxContext::empty().apply_mark(unresolved_mark), }) } @@ -53,13 +58,15 @@ pub struct Config { } #[derive(Default, Clone)] -struct AsyncToGenerator { +struct AsyncToGenerator { c: Config, + comments: Option, unresolved_ctxt: SyntaxContext, } -struct Actual { +struct Actual { c: Config, + comments: Option, unresolved_ctxt: SyntaxContext, extra_stmts: Vec, @@ -68,7 +75,7 @@ struct Actual { #[swc_trace] #[fast_path(ShouldWork)] -impl VisitMut for AsyncToGenerator { +impl VisitMut for AsyncToGenerator { noop_visit_mut_type!(); fn visit_mut_module_items(&mut self, n: &mut Vec) { @@ -81,10 +88,10 @@ impl VisitMut for AsyncToGenerator { } #[swc_trace] -impl AsyncToGenerator { +impl AsyncToGenerator { fn visit_mut_stmt_like(&mut self, stmts: &mut Vec) where - T: StmtLike + VisitMutWith, + T: StmtLike + VisitMutWith>, Vec: VisitMutWith, { let mut stmts_updated = Vec::with_capacity(stmts.len()); @@ -92,6 +99,7 @@ impl AsyncToGenerator { for mut stmt in stmts.drain(..) { let mut actual = Actual { c: self.c, + comments: self.comments.clone(), unresolved_ctxt: self.unresolved_ctxt, extra_stmts: vec![], hoist_stmts: vec![], @@ -110,7 +118,7 @@ impl AsyncToGenerator { #[swc_trace] #[fast_path(ShouldWork)] -impl VisitMut for Actual { +impl VisitMut for Actual { noop_visit_mut_type!(); fn visit_mut_class_method(&mut self, m: &mut ClassMethod) { @@ -159,8 +167,20 @@ impl VisitMut for Actual { }; } + fn visit_mut_call_expr(&mut self, expr: &mut CallExpr) { + if let Callee::Expr(e) = &mut expr.callee { + let mut e = &mut **e; + while let Expr::Paren(ParenExpr { expr, .. }) = e { + e = &mut **expr; + } + self.visit_mut_expr_with_binding(e, None, true); + } + + expr.args.visit_mut_with(self) + } + fn visit_mut_expr(&mut self, expr: &mut Expr) { - self.visit_mut_expr_with_binding(expr, None); + self.visit_mut_expr_with_binding(expr, None, false); } fn visit_mut_fn_decl(&mut self, f: &mut FnDecl) { @@ -289,12 +309,12 @@ impl VisitMut for Actual { ident: None, ref function, }) if function.is_async || function.is_generator => { - self.visit_mut_expr_with_binding(init, Some(id.clone())); + self.visit_mut_expr_with_binding(init, Some(id.clone()), false); return; } Expr::Arrow(arrow_expr) if arrow_expr.is_async || arrow_expr.is_generator => { - self.visit_mut_expr_with_binding(init, Some(id.clone())); + self.visit_mut_expr_with_binding(init, Some(id.clone()), false); return; } @@ -307,8 +327,13 @@ impl VisitMut for Actual { } #[swc_trace] -impl Actual { - fn visit_mut_expr_with_binding(&mut self, expr: &mut Expr, binding_ident: Option) { +impl Actual { + fn visit_mut_expr_with_binding( + &mut self, + expr: &mut Expr, + binding_ident: Option, + in_iife: bool, + ) { expr.visit_mut_children_with(self); match expr { @@ -328,6 +353,9 @@ impl Actual { wrapper.function = make_fn_ref(fn_expr); *expr = wrapper.into(); + if !in_iife && let Some(c) = &mut self.comments { + c.add_pure_comment(expr.span().lo) + } } Expr::Fn( @@ -346,6 +374,9 @@ impl Actual { wrapper.function = make_fn_ref(fn_expr); *expr = wrapper.into(); + if !in_iife && let Some(c) = &mut self.comments { + c.add_pure_comment(expr.span().lo) + } } _ => {} diff --git a/crates/swc_ecma_transforms_compat/src/es2017/mod.rs b/crates/swc_ecma_transforms_compat/src/es2017/mod.rs index 89ce58ffd92..846b22c0c54 100644 --- a/crates/swc_ecma_transforms_compat/src/es2017/mod.rs +++ b/crates/swc_ecma_transforms_compat/src/es2017/mod.rs @@ -1,5 +1,5 @@ use serde::Deserialize; -use swc_common::Mark; +use swc_common::{comments::Comments, Mark}; use swc_ecma_visit::Fold; pub use self::async_to_generator::async_to_generator; @@ -7,8 +7,12 @@ pub use self::async_to_generator::async_to_generator; pub mod async_to_generator; #[tracing::instrument(level = "info", skip_all)] -pub fn es2017(c: Config, unresolved_mark: Mark) -> impl Fold { - async_to_generator(c.async_to_generator, unresolved_mark) +pub fn es2017( + c: Config, + comments: Option, + unresolved_mark: Mark, +) -> impl Fold { + async_to_generator(c.async_to_generator, comments, unresolved_mark) } #[derive(Debug, Clone, Copy, Default, Deserialize)] diff --git a/crates/swc_ecma_transforms_compat/tests/es2015_block_scoping.rs b/crates/swc_ecma_transforms_compat/tests/es2015_block_scoping.rs index 5747cd8ecc1..a4614caa0f3 100644 --- a/crates/swc_ecma_transforms_compat/tests/es2015_block_scoping.rs +++ b/crates/swc_ecma_transforms_compat/tests/es2015_block_scoping.rs @@ -1,6 +1,6 @@ use std::{fs::read_to_string, path::PathBuf}; -use swc_common::{chain, Mark}; +use swc_common::{chain, comments::SingleThreadedComments, Mark}; use swc_ecma_parser::Syntax; use swc_ecma_transforms_base::resolver; use swc_ecma_transforms_compat::{ @@ -495,7 +495,7 @@ test!( |Tester { comments, .. }| { let mark = Mark::fresh(Mark::root()); chain!( - async_to_generator(Default::default(), mark), + async_to_generator::(Default::default(), None, mark), es2015::es2015( mark, Some(comments.clone()), @@ -570,7 +570,7 @@ test_exec!( |Tester { comments, .. }| { let mark = Mark::fresh(Mark::root()); chain!( - async_to_generator(Default::default(), mark), + async_to_generator(Default::default(), Some(comments.clone()), mark), es2015::es2015( mark, Some(comments.clone()), diff --git a/crates/swc_ecma_transforms_compat/tests/es2015_classes.rs b/crates/swc_ecma_transforms_compat/tests/es2015_classes.rs index 2a34521ab3a..b68ae621eb7 100644 --- a/crates/swc_ecma_transforms_compat/tests/es2015_classes.rs +++ b/crates/swc_ecma_transforms_compat/tests/es2015_classes.rs @@ -6549,7 +6549,11 @@ test!( chain!( es2022::es2022(Some(t.comments.clone()), Default::default()), es2018::es2018(Default::default()), - es2017::es2017(Default::default(), unresolved_mark), + es2017::es2017( + Default::default(), + Some(t.comments.clone()), + unresolved_mark + ), es2016::es2016(), es2015::es2015( unresolved_mark, diff --git a/crates/swc_ecma_transforms_compat/tests/es2015_parameters.rs b/crates/swc_ecma_transforms_compat/tests/es2015_parameters.rs index baf1dca1b77..c396d9a3889 100644 --- a/crates/swc_ecma_transforms_compat/tests/es2015_parameters.rs +++ b/crates/swc_ecma_transforms_compat/tests/es2015_parameters.rs @@ -1,4 +1,4 @@ -use swc_common::{chain, Mark}; +use swc_common::{chain, comments::SingleThreadedComments, Mark}; use swc_ecma_parser::Syntax; use swc_ecma_transforms_base::resolver; use swc_ecma_transforms_compat::{ @@ -1572,7 +1572,7 @@ test!( let top_level_mark = Mark::new(); chain!( resolver(unresolved_mark, top_level_mark, false), - async_to_generator(Default::default(), unresolved_mark), + async_to_generator::(Default::default(), None, unresolved_mark), arrow(unresolved_mark), parameters(Default::default(), unresolved_mark), ) @@ -1608,7 +1608,7 @@ test!( let top_level_mark = Mark::new(); chain!( resolver(unresolved_mark, top_level_mark, false), - async_to_generator(Default::default(), unresolved_mark), + async_to_generator::(Default::default(), None, unresolved_mark), arrow(unresolved_mark), parameters(Default::default(), unresolved_mark), ) diff --git a/crates/swc_ecma_transforms_compat/tests/es2015_regenerator.rs b/crates/swc_ecma_transforms_compat/tests/es2015_regenerator.rs index 44d51073ff1..cd8c6a772b0 100644 --- a/crates/swc_ecma_transforms_compat/tests/es2015_regenerator.rs +++ b/crates/swc_ecma_transforms_compat/tests/es2015_regenerator.rs @@ -18,7 +18,7 @@ fn tr(_: ()) -> impl Fold { let top_level_mark = Mark::new(); chain!( resolver(unresolved_mark, top_level_mark, false), - regenerator(Default::default(), unresolved_mark) + regenerator::(Default::default(), None, unresolved_mark) ) } @@ -27,8 +27,8 @@ fn tr_with_async() -> impl Fold { let top_level_mark = Mark::new(); chain!( resolver(unresolved_mark, top_level_mark, false), - async_to_generator(Default::default(), unresolved_mark), - regenerator(Default::default(), unresolved_mark) + async_to_generator::(Default::default(), None, unresolved_mark), + regenerator::(Default::default(), None, unresolved_mark) ) } @@ -944,7 +944,11 @@ test_exec!( |t| { let unresolved_mark = Mark::new(); chain!( - es2017(Default::default(), unresolved_mark), + es2017( + Default::default(), + Some(t.comments.clone()), + unresolved_mark + ), es2016(), es2015( unresolved_mark, @@ -966,9 +970,13 @@ test_exec!( |_| { let unresolved_mark = Mark::new(); chain!( - async_to_generator(Default::default(), unresolved_mark), + async_to_generator::(Default::default(), None, unresolved_mark), es2015::for_of(Default::default()), - es2015::regenerator(Default::default(), unresolved_mark), + es2015::regenerator::( + Default::default(), + None, + unresolved_mark + ), ) }, issue_600_exact_passes, @@ -981,7 +989,11 @@ test_exec!( test_exec!( syntax(), - |_| es2015::regenerator(Default::default(), Mark::fresh(Mark::root())), + |_| es2015::regenerator::( + Default::default(), + None, + Mark::fresh(Mark::root()) + ), issue_600_min, "function* foo() { try { @@ -1005,7 +1017,11 @@ test_exec!( test_exec!( syntax(), - |_| es2015::regenerator(Default::default(), Mark::fresh(Mark::root())), + |_| es2015::regenerator::( + Default::default(), + None, + Mark::fresh(Mark::root()) + ), issue_831_1, "function* myGenerator() { yield* [1,2,3]; @@ -1025,7 +1041,7 @@ test!( |_| { let mark = Mark::fresh(Mark::root()); - es2015::regenerator(Default::default(), mark) + es2015::regenerator::(Default::default(), None, mark) }, issue_831_3, "export function* myGenerator() { @@ -1053,7 +1069,11 @@ export function myGenerator() { test_exec!( syntax(), - |_| es2015::regenerator(Default::default(), Mark::fresh(Mark::root())), + |_| es2015::regenerator::( + Default::default(), + None, + Mark::fresh(Mark::root()) + ), delegate_context, "function* a() { yield 5; @@ -1068,7 +1088,11 @@ test_exec!( test_exec!( syntax(), - |_| es2015::regenerator(Default::default(), Mark::fresh(Mark::root())), + |_| es2015::regenerator::( + Default::default(), + None, + Mark::fresh(Mark::root()) + ), issue_849_1, "function* gen() { yield 1 }; function genFactory() { return function*() { yield 1 }; } @@ -1079,7 +1103,11 @@ expect(v.next()).toEqual({ done: true })" test_exec!( syntax(), - |_| es2015::regenerator(Default::default(), Mark::fresh(Mark::root())), + |_| es2015::regenerator::( + Default::default(), + None, + Mark::fresh(Mark::root()) + ), issue_853_1, "function throwingFn() { throw 'Error' } function* gen() { @@ -1763,7 +1791,7 @@ test!( |_| { let mark = Mark::fresh(Mark::root()); chain!( - async_to_generator(Default::default(), mark), + async_to_generator::(Default::default(), None, mark), es2015::(mark, None, Default::default()) ) }, @@ -1802,7 +1830,7 @@ test!( |_| { let mark = Mark::fresh(Mark::root()); chain!( - async_to_generator(Default::default(), mark), + async_to_generator::(Default::default(), None, mark), es2016(), es2015::(mark, None, Default::default()), ) @@ -1845,7 +1873,7 @@ test!( es2022(Some(t.comments.clone()), Default::default()), es2021(), es2018(Default::default()), - es2017(Default::default(), mark), + es2017(Default::default(), Some(t.comments.clone()), mark), es2016(), es2015::(mark, None, Default::default()), ) @@ -2105,9 +2133,9 @@ test_exec!( |_| { let mark = Mark::fresh(Mark::root()); chain!( - async_to_generator(Default::default(), mark), + async_to_generator::(Default::default(), None, mark), es2015::for_of(Default::default()), - regenerator(Default::default(), mark) + regenerator::(Default::default(), None, mark) ) }, issue_1918_1, diff --git a/crates/swc_ecma_transforms_compat/tests/es2017_async_to_generator.rs b/crates/swc_ecma_transforms_compat/tests/es2017_async_to_generator.rs index b45bff104f0..0d8642e1dde 100644 --- a/crates/swc_ecma_transforms_compat/tests/es2017_async_to_generator.rs +++ b/crates/swc_ecma_transforms_compat/tests/es2017_async_to_generator.rs @@ -1,6 +1,6 @@ use std::{fs::read_to_string, path::PathBuf}; -use swc_common::{chain, Mark, Spanned}; +use swc_common::{chain, comments::SingleThreadedComments, Mark, Spanned}; use swc_ecma_ast::*; use swc_ecma_parser::Syntax; use swc_ecma_transforms_base::{fixer::fixer, resolver}; @@ -49,7 +49,7 @@ fn tr() -> impl Fold { parameters(Default::default(), unresolved_mark), destructuring(destructuring::Config { loose: false }), function_name(), - async_to_generator(Default::default(), unresolved_mark), + async_to_generator::(Default::default(), None, unresolved_mark), fixer(None) ) } @@ -59,7 +59,7 @@ fn with_resolver() -> impl Fold { let top_level = Mark::new(); chain!( resolver(unresolved, top_level, false), - async_to_generator(Default::default(), unresolved) + async_to_generator::(Default::default(), None, unresolved) ) } @@ -699,7 +699,7 @@ return (new B(20)).print().then(() => console.log('Done'));" test_exec!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_400_2, "class A { constructor() { @@ -732,7 +732,11 @@ test_exec!( |t| { let unresolved_mark = Mark::new(); chain!( - async_to_generator(Default::default(), unresolved_mark), + async_to_generator( + Default::default(), + Some(t.comments.clone()), + unresolved_mark + ), es2015( unresolved_mark, Some(t.comments.clone()), @@ -794,7 +798,7 @@ return (new A()).print();" test!( ignore, syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), bluebird_coroutines_named_expression, r#" var foo = async function bar() { @@ -827,7 +831,7 @@ test!( // TODO: Enable this test after implementing es6 module pass. ignore, syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), export_async_lone_export, r#" export async function foo () { } @@ -857,7 +861,7 @@ function _foo() { test!( ignore, syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), bluebird_coroutines_arrow_function, r#" (async () => { await foo(); })() @@ -882,7 +886,7 @@ test!( |_| { let unresolved_mark = Mark::new(); chain!( - async_to_generator(Default::default(), unresolved_mark), + async_to_generator::(Default::default(), None, unresolved_mark), arrow(unresolved_mark) ) }, @@ -966,7 +970,7 @@ function foo() { // async_to_generator_object_method_with_arrows test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), async_to_generator_object_method_with_arrows, r#" class Class { @@ -1032,7 +1036,7 @@ class Class { // async_to_generator_object_method test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), async_to_generator_object_method, r#" let obj = { @@ -1062,7 +1066,7 @@ let obj = { test!( ignore, syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), bluebird_coroutines_class, r#" class Foo { @@ -1094,7 +1098,7 @@ test!( |_| { let unresolved_mark = Mark::new(); chain!( - async_to_generator(Default::default(), unresolved_mark), + async_to_generator::(Default::default(), None, unresolved_mark), //regenerator(), arrow(unresolved_mark), ) @@ -1255,7 +1259,7 @@ regeneratorRuntime.mark(function _callee4() { // async_to_generator_named_expression test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), async_to_generator_named_expression, r#" var foo = async function bar() { @@ -1377,7 +1381,7 @@ function () { // async_to_generator_async_arrow_in_method test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), async_to_generator_async_arrow_in_method, r#" let TestClass = { @@ -1416,7 +1420,7 @@ let TestClass = { test!( ignore, syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), bluebird_coroutines_statement, r#" async function foo() { @@ -1449,7 +1453,7 @@ test!( chain!( resolver(unresolved_mark, top_level_mark, false), - async_to_generator(Default::default(), unresolved_mark), + async_to_generator::(Default::default(), None, unresolved_mark), parameters(Default::default(), unresolved_mark), destructuring(destructuring::Config { loose: false }), ) @@ -1496,7 +1500,7 @@ test!( // TODO: Enable this test after implementing es6 module pass. ignore, syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), export_async_default_arrow_export, r#" export default async () => { return await foo(); } @@ -1524,7 +1528,7 @@ exports.default = _default; // async_to_generator_function_arity test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), async_to_generator_function_arity, r#" async function one(a, b = 1) {} @@ -1594,7 +1598,7 @@ function _six() { // async_to_generator_object_method_with_super test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), async_to_generator_object_method_with_super_caching, r#" class Foo extends class {} { @@ -1628,7 +1632,7 @@ test!( // TODO: Enable this test after implementing es6 module pass. ignore, syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), export_async_default_export, r#" export default async function myFunc() {} @@ -1657,7 +1661,7 @@ function _myFunc() { // async_to_generator_async test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), async_to_generator_async, r#" class Foo { @@ -1683,7 +1687,7 @@ class Foo { // regression_8783 test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), regression_8783, r#" (async function poll() { @@ -1776,7 +1780,7 @@ test!( // TODO: Enable this test after implementing es6 module pass. ignore, syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), export_async_import_and_export, r#" import bar from 'bar'; @@ -1863,7 +1867,7 @@ function foo() { // regression_4599 test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), regression_4599, r#" async () => await promise @@ -1888,7 +1892,7 @@ _asyncToGenerator(function* () { // regression_4943_exec test_exec!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), regression_4943_exec, r#" "use strict"; @@ -1911,7 +1915,7 @@ return foo().then(() => { // regression_8783_exec test_exec!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), regression_8783_exec, r#" let log = []; @@ -1936,7 +1940,7 @@ return main.then(() => { test!( ignore, syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), bluebird_coroutines_expression, r#" var foo = async function () { @@ -1965,7 +1969,7 @@ function () { // async_to_generator_expression test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), async_to_generator_expression, r#" var foo = async function () { @@ -2022,7 +2026,7 @@ function () { // async_to_generator_statement test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), async_to_generator_statement, r#" async function foo() { @@ -2078,7 +2082,7 @@ function foo() { // async_to_generator_parameters test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), async_to_generator_parameters, r#" async function foo(bar) { @@ -2102,7 +2106,7 @@ function _foo() { // regression_t6882_exec test_exec!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), regression_t6882_exec, r#" foo(); @@ -2115,7 +2119,7 @@ async function foo() {} // async_to_generator_parameters test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_600, r#" async function foo() { @@ -2138,7 +2142,7 @@ function _foo() { test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_1036_1, " const x = async function() { @@ -2181,7 +2185,7 @@ test!( test_exec!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_1036_2, " const x = async function() { @@ -2197,7 +2201,7 @@ test_exec!( test!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_1216_1, " const source = Math.random() < 2 ? 'matilda' : 'fred'; @@ -2244,7 +2248,7 @@ test!( test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_1125_1, " async function test() { @@ -2277,7 +2281,7 @@ test() test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_1341_1, " class A { @@ -2319,7 +2323,7 @@ test_exec!( Syntax::default(), |t| chain!( class_properties(Some(t.comments.clone()), Default::default()), - async_to_generator(Default::default(), Mark::new()) + async_to_generator(Default::default(), Some(t.comments.clone()), Mark::new()) ), issue_1341_1_exec, " @@ -2341,7 +2345,7 @@ test_exec!( test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_1341_2, " class A { @@ -2375,7 +2379,7 @@ test_exec!( Syntax::default(), |t| chain!( class_properties(Some(t.comments.clone()), Default::default()), - async_to_generator(Default::default(), Mark::new()) + async_to_generator(Default::default(), Some(t.comments.clone()), Mark::new()) ), issue_1341_2_exec, " @@ -2393,7 +2397,7 @@ test_exec!( test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_1455_1, " const obj = { @@ -2436,7 +2440,7 @@ test!( test_exec!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_1575_1, " const obj = { @@ -2454,8 +2458,8 @@ test_exec!( |_| { let mark = Mark::fresh(Mark::root()); chain!( - async_to_generator(Default::default(), mark), - regenerator(Default::default(), mark) + async_to_generator::(Default::default(), None, mark), + regenerator::(Default::default(), None, mark) ) }, issue_1575_2, @@ -2472,7 +2476,7 @@ test_exec!( test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_1722_1, " (async function main() { @@ -2496,7 +2500,7 @@ test!( test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_1721_1, " async function main() { @@ -2543,7 +2547,7 @@ test!( test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_1721_2_async_generator, " async function* lol() { @@ -2567,7 +2571,7 @@ test!( test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_1684_1, " const cache = {} @@ -2606,8 +2610,8 @@ test!( |_| { let unresolved_mark = Mark::fresh(Mark::root()); chain!( - async_to_generator(Default::default(), unresolved_mark), - regenerator(Default::default(), unresolved_mark) + async_to_generator::(Default::default(), None, unresolved_mark), + regenerator::(Default::default(), None, unresolved_mark) ) }, issue_1684_2, @@ -2665,7 +2669,7 @@ test!( test_exec!( syntax(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_1752_1, " async function* generate() { @@ -2693,7 +2697,7 @@ test_exec!( test_exec!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_1918_1, " let counter = 0; @@ -2733,7 +2737,7 @@ test_exec!( test_exec!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_2402_1, " function MyClass(item) { @@ -2757,8 +2761,8 @@ test!( |_| { let unresolved_mark = Mark::fresh(Mark::root()); chain!( - async_to_generator(Default::default(), unresolved_mark), - regenerator(Default::default(), unresolved_mark) + async_to_generator::(Default::default(), None, unresolved_mark), + regenerator::(Default::default(), None, unresolved_mark) ) }, issue_2402_2, @@ -2814,7 +2818,7 @@ tmp.fun().then((res)=>{ test_exec!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_2305_1, " function MyClass () {} @@ -2849,8 +2853,8 @@ test!( |_| { let unresolved_mark = Mark::fresh(Mark::root()); chain!( - async_to_generator(Default::default(), unresolved_mark), - regenerator(Default::default(), unresolved_mark) + async_to_generator::(Default::default(), None, unresolved_mark), + regenerator::(Default::default(), None, unresolved_mark) ) }, issue_2305_2, @@ -2924,8 +2928,8 @@ test!( |_| { let unresolved_mark = Mark::fresh(Mark::root()); chain!( - async_to_generator(Default::default(), unresolved_mark), - regenerator(Default::default(), unresolved_mark) + async_to_generator::(Default::default(), None, unresolved_mark), + regenerator::(Default::default(), None, unresolved_mark) ) }, issue_2677_1, @@ -3002,8 +3006,8 @@ test!( |_| { let unresolved_mark = Mark::fresh(Mark::root()); chain!( - async_to_generator(Default::default(), unresolved_mark), - regenerator(Default::default(), unresolved_mark) + async_to_generator::(Default::default(), None, unresolved_mark), + regenerator::(Default::default(), None, unresolved_mark) ) }, issue_2677_2, @@ -3055,7 +3059,7 @@ export default async function() { test_exec!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), function_parameters, " class A { @@ -3078,7 +3082,7 @@ expect(a.doTest()).resolves.toEqual(3); test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), function_length_issue_3135_1, r#" async function foo(x, y, ...z) { @@ -3100,7 +3104,7 @@ function _foo() { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), function_length_issue_3135_2, r#" async function* foo(x, y, ...z) { @@ -3122,7 +3126,7 @@ function _foo() { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), function_length_issue_3135_3, r#" const foo = async function (x, y, ...z) { @@ -3143,7 +3147,7 @@ const foo = /*#__PURE__*/ function () { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), function_length_issue_3135_4, r#" const foo = async function* (x, y, ...z) { @@ -3164,7 +3168,7 @@ const foo = /*#__PURE__*/ function () { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), function_length_issue_3135_5, r#" const foo = async function foo(x, y, ...z) { @@ -3192,7 +3196,7 @@ const foo = function () { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), function_length_issue_3135_6, r#" const foo = async function* foo(x, y, ...z) { @@ -3220,7 +3224,7 @@ const foo = function () { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), function_length_issue_3135_7, r#" const foo = async (x, y, ...z) => { @@ -3243,7 +3247,7 @@ const foo = /*#__PURE__*/ function () { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), async_wrap_this, r#" const foo = async (x, y, ...z) => { @@ -3346,7 +3350,7 @@ class Foo { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), export_default_async_nested_1, " export default async function foo(x) { @@ -3378,7 +3382,7 @@ function _foo() { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), export_default_async_nested_2, " export default async function (x) { @@ -3417,7 +3421,7 @@ function _ref() { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), async_with_optional_params, " (async function (a = 10, ...rest) {})(); @@ -3461,7 +3465,7 @@ export class Quirk { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), super_field_update, " class Foo { @@ -3491,7 +3495,7 @@ class Foo { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), microbundle_835, " class A extends B { @@ -3516,7 +3520,7 @@ class A extends B { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), super_update, " class A extends B { @@ -3556,7 +3560,7 @@ class A extends B { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), async_with_optional_params_2, " const Z = (f) => ((x) => f((y) => x(x)(y)))((x) => f((y) => x(x)(y))); @@ -3579,7 +3583,7 @@ const p = Z((f)=>_asyncToGenerator(function*(n = 0) { test!( Syntax::default(), - |_| async_to_generator(Default::default(), Mark::new()), + |_| async_to_generator::(Default::default(), None, Mark::new()), issue_4208, " function foo() { @@ -3615,7 +3619,11 @@ fn exec(input: PathBuf) { chain!( resolver(unresolved_mark, top_level_mark, false), class_properties(Some(t.comments.clone()), Default::default()), - async_to_generator(Default::default(), unresolved_mark) + async_to_generator( + Default::default(), + Some(t.comments.clone()), + unresolved_mark + ) ) }, &input, @@ -3634,10 +3642,18 @@ fn exec_regenerator(input: PathBuf) { chain!( resolver(unresolved_mark, top_level_mark, false), class_properties(Some(t.comments.clone()), Default::default()), - async_to_generator(Default::default(), unresolved_mark), + async_to_generator( + Default::default(), + Some(t.comments.clone()), + unresolved_mark + ), es2015::for_of(Default::default()), block_scoping(unresolved_mark), - regenerator(Default::default(), unresolved_mark) + regenerator( + Default::default(), + Some(t.comments.clone()), + unresolved_mark + ) ) }, &input, diff --git a/crates/swc_ecma_transforms_compat/tests/es2022_class_properties.rs b/crates/swc_ecma_transforms_compat/tests/es2022_class_properties.rs index 3647f79d8d1..b0d4f6b3029 100644 --- a/crates/swc_ecma_transforms_compat/tests/es2022_class_properties.rs +++ b/crates/swc_ecma_transforms_compat/tests/es2022_class_properties.rs @@ -2896,7 +2896,7 @@ test!( syntax(), |t| chain!( class_properties(Some(t.comments.clone()), Default::default()), - async_to_generator(Default::default(), Mark::new()) + async_to_generator(Default::default(), Some(t.comments.clone()), Mark::new()) ), public_regression_t7364, r#" @@ -3423,7 +3423,11 @@ test!( let unresolved_mark = Mark::new(); chain!( class_properties(Some(t.comments.clone()), Default::default()), - async_to_generator(Default::default(), unresolved_mark), + async_to_generator( + Default::default(), + Some(t.comments.clone()), + unresolved_mark + ), block_scoping(unresolved_mark) ) }, @@ -5440,7 +5444,7 @@ test!( syntax(), |t| chain!( class_properties(Some(t.comments.clone()), Default::default()), - async_to_generator(Default::default(), Mark::new()) + async_to_generator(Default::default(), Some(t.comments.clone()), Mark::new()) ), issue_1694_1, " @@ -5471,7 +5475,7 @@ test!( syntax(), |t| chain!( class_properties(Some(t.comments.clone()), Default::default()), - async_to_generator(Default::default(), Mark::new()) + async_to_generator(Default::default(), Some(t.comments.clone()), Mark::new()) ), issue_1694_2, " @@ -5500,7 +5504,7 @@ test!( syntax(), |t| chain!( class_properties(Some(t.comments.clone()), Default::default()), - async_to_generator(Default::default(), Mark::new()) + async_to_generator(Default::default(), Some(t.comments.clone()), Mark::new()) ), issue_1702_1, " diff --git a/crates/swc_ecma_transforms_optimization/tests/simplify.rs b/crates/swc_ecma_transforms_optimization/tests/simplify.rs index 497e3c68bc0..346a16ed4f6 100644 --- a/crates/swc_ecma_transforms_optimization/tests/simplify.rs +++ b/crates/swc_ecma_transforms_optimization/tests/simplify.rs @@ -572,7 +572,11 @@ test!( class_properties(Some(t.comments.clone()), Default::default()), simplifier(unresolved_mark, Default::default()), es2018(Default::default()), - es2017(Default::default(), unresolved_mark), + es2017( + Default::default(), + Some(t.comments.clone()), + unresolved_mark + ), es2016(), es2015( unresolved_mark, diff --git a/crates/swc_ecma_transforms_typescript/benches/compat.rs b/crates/swc_ecma_transforms_typescript/benches/compat.rs index 5183c4f6d97..d501642bcdc 100644 --- a/crates/swc_ecma_transforms_typescript/benches/compat.rs +++ b/crates/swc_ecma_transforms_typescript/benches/compat.rs @@ -183,13 +183,21 @@ fn es2019_optional_catch_binding(b: &mut Bencher) { fn es2017(b: &mut Bencher) { run(b, || { - swc_ecma_transforms_compat::es2017(Default::default(), Mark::new()) + swc_ecma_transforms_compat::es2017( + Default::default(), + Some(SingleThreadedComments::default()), + Mark::new(), + ) }); } fn es2017_async_to_generator(b: &mut Bencher) { run(b, || { - swc_ecma_transforms_compat::es2017::async_to_generator(Default::default(), Mark::new()) + swc_ecma_transforms_compat::es2017::async_to_generator( + Default::default(), + Some(SingleThreadedComments::default()), + Mark::new(), + ) }); } @@ -300,14 +308,12 @@ fn es3(b: &mut Bencher) { fn full_es2016(b: &mut Bencher) { run(b, || { + let cmt = SingleThreadedComments::default(); chain!( - swc_ecma_transforms_compat::es2022( - Some(SingleThreadedComments::default()), - Default::default() - ), + swc_ecma_transforms_compat::es2022(Some(cmt.clone()), Default::default()), swc_ecma_transforms_compat::es2019(), swc_ecma_transforms_compat::es2018(Default::default()), - swc_ecma_transforms_compat::es2017(Default::default(), Mark::new()), + swc_ecma_transforms_compat::es2017(Default::default(), Some(cmt), Mark::new()), swc_ecma_transforms_compat::es2016(), ) }); @@ -315,14 +321,12 @@ fn full_es2016(b: &mut Bencher) { fn full_es2017(b: &mut Bencher) { run(b, || { + let cmt = SingleThreadedComments::default(); chain!( - swc_ecma_transforms_compat::es2022( - Some(SingleThreadedComments::default()), - Default::default() - ), + swc_ecma_transforms_compat::es2022(Some(cmt.clone()), Default::default()), swc_ecma_transforms_compat::es2019(), swc_ecma_transforms_compat::es2018(Default::default()), - swc_ecma_transforms_compat::es2017(Default::default(), Mark::new()), + swc_ecma_transforms_compat::es2017(Default::default(), Some(cmt), Mark::new()), ) }); } diff --git a/crates/swc_ecma_transforms_typescript/tests/strip.rs b/crates/swc_ecma_transforms_typescript/tests/strip.rs index b190835aab3..5fb4ea882c4 100644 --- a/crates/swc_ecma_transforms_typescript/tests/strip.rs +++ b/crates/swc_ecma_transforms_typescript/tests/strip.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use swc_common::{chain, pass::Optional, Mark}; +use swc_common::{chain, comments::SingleThreadedComments, pass::Optional, Mark}; use swc_ecma_parser::{Syntax, TsConfig}; use swc_ecma_transforms_base::resolver; use swc_ecma_transforms_compat::{ @@ -3263,7 +3263,7 @@ test!( Optional::new(decorators(Default::default()), false,), resolver(unresolved_mark, top_level_mark, true), strip_with_config(config, top_level_mark), - async_to_generator(Default::default(), unresolved_mark) + async_to_generator::(Default::default(), None, unresolved_mark), ) }, issue_1235_1,