Skip to content

Commit 6d02d1f

Browse files
committed
Add tests.
1 parent 39d1c8b commit 6d02d1f

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//// [nonPrimitiveRhsSideOfInExpression.ts]
2+
let o: object = {};
3+
4+
function f(): object {
5+
return {};
6+
}
7+
8+
const b1 = "foo" in o;
9+
const b2 = "bar" in f();
10+
11+
//// [nonPrimitiveRhsSideOfInExpression.js]
12+
var o = {};
13+
function f() {
14+
return {};
15+
}
16+
var b1 = "foo" in o;
17+
var b2 = "bar" in f();
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
=== tests/cases/conformance/types/nonPrimitive/nonPrimitiveRhsSideOfInExpression.ts ===
2+
let o: object = {};
3+
>o : Symbol(o, Decl(nonPrimitiveRhsSideOfInExpression.ts, 0, 3))
4+
5+
function f(): object {
6+
>f : Symbol(f, Decl(nonPrimitiveRhsSideOfInExpression.ts, 0, 19))
7+
8+
return {};
9+
}
10+
11+
const b1 = "foo" in o;
12+
>b1 : Symbol(b1, Decl(nonPrimitiveRhsSideOfInExpression.ts, 6, 5))
13+
>o : Symbol(o, Decl(nonPrimitiveRhsSideOfInExpression.ts, 0, 3))
14+
15+
const b2 = "bar" in f();
16+
>b2 : Symbol(b2, Decl(nonPrimitiveRhsSideOfInExpression.ts, 7, 5))
17+
>f : Symbol(f, Decl(nonPrimitiveRhsSideOfInExpression.ts, 0, 19))
18+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
=== tests/cases/conformance/types/nonPrimitive/nonPrimitiveRhsSideOfInExpression.ts ===
2+
let o: object = {};
3+
>o : object
4+
>{} : {}
5+
6+
function f(): object {
7+
>f : () => object
8+
9+
return {};
10+
>{} : {}
11+
}
12+
13+
const b1 = "foo" in o;
14+
>b1 : boolean
15+
>"foo" in o : boolean
16+
>"foo" : "foo"
17+
>o : object
18+
19+
const b2 = "bar" in f();
20+
>b2 : boolean
21+
>"bar" in f() : boolean
22+
>"bar" : "bar"
23+
>f() : object
24+
>f : () => object
25+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
let o: object = {};
2+
3+
function f(): object {
4+
return {};
5+
}
6+
7+
const b1 = "foo" in o;
8+
const b2 = "bar" in f();

0 commit comments

Comments
 (0)