Skip to content

Commit

Permalink
additional check for iterators prototype, close #289
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Apr 29, 2017
1 parent b5601ac commit cb30530
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/modules/_iter-define.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED
// Fix native
if($anyNative){
IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
if(IteratorPrototype !== Object.prototype){
if(IteratorPrototype !== Object.prototype && IteratorPrototype.next){
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
Expand Down
2 changes: 1 addition & 1 deletion modules/_iter-define.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED
// Fix native
if($anyNative){
IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
if(IteratorPrototype !== Object.prototype){
if(IteratorPrototype !== Object.prototype && IteratorPrototype.next){
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
Expand Down

0 comments on commit cb30530

Please sign in to comment.