Evluation order bug inside the same expression
nicolo-ribaudo opened this issue · 0 comments
nicolo-ribaudo commented
function* fn() {
var _ref;
(_ref = yield).method(_ref);
}
In this code, _ref = yield
should be evaluated before the _ref
which is passed as a parameter. The compiled code does the opposite:
var _ref;
return regeneratorRuntime.wrap(function fn$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return;
case 2:
_context.t0 = _ref;
(_ref = _context.sent).method(_context.t0);
case 4:
case "end":
return _context.stop();
}
}, _marked);
}