Skip to content

Commit a5b9552

Browse files
slowcheetahzloirock
authored andcommitted
Fix argument validation condition
1 parent 24ad7ea commit a5b9552

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/core-js/modules/esnext.iterator.chunks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var IteratorProxy = createIteratorProxy(function () {
3434
$({ target: 'Iterator', proto: true, real: true, forced: true }, {
3535
chunks: function chunks(chunkSize) {
3636
var O = anObject(this);
37-
if (!chunkSize || chunkSize >>> 0 !== chunkSize) {
37+
if (typeof chunkSize != 'number' || !chunkSize || chunkSize >>> 0 !== chunkSize) {
3838
return iteratorClose(O, 'throw', new $RangeError('chunkSize must be integer in [1, 2^32-1]'));
3939
}
4040
return new IteratorProxy(getIteratorDirect(O), {

packages/core-js/modules/esnext.iterator.windows.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var IteratorProxy = createIteratorProxy(function () {
3535
$({ target: 'Iterator', proto: true, real: true, forced: true }, {
3636
windows: function windows(windowSize) {
3737
var O = anObject(this);
38-
if (!windowSize || windowSize >>> 0 !== windowSize) {
38+
if (typeof windowSize != 'number' || !windowSize || windowSize >>> 0 !== windowSize) {
3939
return iteratorClose(O, 'throw', new $RangeError('windowSize must be integer in [1, 2^32-1]'));
4040
}
4141
return new IteratorProxy(getIteratorDirect(O), {

tests/eslint/eslint.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,12 +1251,12 @@ const forbidCompletelyNonExistentBuiltIns = {
12511251
'zipKeyed',
12521252
] }],
12531253
'es/no-nonstandard-iterator-prototype-properties': [ERROR, { allow: [
1254+
'chunks',
12541255
'toAsync',
1256+
'windows',
12551257
// TODO: drop from `core-js@4`
12561258
'asIndexedPairs',
12571259
'indexed',
1258-
'chunks',
1259-
'windows',
12601260
] }],
12611261
'es/no-nonstandard-json-properties': [ERROR, { allow: [
12621262
'isRawJSON',

0 commit comments

Comments
 (0)