Skip to content

Commit

Permalink
Fix empty iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
rpetrich committed Oct 19, 2019
1 parent 2df5d29 commit ec822ef
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions helpers.js
Expand Up @@ -665,17 +665,22 @@ export const _AsyncGenerator = /*#__PURE__*/(function() {
_this._pact = null;
_this._resolve = null;
}
_entry(_this).then(returnValue, function(error) {
if (error === _earlyReturn) {
returnValue(_this._return);
} else {
const pact = new _Pact();
_this._resolve(pact);
_this._pact = null;
_this._resolve = null;
_resolve(pact, 2, error);
}
});
var result = _entry(_this);
if (result && result.then) {
result.then(returnValue, function(error) {
if (error === _earlyReturn) {
returnValue(_this._return);
} else {
const pact = new _Pact();
_this._resolve(pact);
_this._pact = null;
_this._resolve = null;
_resolve(pact, 2, error);
}
});
} else {
returnValue(result);
}
} else {
// Generator is started and a yield expression is pending, settle it
_this._pact = null;
Expand Down

0 comments on commit ec822ef

Please sign in to comment.