Skip to content

Commit 7c72f3d

Browse files
committed
Update baselines
1 parent fe66d9e commit 7c72f3d

22 files changed

+332
-93
lines changed

tests/baselines/reference/objectRest.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//// [objectRest.ts]
2-
let o = { a: 1, b: 'no' }
2+
var o = { a: 1, b: 'no' }
33
var { ...clone } = o;
44
var { a, ...justB } = o;
55
var { a, b: renamed, ...empty } = o;
@@ -31,31 +31,36 @@ class Removable {
3131
}
3232
var removable = new Removable();
3333
var { removed, ...removableRest } = removable;
34+
35+
let computed = 'b';
36+
let computed2 = 'a';
37+
var { [computed]: stillNotGreat, [computed2]: soSo, ...o } = o;
38+
({ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o);
3439

3540

3641
//// [objectRest.js]
3742
var __rest = (this && this.__rest) || function (s, e) {
3843
var t = {};
39-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && !e.indexOf(p))
44+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) === -1)
4045
t[p] = s[p];
4146
return t;
4247
};
43-
let o = { a: 1, b: 'no' };
48+
var o = { a: 1, b: 'no' };
4449
var clone = __rest(o, []);
4550
var { a } = o, justB = __rest(o, ["a"]);
4651
var { a, b: renamed } = o, empty = __rest(o, ["a", "b"]);
47-
var { ['b']: renamed } = o, justA = __rest(o, ["b"]);
52+
var _a = 'b', renamed = o[_a], justA = __rest(o, [_a + ""]);
4853
var { 'b': renamed } = o, justA = __rest(o, ["b"]);
4954
var { b: { '0': n, '1': oooo } } = o, justA = __rest(o, ["b"]);
5055
let o2 = { c: 'terrible idea?', d: 'yes' };
5156
var { d: renamed } = o2, d = __rest(o2, ["d"]);
5257
let nestedrest;
53-
var { x } = nestedrest, _a = nestedrest.n1, { y } = _a, _b = _a.n2, { z } = _b, nr = __rest(_b.n3, []), restrest = __rest(nestedrest, ["x", "n1"]);
58+
var { x } = nestedrest, _b = nestedrest.n1, { y } = _b, _c = _b.n2, { z } = _c, nr = __rest(_c.n3, []), restrest = __rest(nestedrest, ["x", "n1"]);
5459
let complex;
55-
var _c = complex.x, { ka } = _c, nested = __rest(_c, ["ka"]), { y: other } = complex, rest = __rest(complex, ["x", "y"]);
56-
(_d = complex.x, { ka } = _d, nested = __rest(_d, ["ka"]), { y: other } = complex, rest = __rest(complex, ["x", "y"]), complex);
57-
var _e = { x: 1, y: 2 }, { x } = _e, fresh = __rest(_e, ["x"]);
58-
(_f = { x: 1, y: 2 }, { x } = _f, fresh = __rest(_f, ["x"]), _f);
60+
var _d = complex.x, { ka } = _d, nested = __rest(_d, ["ka"]), { y: other } = complex, rest = __rest(complex, ["x", "y"]);
61+
(_e = complex.x, { ka } = _e, nested = __rest(_e, ["ka"]), { y: other } = complex, rest = __rest(complex, ["x", "y"]), complex);
62+
var _f = { x: 1, y: 2 }, { x } = _f, fresh = __rest(_f, ["x"]);
63+
(_g = { x: 1, y: 2 }, { x } = _g, fresh = __rest(_g, ["x"]), _g);
5964
class Removable {
6065
set z(value) { }
6166
get both() { return 12; }
@@ -64,4 +69,8 @@ class Removable {
6469
}
6570
var removable = new Removable();
6671
var { removed } = removable, removableRest = __rest(removable, ["removed"]);
67-
var _d, _f;
72+
let computed = 'b';
73+
let computed2 = 'a';
74+
var _h = computed, stillNotGreat = o[_h], _j = computed2, soSo = o[_j], o = __rest(o, [_h + "", _j + ""]);
75+
(_k = computed, stillNotGreat = o[_k], _l = computed2, soSo = o[_l], o = __rest(o, [_k + "", _l + ""]), o);
76+
var _e, _g, _k, _l;

tests/baselines/reference/objectRest.symbols

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
=== tests/cases/conformance/types/rest/objectRest.ts ===
2-
let o = { a: 1, b: 'no' }
3-
>o : Symbol(o, Decl(objectRest.ts, 0, 3))
2+
var o = { a: 1, b: 'no' }
3+
>o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 35, 51))
44
>a : Symbol(a, Decl(objectRest.ts, 0, 9))
55
>b : Symbol(b, Decl(objectRest.ts, 0, 15))
66

