mirror of
https://github.com/hanzoai/core-js.git
synced 2026-09-24 16:58:15 +00:00
fix possible early error in get-iterator-method helper
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# Changelog
|
||||
### Unreleased
|
||||
- Fixed possible crash on some keys in `Symbol.for`
|
||||
- Fixed possible early error in `get-iterator-method` helper
|
||||
- Improved the way of inner iterators cleaning in iterator helpers
|
||||
- Improved accuracy of `Math.asinh` polyfill
|
||||
- Improved performance of `Uint8Array` base64 methods
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
'use strict';
|
||||
var classof = require('../internals/classof');
|
||||
var getMethod = require('../internals/get-method');
|
||||
var isNullOrUndefined = require('../internals/is-null-or-undefined');
|
||||
var Iterators = require('../internals/iterators');
|
||||
var wellKnownSymbol = require('../internals/well-known-symbol');
|
||||
@@ -8,7 +7,7 @@ var wellKnownSymbol = require('../internals/well-known-symbol');
|
||||
var ITERATOR = wellKnownSymbol('iterator');
|
||||
|
||||
module.exports = function (it) {
|
||||
if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
|
||||
|| getMethod(it, '@@iterator')
|
||||
if (!isNullOrUndefined(it)) return it[ITERATOR]
|
||||
|| it['@@iterator']
|
||||
|| Iterators[classof(it)];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user