Skip to content

Commit

Permalink
fix esnext.iterator.constructor compat test (some old FF versions w…
Browse files Browse the repository at this point in the history
…ith non-standard `Iterator` pass the current)
  • Loading branch information
zloirock committed Jan 9, 2020
1 parent c7c5015 commit 241537f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/compat/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1148,8 +1148,12 @@ GLOBAL.tests = {
return compositeSymbol;
},
'esnext.iterator.constructor': function () {
return typeof Iterator == 'function'
&& Iterator.prototype === Object.getPrototypeOf(Object.getPrototypeOf([].values()));
try {
Iterator({});
} catch (error) {
return typeof Iterator == 'function'
&& Iterator.prototype === Object.getPrototypeOf(Object.getPrototypeOf([].values()));
}
},
'esnext.iterator.as-indexed-pairs': function () {
return Iterator.prototype.asIndexedPairs;
Expand Down

0 comments on commit 241537f

Please sign in to comment.