77
var { ...clone } = o;
88
>clone : Symbol(clone, Decl(objectRest.ts, 1, 5))
9-
>o : Symbol(o, Decl(objectRest.ts, 0, 3))
9+
>o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 35, 51))
1010

1111
var { a, ...justB } = o;
1212
>a : Symbol(a, Decl(objectRest.ts, 2, 5), Decl(objectRest.ts, 3, 5))
1313
>justB : Symbol(justB, Decl(objectRest.ts, 2, 8))
14-
>o : Symbol(o, Decl(objectRest.ts, 0, 3))
14+
>o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 35, 51))
1515

1616
var { a, b: renamed, ...empty } = o;
1717
>a : Symbol(a, Decl(objectRest.ts, 2, 5), Decl(objectRest.ts, 3, 5))
1818
>b : Symbol(b, Decl(objectRest.ts, 0, 15))
1919
>renamed : Symbol(renamed, Decl(objectRest.ts, 3, 8), Decl(objectRest.ts, 4, 5), Decl(objectRest.ts, 5, 5), Decl(objectRest.ts, 9, 5))
2020
>empty : Symbol(empty, Decl(objectRest.ts, 3, 20))
21-
>o : Symbol(o, Decl(objectRest.ts, 0, 3))
21+
>o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 35, 51))
2222

2323
var { ['b']: renamed, ...justA } = o;
2424
>'b' : Symbol(renamed, Decl(objectRest.ts, 3, 8), Decl(objectRest.ts, 4, 5), Decl(objectRest.ts, 5, 5), Decl(objectRest.ts, 9, 5))
2525
>renamed : Symbol(renamed, Decl(objectRest.ts, 3, 8), Decl(objectRest.ts, 4, 5), Decl(objectRest.ts, 5, 5), Decl(objectRest.ts, 9, 5))
2626
>justA : Symbol(justA, Decl(objectRest.ts, 4, 21), Decl(objectRest.ts, 5, 19), Decl(objectRest.ts, 6, 31))
27-
>o : Symbol(o, Decl(objectRest.ts, 0, 3))
27+
>o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 35, 51))
2828

2929
var { 'b': renamed, ...justA } = o;
3030
>renamed : Symbol(renamed, Decl(objectRest.ts, 3, 8), Decl(objectRest.ts, 4, 5), Decl(objectRest.ts, 5, 5), Decl(objectRest.ts, 9, 5))
3131
>justA : Symbol(justA, Decl(objectRest.ts, 4, 21), Decl(objectRest.ts, 5, 19), Decl(objectRest.ts, 6, 31))
32-
>o : Symbol(o, Decl(objectRest.ts, 0, 3))
32+
>o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 35, 51))
3333

3434
var { b: { '0': n, '1': oooo }, ...justA } = o;
3535
>b : Symbol(b, Decl(objectRest.ts, 0, 15))
3636
>n : Symbol(n, Decl(objectRest.ts, 6, 10))
3737
>oooo : Symbol(oooo, Decl(objectRest.ts, 6, 18))
3838
>justA : Symbol(justA, Decl(objectRest.ts, 4, 21), Decl(objectRest.ts, 5, 19), Decl(objectRest.ts, 6, 31))
39-
>o : Symbol(o, Decl(objectRest.ts, 0, 3))
39+
>o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 35, 51))
4040

