Skip to content

Commit bf2082e

Browse files
test: jake accept baseline
1 parent 65be5ae commit bf2082e

File tree

4 files changed

+60
-1
lines changed

4 files changed

+60
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//// [objectKeysWithRecord.ts]
2+
type K = 'foo' | 'bar'
3+
const record: Record<K, boolean> = { foo: true, bar: false };
4+
5+
Object.keys(record).forEach((key: K) => {
6+
7+
});
8+
9+
//// [objectKeysWithRecord.js]
10+
var record = { foo: true, bar: false };
11+
Object.keys(record).forEach(function (key) {
12+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
=== tests/cases/compiler/objectKeysWithRecord.ts ===
2+
type K = 'foo' | 'bar'
3+
>K : Symbol(K, Decl(objectKeysWithRecord.ts, 0, 0))
4+
5+
const record: Record<K, boolean> = { foo: true, bar: false };
6+
>record : Symbol(record, Decl(objectKeysWithRecord.ts, 1, 5))
7+
>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --))
8+
>K : Symbol(K, Decl(objectKeysWithRecord.ts, 0, 0))
9+
>foo : Symbol(foo, Decl(objectKeysWithRecord.ts, 1, 36))
10+
>bar : Symbol(bar, Decl(objectKeysWithRecord.ts, 1, 47))
11+
12+
Object.keys(record).forEach((key: K) => {
13+
>Object.keys(record).forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --))
14+
>Object.keys : Symbol(ObjectConstructor.keys, Decl(lib.es5.d.ts, --, --))
15+
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
16+
>keys : Symbol(ObjectConstructor.keys, Decl(lib.es5.d.ts, --, --))
17+
>record : Symbol(record, Decl(objectKeysWithRecord.ts, 1, 5))
18+
>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --))
19+
>key : Symbol(key, Decl(objectKeysWithRecord.ts, 3, 29))
20+
>K : Symbol(K, Decl(objectKeysWithRecord.ts, 0, 0))
21+
22+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
=== tests/cases/compiler/objectKeysWithRecord.ts ===
2+
type K = 'foo' | 'bar'
3+
>K : K
4+
5+
const record: Record<K, boolean> = { foo: true, bar: false };
6+
>record : Record<K, boolean>
7+
>{ foo: true, bar: false } : { foo: true; bar: false; }
8+
>foo : true
9+
>true : true
10+
>bar : false
11+
>false : false
12+
13+
Object.keys(record).forEach((key: K) => {
14+
>Object.keys(record).forEach((key: K) => {}) : void
15+
>Object.keys(record).forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void
16+
>Object.keys(record) : string[]
17+
>Object.keys : (o: {}) => string[]
18+
>Object : ObjectConstructor
19+
>keys : (o: {}) => string[]
20+
>record : Record<K, boolean>
21+
>forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void
22+
>(key: K) => {} : (key: K) => void
23+
>key : K
24+
25+
});

tests/cases/compiler/objectKeysWithRecord.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ const record: Record<K, boolean> = { foo: true, bar: false };
33

44
Object.keys(record).forEach((key: K) => {
55

6-
});
6+
});

0 commit comments

Comments
 (0)