mirror of
https://github.com/hanzoai/core-js.git
synced 2026-09-24 16:58:15 +00:00
change Iterator chunking unconditional forced replacement to feature detection
This commit is contained in:
@@ -6,6 +6,7 @@ var createIteratorProxy = require('../internals/iterator-create-proxy');
|
||||
var getIteratorDirect = require('../internals/get-iterator-direct');
|
||||
var iteratorClose = require('../internals/iterator-close');
|
||||
var uncurryThis = require('../internals/function-uncurry-this');
|
||||
var IS_PURE = require('../internals/is-pure');
|
||||
|
||||
var $RangeError = RangeError;
|
||||
var push = uncurryThis([].push);
|
||||
@@ -31,7 +32,7 @@ var IteratorProxy = createIteratorProxy(function () {
|
||||
|
||||
// `Iterator.prototype.chunks` method
|
||||
// https://github.com/tc39/proposal-iterator-chunking
|
||||
$({ target: 'Iterator', proto: true, real: true, forced: true }, {
|
||||
$({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
|
||||
chunks: function chunks(chunkSize) {
|
||||
var O = anObject(this);
|
||||
if (typeof chunkSize != 'number' || !chunkSize || chunkSize >>> 0 !== chunkSize) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
'use strict';
|
||||
var $ = require('../internals/export');
|
||||
var iteratorWindow = require('../internals/iterator-window');
|
||||
var IS_PURE = require('../internals/is-pure');
|
||||
|
||||
// `Iterator.prototype.windows` method
|
||||
// https://github.com/tc39/proposal-iterator-chunking
|
||||
$({ target: 'Iterator', proto: true, real: true, forced: true }, {
|
||||
$({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
|
||||
windows: function windows(windowSize /* , undersized */) {
|
||||
return iteratorWindow(this, windowSize, arguments.length < 2 ? undefined : arguments[1]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user