4141
let o2 = { c: 'terrible idea?', d: 'yes' };
4242
>o2 : Symbol(o2, Decl(objectRest.ts, 8, 3))
@@ -91,8 +91,10 @@ var { x: { ka, ...nested }, y: other, ...rest } = complex;
9191
({x: { ka, ...nested }, y: other, ...rest} = complex);
9292
>x : Symbol(x, Decl(objectRest.ts, 16, 2))
9393
>ka : Symbol(ka, Decl(objectRest.ts, 16, 6))
94+
>nested : Symbol(nested, Decl(objectRest.ts, 15, 14))
9495
>y : Symbol(y, Decl(objectRest.ts, 16, 23))
9596
>other : Symbol(other, Decl(objectRest.ts, 15, 27))
97+
>rest : Symbol(rest, Decl(objectRest.ts, 15, 37))
9698
>complex : Symbol(complex, Decl(objectRest.ts, 14, 3))
9799

98100
var { x, ...fresh } = { x: 1, y: 2 };
@@ -103,6 +105,7 @@ var { x, ...fresh } = { x: 1, y: 2 };
103105

104106
({ x, ...fresh } = { x: 1, y: 2 });
105107
>x : Symbol(x, Decl(objectRest.ts, 18, 2))
108+
>fresh : Symbol(fresh, Decl(objectRest.ts, 17, 8))
106109
>x : Symbol(x, Decl(objectRest.ts, 18, 20))
107110
>y : Symbol(y, Decl(objectRest.ts, 18, 26))
108111

@@ -144,3 +147,25 @@ var { removed, ...removableRest } = removable;
144147
>removableRest : Symbol(removableRest, Decl(objectRest.ts, 31, 14))
145148
>removable : Symbol(removable, Decl(objectRest.ts, 30, 3))
146149

150+
let computed = 'b';
151+
>computed : Symbol(computed, Decl(objectRest.ts, 33, 3))
152+
153+
let computed2 = 'a';
154+
>computed2 : Symbol(computed2, Decl(objectRest.ts, 34, 3))
155+
156+
var { [computed]: stillNotGreat, [computed2]: soSo, ...o } = o;
157+
>computed : Symbol(computed, Decl(objectRest.ts, 33, 3))
158+
>stillNotGreat : Symbol(stillNotGreat, Decl(objectRest.ts, 35, 5))
159+
>computed2 : Symbol(computed2, Decl(objectRest.ts, 34, 3))
160+
>soSo : Symbol(soSo, Decl(objectRest.ts, 35, 32))
161+
>o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 35, 51))
162+
>o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 35, 51))
163+
164+
({ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o);
165+
>computed : Symbol(computed, Decl(objectRest.ts, 33, 3))
166+
>stillNotGreat : Symbol(stillNotGreat, Decl(objectRest.ts, 35, 5))
167+
>computed2 : Symbol(computed2, Decl(objectRest.ts, 34, 3))
168+
>soSo : Symbol(soSo, Decl(objectRest.ts, 35, 32))
169+
>o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 35, 51))
170+
>o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 35, 51))
171+

tests/baselines/reference/objectRest.types

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
=== tests/cases/conformance/types/rest/objectRest.ts ===
2-
let o = { a: 1, b: 'no' }
2+
var o = { a: 1, b: 'no' }
33
>o : { a: number; b: string; }
44
>{ a: 1, b: 'no' } : { a: number; b: string; }
55
>a : number
@@ -101,10 +101,10 @@ var { x: { ka, ...nested }, y: other, ...rest } = complex;
101101
>x : { ki: any; ka: any; }
102102
>{ ka, ...nested } : { ki: any; ka: any; }
103103
>ka : any
104-
>nested : any
104+
>nested : { ki: any; }
105105
>y : number
106106
>other : number
107-
>rest : any
107+
>rest : {}
108108
>complex : { x: { ka: any; ki: any; }; y: number; }
109109

