Skip to content

Commit

Permalink
fix one case of built-in iterators deoptimization in V8, related #377
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Mar 27, 2018
1 parent 22ebb62 commit 795c6bd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions modules/_iter-define.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var LIBRARY = require('./_library');
var $export = require('./_export');
var redefine = require('./_redefine');
var hide = require('./_hide');
var has = require('./_has');
var Iterators = require('./_iterators');
var $iterCreate = require('./_iter-create');
var setToStringTag = require('./_set-to-string-tag');
Expand Down Expand Up @@ -41,7 +40,7 @@ module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCE
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
Expand Down

0 comments on commit 795c6bd

Please sign in to comment.