Skip to content

Commit 76ef974

Browse files
committed
Expand test to ensure property access on object literal has correct behaviour
1 parent aa4c196 commit 76ef974

8 files changed

+73
-37
lines changed

tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.symbols

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.types

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//// [propertyAccessOnObjectLiteral.ts]
2+
class A { }
3+
4+
(<A>{}).toString();
5+
6+
(() => {
7+
(<A>{}).toString();
8+
})();
9+
10+
11+
//// [propertyAccessOnObjectLiteral.js]
12+
var A = /** @class */ (function () {
13+
function A() {
14+
}
15+
return A;
16+
}());
17+
({}).toString();
18+
(function () {
19+
({}).toString();
20+
})();
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
=== tests/cases/compiler/propertyAccessOnObjectLiteral.ts ===
2+
class A { }
3+
>A : Symbol(A, Decl(propertyAccessOnObjectLiteral.ts, 0, 0))
4+
5+
(<A>{}).toString();
6+
>(<A>{}).toString : Symbol(Object.toString, Decl(lib.d.ts, --, --))
7+
>A : Symbol(A, Decl(propertyAccessOnObjectLiteral.ts, 0, 0))
8+
>toString : Symbol(Object.toString, Decl(lib.d.ts, --, --))
9+
10+
(() => {
11+
(<A>{}).toString();
12+
>(<A>{}).toString : Symbol(Object.toString, Decl(lib.d.ts, --, --))
13+
>A : Symbol(A, Decl(propertyAccessOnObjectLiteral.ts, 0, 0))
14+
>toString : Symbol(Object.toString, Decl(lib.d.ts, --, --))
15+
16+
})();
17+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
=== tests/cases/compiler/propertyAccessOnObjectLiteral.ts ===
2+
class A { }
3+
>A : A
4+
5+
(<A>{}).toString();
6+
>(<A>{}).toString() : string
7+
>(<A>{}).toString : () => string
8+
>(<A>{}) : A
9+
><A>{} : A
10+
>A : A
11+
>{} : {}
12+
>toString : () => string
13+
14+
(() => {
15+
>(() => { (<A>{}).toString();})() : void
16+
>(() => { (<A>{}).toString();}) : () => void
17+
>() => { (<A>{}).toString();} : () => void
18+
19+
(<A>{}).toString();
20+
>(<A>{}).toString() : string
21+
>(<A>{}).toString : () => string
22+
>(<A>{}) : A
23+
><A>{} : A
24+
>A : A
25+
>{} : {}
26+
>toString : () => string
27+
28+
})();
29+

tests/cases/compiler/propertyAccessOnEmptyObjectLiteral.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class A { }
2+
3+
(<A>{}).toString();
4+
5+
(() => {
6+
(<A>{}).toString();
7+
})();

0 commit comments

Comments
 (0)