110110
var { x, ...fresh } = { x: 1, y: 2 };
@@ -121,7 +121,7 @@ var { x, ...fresh } = { x: 1, y: 2 };
121121
>{ x, ...fresh } = { x: 1, y: 2 } : { x: number; y: number; }
122122
>{ x, ...fresh } : { y: number; x: number; }
123123
>x : number
124-
>fresh : any
124+
>fresh : { y: number; }
125125
>{ x: 1, y: 2 } : { x: number; y: number; }
126126
>x : number
127127
>1 : 1
@@ -168,3 +168,30 @@ var { removed, ...removableRest } = removable;
168168
>removableRest : { both: number; remainder: string; }
169169
>removable : Removable
170170

171+
let computed = 'b';
172+
>computed : string
173+
>'b' : "b"
174+
175+
let computed2 = 'a';
176+
>computed2 : string
177+
>'a' : "a"
178+
179+
var { [computed]: stillNotGreat, [computed2]: soSo, ...o } = o;
180+
>computed : string
181+
>stillNotGreat : any
182+
>computed2 : string
183+
>soSo : any
184+
>o : { a: number; b: string; }
185+
>o : { a: number; b: string; }
186+
187+
({ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o);
188+
>({ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o) : { a: number; b: string; }
189+
>{ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o : { a: number; b: string; }
190+
>{ [computed]: stillNotGreat, [computed2]: soSo, ...o } : { a: number; b: string; }
191+
>computed : string
192+
>stillNotGreat : any
193+
>computed2 : string
194+
>soSo : any
195+
>o : { a: number; b: string; }
196+
>o : { a: number; b: string; }
197+

tests/baselines/reference/objectRestAssignment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var { a: [{ ...nested2 }, ...y], b: { z, ...c }, ...rest2 } = overEmit;
1717
//// [objectRestAssignment.js]
1818
var __rest = (this && this.__rest) || function (s, e) {
1919
var t = {};
20-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && !e.indexOf(p))
20+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) === -1)
2121
t[p] = s[p];
2222
return t;
2323
};

tests/baselines/reference/objectRestAssignment.symbols

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ let complex: { x: { ka, ki }, y: number };
2222
({x: { ka, ...nested }, y: other, ...rest} = complex);
2323
>x : Symbol(x, Decl(objectRestAssignment.ts, 5, 2))
2424
>ka : Symbol(ka, Decl(objectRestAssignment.ts, 5, 6))
25+
>nested : Symbol(nested, Decl(objectRestAssignment.ts, 1, 3))
2526
>y : Symbol(y, Decl(objectRestAssignment.ts, 5, 23))
2627
>other : Symbol(other, Decl(objectRestAssignment.ts, 2, 3))
28+
>rest : Symbol(rest, Decl(objectRestAssignment.ts, 3, 3))
2729
>complex : Symbol(complex, Decl(objectRestAssignment.ts, 4, 3))
2830

2931
// should be:
@@ -52,8 +54,11 @@ var { a: [{ ...nested2 }, ...y], b: { z, ...c }, ...rest2 } = overEmit;
5254

5355
({ a: [{ ...nested2 }, ...y], b: { z, ...c }, ...rest2 } = overEmit);
5456
>a : Symbol(a, Decl(objectRestAssignment.ts, 12, 2))
57+
>nested2 : Symbol(nested2, Decl(objectRestAssignment.ts, 11, 11))
5558
>y : Symbol(y, Decl(objectRestAssignment.ts, 11, 25))
5659
>b : Symbol(b, Decl(objectRestAssignment.ts, 12, 29))
5760
>z : Symbol(z, Decl(objectRestAssignment.ts, 12, 34))
61+
>c : Symbol(c, Decl(objectRestAssignment.ts, 11, 40))
62+
>rest2 : Symbol(rest2, Decl(objectRestAssignment.ts, 11, 48))
5863
>overEmit : Symbol(overEmit, Decl(objectRestAssignment.ts, 8, 3))
5964

