File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
polyfills/Array/prototype/values Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
/* global CreateMethodProperty, Symbol, ToObject, ArrayIterator */
2
2
// 22.1.3.30/ Array.prototype.values ( )
3
3
4
- var hasLegacyIterator = ! ( function ( ) {
4
+ var hasModernIterator = function ( ) {
5
5
// firefox 44 and below uses legacy iterators
6
6
// https://github.com/zloirock/core-js/commit/bb3b34bbf92b1d1a7b50d3a5a445c84dc2fb5cd5#diff-25d2a16dc5a355ce40a572773be144d1c8e085a809633e42ec$
7
7
var IteratorPrototype = Object . getPrototypeOf ( Object . getPrototypeOf ( [ ] [ Symbol . iterator ] ( ) ) ) ;
8
8
var test = { } ;
9
9
return IteratorPrototype [ Symbol . iterator ] . call ( test ) === test ;
10
- } ) ( ) ;
10
+ }
11
11
12
12
// Firefox, Chrome and Opera have Array.prototype[Symbol.iterator], which is the exact same function as Array.prototype.values.
13
- if ( 'Symbol' in self && 'iterator' in Symbol && typeof Array . prototype [ Symbol . iterator ] === 'function' && ! hasLegacyIterator ) {
13
+ if ( 'Symbol' in self && 'iterator' in Symbol && typeof Array . prototype [ Symbol . iterator ] === 'function' && hasModernIterator ( ) ) {
14
14
CreateMethodProperty ( Array . prototype , 'values' , Array . prototype [ Symbol . iterator ] ) ;
15
15
} else {
16
16
CreateMethodProperty ( Array . prototype , 'values' , function values ( ) {
You can’t perform that action at this time.
0 commit comments