Skip to content

Commit

Permalink
Compile to generators
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Jun 21, 2021
1 parent a2d27bc commit d452c97
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
@@ -1,6 +1,5 @@
{
"parserOpts": {
"allowReturnOutsideFunction": true
},
"plugins": ["proposal-async-generator-functions"]
}
}
@@ -1,11 +1,11 @@
(async function () {
babelHelpers.asyncToGenerator(function* () {
var _iteratorAbruptCompletion = false;
var _didIteratorError = false;

var _iteratorError;

try {
for (var _iterator = babelHelpers.asyncIterator(y), _step; _iteratorAbruptCompletion = !(_step = await _iterator.next()).done; _iteratorAbruptCompletion = false) {
for (var _iterator = babelHelpers.asyncIterator(y), _step; _iteratorAbruptCompletion = !(_step = yield _iterator.next()).done; _iteratorAbruptCompletion = false) {
obj.x = _step.value;
}
} catch (err) {
Expand All @@ -14,7 +14,7 @@
} finally {
try {
if (_iteratorAbruptCompletion && _iterator.return != null) {
await _iterator.return();
yield _iterator.return();
}
} finally {
if (_didIteratorError) {
Expand Down
@@ -1,6 +1,5 @@
{
"parserOpts": {
"allowReturnOutsideFunction": true
},
"plugins": ["proposal-async-generator-functions"]
}
}
@@ -1,6 +1,5 @@
{
"parserOpts": {
"allowReturnOutsideFunction": true
},
"plugins": ["proposal-async-generator-functions"]
}
}
@@ -1,6 +1,5 @@
{
"parserOpts": {
"allowReturnOutsideFunction": true
},
"plugins": ["proposal-async-generator-functions"]
}
}

0 comments on commit d452c97

Please sign in to comment.