tests/baselines/reference/objectRestAssignment.types

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ let complex: { x: { ka, ki }, y: number };
2626
>x : { ki: any; ka: any; }
2727
>{ ka, ...nested } : { ki: any; ka: any; }
2828
>ka : any
29-
>nested : any
29+
>nested : { ki: any; }
3030
>y : number
3131
>other : number
32-
>rest : any
32+
>rest : {}
3333
>complex : { x: { ka: any; ki: any; }; y: number; }
3434

3535
// should be:
@@ -63,13 +63,13 @@ var { a: [{ ...nested2 }, ...y], b: { z, ...c }, ...rest2 } = overEmit;
6363
>a : { ka: string; x: string; }[]
6464
>[{ ...nested2 }, ...y] : { ka: string; x: string; }[]
6565
>{ ...nested2 } : { ka: string; x: string; }
66-
>nested2 : any
66+
>nested2 : { ka: string; x: string; }
6767
>...y : { ka: string; x: string; }
6868
>y : { ka: string; x: string; }[]
6969
>b : { ki: string; ku: string; z: string; }
7070
>{ z, ...c } : { ki: string; ku: string; z: string; }
7171
>z : string
72-
>c : any
73-
>rest2 : any
72+
>c : { ki: string; ku: string; }
73+
>rest2 : { ke: string; ko: string; }
7474
>overEmit : { a: { ka: string; x: string; }[]; b: { z: string; ki: string; ku: string; }; ke: string; ko: string; }
7575

tests/baselines/reference/objectRestForOf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var __assign = (this && this.__assign) || Object.assign || function(t) {
2525
};
2626
var __rest = (this && this.__rest) || function (s, e) {
2727
var t = {};
28-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && !e.indexOf(p))
28+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) === -1)
2929
t[p] = s[p];
3030
return t;
3131
};

tests/baselines/reference/objectRestForOf.symbols

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ let rrestOff: { y: string };
2323
for ({ x: xx, ...rrestOff } of array ) {
2424
>x : Symbol(x, Decl(objectRestForOf.ts, 6, 6))
2525
>xx : Symbol(xx, Decl(objectRestForOf.ts, 4, 3))
26+
>rrestOff : Symbol(rrestOff, Decl(objectRestForOf.ts, 5, 3))
2627
>array : Symbol(array, Decl(objectRestForOf.ts, 0, 3))
2728

2829
[xx, rrestOff];
@@ -35,6 +36,7 @@ for (const norest of array.map(a => ({ ...a, x: 'a string' }))) {
3536
>array : Symbol(array, Decl(objectRestForOf.ts, 0, 3))
3637
>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
3738
>a : Symbol(a, Decl(objectRestForOf.ts, 9, 31))
39+
>a : Symbol(a, Decl(objectRestForOf.ts, 9, 31))
3840
>x : Symbol(x, Decl(objectRestForOf.ts, 9, 44))
3941

4042
[norest.x, norest.y];

tests/baselines/reference/objectRestForOf.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ for ({ x: xx, ...rrestOff } of array ) {
2525
>{ x: xx, ...rrestOff } : { y: string; x: number; }
2626
>x : { x: number; y: string; }
2727
>xx : number
28-
>rrestOff : any
28+
>rrestOff : { y: string; }
2929
>array : { x: number; y: string; }[]
3030

3131
[xx, rrestOff];
@@ -43,7 +43,7 @@ for (const norest of array.map(a => ({ ...a, x: 'a string' }))) {
4343
>a : { x: number; y: string; }
4444
>({ ...a, x: 'a string' }) : { x: string; y: string; }
4545
>{ ...a, x: 'a string' } : { x: string; y: string; }
46-
>a : any
46+
>a : { x: number; y: string; }
4747
>x : string
4848
>'a string' : "a string"
4949

tests/baselines/reference/objectRestNegative.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ let rest: { b: string }
1515
//// [objectRestNegative.js]
1616
var __rest = (this && this.__rest) || function (s, e) {
1717
var t = {};
18-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && !e.indexOf(p))
18+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) === -1)
1919
t[p] = s[p];
2020
return t;
2121
};

0 commit comments

Comments
 (0)