Spec compatibility for iteratorClose condition. (#6094)

* for-of: IteratorClose spec compatibility.

See #3:
https://tc39.github.io/ecma262/#sec-iteratorclose

* Update spec fixtures for for-of.

* Fix IteratorClose case for remap-async-to-generator.

* Fix IteratorClose case for async-generator-function test output.

* Modify few tests according to iteratorClose fix.

* Fix iteratorClose for helpers.slicedToArray also.

* Update iteratorClose fixture for commonjs.
This commit is contained in:
Artem Yavorsky
2017-08-28 22:39:02 +03:00
committed by Henry Zhu
parent 827d84536a
commit b2b3d7944a
23 changed files with 25 additions and 25 deletions

View File

@@ -13,7 +13,7 @@ babelHelpers.asyncToGenerator(function* () {
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
if (!_iteratorNormalCompletion && _iterator.return != null) {
yield _iterator.return();
}
} finally {

View File

@@ -14,7 +14,7 @@ let f = (() => {
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
if (!_iteratorNormalCompletion && _iterator.return != null) {
yield _iterator.return();
}
} finally {

View File

@@ -14,7 +14,7 @@ let g = (() => {
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
if (!_iteratorNormalCompletion && _iterator.return != null) {
yield babelHelpers.asyncGenerator.await(_iterator.return());
}
} finally {

View File

@@ -17,7 +17,7 @@ let f = (() => {
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
if (!_iteratorNormalCompletion && _iterator.return != null) {
yield _iterator.return();
}
} finally {