diff --git a/ecmascript/transforms/src/compat/es2015/block_scoping.rs b/ecmascript/transforms/src/compat/es2015/block_scoping.rs index 22d0c49a4f15..afd7256a4db9 100644 --- a/ecmascript/transforms/src/compat/es2015/block_scoping.rs +++ b/ecmascript/transforms/src/compat/es2015/block_scoping.rs @@ -1440,9 +1440,54 @@ expect(foo()).toBe(false); ) } ", - " - - " + r#" + var regeneratorRuntime = require("regenerator-runtime"); + var _marked = regeneratorRuntime.mark(_foo); + function _foo() { + _foo = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { + return regeneratorRuntime.wrap(function _callee$(_ctx) { + while(1)switch(_ctx.prev = _ctx.next){ + case 0: + _ctx.next = 2; + return Promise.all([ + [ + 1 + ], + [ + 2 + ], + [ + 3 + ] + ].map(_asyncToGenerator(regeneratorRuntime.mark(function _callee1(param) { + var _param = _slicedToArray(param, 1), a = _param[0]; + return regeneratorRuntime.wrap(function _callee$1(_ctx1) { + while(1)switch(_ctx1.prev = _ctx1.next){ + case 0: + return _ctx1.abrupt("return", Promise.resolve().then(function() { + return a * 2; + })); + case 1: + case "end": + return _ctx1.stop(); + } + }, _callee1); + })))); + case 2: + _ctx.sent; + case 3: + case "end": + return _ctx.stop(); + } + }, _callee); + })); + return _foo.apply(this, arguments); + } + function foo() { + return _foo.apply(this, arguments); + } + + "# ); test_exec!(