Skip to content

Commit

Permalink
fix some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Sep 2, 2021
1 parent dd68478 commit 1b93419
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/core-js/internals/async-iterator-create-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = function (nextHandler, IS_ITERATOR) {
return new Promise(function (resolve, reject) {
var state = getInternalState(that);
var iterator = state.iterator;
iterator.done = true;
state.done = true;
var $$return = iterator['return'];
if ($$return === undefined) return resolve({ done: true, value: value });
Promise.resolve($$return.call(iterator, value)).then(function (result) {
Expand All @@ -54,7 +54,7 @@ module.exports = function (nextHandler, IS_ITERATOR) {
return new Promise(function (resolve, reject) {
var state = getInternalState(that);
var iterator = state.iterator;
iterator.done = true;
state.done = true;
var $$throw = iterator['throw'];
if ($$throw === undefined) return reject(value);
resolve($$throw.call(iterator, value));
Expand Down
4 changes: 2 additions & 2 deletions packages/core-js/internals/iterator-create-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ module.exports = function (nextHandler, IS_ITERATOR) {
'return': function (value) {
var state = getInternalState(this);
var iterator = state.iterator;
iterator.done = true;
state.done = true;
var $$return = iterator['return'];
return { done: true, value: $$return === undefined ? value : anObject($$return.call(iterator, value)).value };
},
'throw': function (value) {
var state = getInternalState(this);
var iterator = state.iterator;
iterator.done = true;
state.done = true;
var $$throw = iterator['throw'];
if ($$throw === undefined) throw value;
return $$throw.call(iterator, value);
Expand Down

0 comments on commit 1b93419

Please sign in to comment.