Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Sep 22, 2020
1 parent 4a64249 commit 23d2dc0
Showing 1 changed file with 48 additions and 3 deletions.
51 changes: 48 additions & 3 deletions ecmascript/transforms/src/compat/es2015/block_scoping.rs
Expand Up @@ -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!(
Expand Down

0 comments on commit 23d2dc0

Please sign in to comment.