Skip to content

Commit a7aee4c

Browse files
committed
some fixes
1 parent 12b441d commit a7aee4c

File tree

5 files changed

+36
-34
lines changed

5 files changed

+36
-34
lines changed

packages/core-js/internals/iterator-zip.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var IteratorProxy = createIteratorProxy(function () {
2828
for (var i = 0; i < iterCount; i++) {
2929
var iter = iters[i];
3030
if (iter === null) {
31-
push(results, padding[i]);
31+
result = padding[i];
3232
} else {
3333
try {
3434
result = call(iter.next, iter.iterator);
@@ -79,8 +79,8 @@ var IteratorProxy = createIteratorProxy(function () {
7979
iters[i] = null;
8080
result = padding[i];
8181
}
82-
push(results, result);
8382
}
83+
push(results, result);
8484
}
8585

8686
return finishResults ? finishResults(results) : results;

tests/unit-global/esnext.iterator.zip-keyed.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ QUnit.test('Iterator.zipKeyed', assert => {
6262
}
6363

6464
{
65-
const result = zipKeyed({
65+
const $result = zipKeyed({
6666
a: [0, 1, 2],
6767
b: [3, 4, 5, 6, 7],
6868
c: [8, 9],
6969
}, {
70-
mode: "longest",
70+
mode: 'longest',
7171
});
7272

73-
assert.deepEqual(from(result), [
73+
assert.deepEqual(from($result), [
7474
nullProto({ a: 0, b: 3, c: 8 }),
7575
nullProto({ a: 1, b: 4, c: 9 }),
7676
nullProto({ a: 2, b: 5, c: undefined }),
@@ -80,16 +80,16 @@ QUnit.test('Iterator.zipKeyed', assert => {
8080
}
8181

8282
{
83-
const result = zipKeyed({
83+
const $result = zipKeyed({
8484
a: [0, 1, 2],
8585
b: [3, 4, 5, 6, 7],
8686
c: [8, 9],
8787
}, {
88-
mode: "longest",
88+
mode: 'longest',
8989
padding: { a: 'A', b: 'B', c: 'C' },
9090
});
9191

92-
assert.deepEqual(from(result), [
92+
assert.deepEqual(from($result), [
9393
nullProto({ a: 0, b: 3, c: 8 }),
9494
nullProto({ a: 1, b: 4, c: 9 }),
9595
nullProto({ a: 2, b: 5, c: 'C' }),

tests/unit-global/esnext.iterator.zip.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,39 +64,39 @@ QUnit.test('Iterator.zip', assert => {
6464
}
6565

6666
{
67-
const result = zip([
67+
const $result = zip([
6868
[0, 1, 2],
6969
[3, 4, 5, 6, 7],
7070
[8, 9],
7171
], {
72-
mode: "longest",
72+
mode: 'longest',
7373
});
7474

75-
assert.deepEqual(from(result), [
75+
assert.deepEqual(from($result), [
7676
[0, 3, 8],
7777
[1, 4, 9],
7878
[2, 5, undefined],
7979
[undefined, 6, undefined],
80-
[undefined, 7, undefined]
80+
[undefined, 7, undefined],
8181
]);
8282
}
8383

8484
{
85-
const result = zip([
85+
const $result = zip([
8686
[0, 1, 2],
8787
[3, 4, 5, 6, 7],
8888
[8, 9],
8989
], {
90-
mode: "longest",
91-
padding: ["A", "B", "C"],
90+
mode: 'longest',
91+
padding: ['A', 'B', 'C'],
9292
});
9393

94-
assert.deepEqual(from(result), [
94+
assert.deepEqual(from($result), [
9595
[0, 3, 8],
9696
[1, 4, 9],
9797
[2, 5, 'C'],
9898
['A', 6, 'C'],
99-
['A', 7, 'C']
99+
['A', 7, 'C'],
100100
]);
101101
}
102102
});

tests/unit-pure/esnext.iterator.zip-keyed.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import { DESCRIPTORS } from '../helpers/constants.js';
33

44
import defineProperty from 'core-js-pure/actual/object/define-property';
55
import from from 'core-js-pure/es/array/from';
6-
import Symbol from 'core-js-pure/full/symbol';
6+
import assign from 'core-js-pure/es/object/assign';
7+
import create from 'core-js-pure/es/object/create';
8+
import Symbol from 'core-js-pure/es/symbol';
79
import zipKeyed from 'core-js-pure/full/iterator/zip-keyed';
810

911
function nullProto(obj) {
10-
return Object.assign(Object.create(null), obj);
12+
return assign(create(null), obj);
1113
}
1214

1315
QUnit.test('Iterator.zipKeyed', assert => {
@@ -61,15 +63,15 @@ QUnit.test('Iterator.zipKeyed', assert => {
6163
}
6264

6365
{
64-
const result = zipKeyed({
66+
const $result = zipKeyed({
6567
a: [0, 1, 2],
6668
b: [3, 4, 5, 6, 7],
6769
c: [8, 9],
6870
}, {
69-
mode: "longest",
71+
mode: 'longest',
7072
});
7173

72-
assert.deepEqual(from(result), [
74+
assert.deepEqual(from($result), [
7375
nullProto({ a: 0, b: 3, c: 8 }),
7476
nullProto({ a: 1, b: 4, c: 9 }),
7577
nullProto({ a: 2, b: 5, c: undefined }),
@@ -79,16 +81,16 @@ QUnit.test('Iterator.zipKeyed', assert => {
7981
}
8082

8183
{
82-
const result = zipKeyed({
84+
const $result = zipKeyed({
8385
a: [0, 1, 2],
8486
b: [3, 4, 5, 6, 7],
8587
c: [8, 9],
8688
}, {
87-
mode: "longest",
89+
mode: 'longest',
8890
padding: { a: 'A', b: 'B', c: 'C' },
8991
});
9092

91-
assert.deepEqual(from(result), [
93+
assert.deepEqual(from($result), [
9294
nullProto({ a: 0, b: 3, c: 8 }),
9395
nullProto({ a: 1, b: 4, c: 9 }),
9496
nullProto({ a: 2, b: 5, c: 'C' }),

tests/unit-pure/esnext.iterator.zip.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,39 +62,39 @@ QUnit.test('Iterator.zip', assert => {
6262
}
6363

6464
{
65-
const result = zip([
65+
const $result = zip([
6666
[0, 1, 2],
6767
[3, 4, 5, 6, 7],
6868
[8, 9],
6969
], {
70-
mode: "longest",
70+
mode: 'longest',
7171
});
7272

73-
assert.deepEqual(from(result), [
73+
assert.deepEqual(from($result), [
7474
[0, 3, 8],
7575
[1, 4, 9],
7676
[2, 5, undefined],
7777
[undefined, 6, undefined],
78-
[undefined, 7, undefined]
78+
[undefined, 7, undefined],
7979
]);
8080
}
8181

8282
{
83-
const result = zip([
83+
const $result = zip([
8484
[0, 1, 2],
8585
[3, 4, 5, 6, 7],
8686
[8, 9],
8787
], {
88-
mode: "longest",
89-
padding: ["A", "B", "C"],
88+
mode: 'longest',
89+
padding: ['A', 'B', 'C'],
9090
});
9191

92-
assert.deepEqual(from(result), [
92+
assert.deepEqual(from($result), [
9393
[0, 3, 8],
9494
[1, 4, 9],
9595
[2, 5, 'C'],
9696
['A', 6, 'C'],
97-
['A', 7, 'C']
97+
['A', 7, 'C'],
9898
]);
9999
}
100100
});

0 commit comments

Comments
 (0)