Skip to content

Commit 2ec03f3

Browse files
committed
Baselines
1 parent 6efc2f1 commit 2ec03f3

8 files changed

+140
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
tests/cases/compiler/index.ts(6,1): error TS2304: Cannot find name 'window'.
2+
3+
4+
==== /node_modules/@typescript/dom/index.d.ts (0 errors) ====
5+
interface ABC { abc: string }
6+
==== tests/cases/compiler/index.ts (1 errors) ====
7+
/// <reference lib="dom" />
8+
const a: ABC = { abc: "Hello" }
9+
10+
// This should fail because libdom has been replaced
11+
// by the module above ^
12+
window.localStorage
13+
~~~~~~
14+
!!! error TS2304: Cannot find name 'window'.
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//// [tests/cases/compiler/libTypeScriptOverrideSimple.ts] ////
2+
3+
//// [index.d.ts]
4+
interface ABC { abc: string }
5+
//// [index.ts]
6+
/// <reference lib="dom" />
7+
const a: ABC = { abc: "Hello" }
8+
9+
// This should fail because libdom has been replaced
10+
// by the module above ^
11+
window.localStorage
12+
13+
//// [index.js]
14+
/// <reference lib="dom" />
15+
var a = { abc: "Hello" };
16+
// This should fail because libdom has been replaced
17+
// by the module above ^
18+
window.localStorage;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
=== /node_modules/@typescript/dom/index.d.ts ===
2+
interface ABC { abc: string }
3+
>ABC : Symbol(ABC, Decl(index.d.ts, 0, 0))
4+
>abc : Symbol(ABC.abc, Decl(index.d.ts, 0, 15))
5+
6+
=== tests/cases/compiler/index.ts ===
7+
/// <reference lib="dom" />
8+
const a: ABC = { abc: "Hello" }
9+
>a : Symbol(a, Decl(index.ts, 1, 5))
10+
>ABC : Symbol(ABC, Decl(index.d.ts, 0, 0))
11+
>abc : Symbol(abc, Decl(index.ts, 1, 16))
12+
13+
// This should fail because libdom has been replaced
14+
// by the module above ^
15+
window.localStorage
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
=== /node_modules/@typescript/dom/index.d.ts ===
2+
interface ABC { abc: string }
3+
>abc : string
4+
5+
=== tests/cases/compiler/index.ts ===
6+
/// <reference lib="dom" />
7+
const a: ABC = { abc: "Hello" }
8+
>a : ABC
9+
>{ abc: "Hello" } : { abc: string; }
10+
>abc : string
11+
>"Hello" : "Hello"
12+
13+
// This should fail because libdom has been replaced
14+
// by the module above ^
15+
window.localStorage
16+
>window.localStorage : any
17+
>window : any
18+
>localStorage : any
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
tests/cases/compiler/index.ts(6,1): error TS2304: Cannot find name 'window'.
2+
3+
4+
==== /node_modules/@typescript/dom/index.d.ts (0 errors) ====
5+
// NOOP
6+
==== /node_modules/@typescript/dom/iterable.d.ts (0 errors) ====
7+
interface DOMIterable { abc: string }
8+
==== tests/cases/compiler/index.ts (1 errors) ====
9+
/// <reference lib="dom.iterable" />
10+
const a: DOMIterable = { abc: "Hello" }
11+
12+
// This should fail because libdom has been replaced
13+
// by the module above ^
14+
window.localStorage
15+
~~~~~~
16+
!!! error TS2304: Cannot find name 'window'.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//// [tests/cases/compiler/libTypeScriptSubfileResolving.ts] ////
2+
3+
//// [index.d.ts]
4+
// NOOP
5+
//// [iterable.d.ts]
6+
interface DOMIterable { abc: string }
7+
//// [index.ts]
8+
/// <reference lib="dom.iterable" />
9+
const a: DOMIterable = { abc: "Hello" }
10+
11+
// This should fail because libdom has been replaced
12+
// by the module above ^
13+
window.localStorage
14+
15+
//// [index.js]
16+
/// <reference lib="dom.iterable" />
17+
var a = { abc: "Hello" };
18+
// This should fail because libdom has been replaced
19+
// by the module above ^
20+
window.localStorage;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
=== /node_modules/@typescript/dom/index.d.ts ===
2+
// NOOP
3+
No type information for this code.=== /node_modules/@typescript/dom/iterable.d.ts ===
4+
interface DOMIterable { abc: string }
5+
>DOMIterable : Symbol(DOMIterable, Decl(iterable.d.ts, 0, 0))
6+
>abc : Symbol(DOMIterable.abc, Decl(iterable.d.ts, 0, 23))
7+
8+
=== tests/cases/compiler/index.ts ===
9+
/// <reference lib="dom.iterable" />
10+
const a: DOMIterable = { abc: "Hello" }
11+
>a : Symbol(a, Decl(index.ts, 1, 5))
12+
>DOMIterable : Symbol(DOMIterable, Decl(iterable.d.ts, 0, 0))
13+
>abc : Symbol(abc, Decl(index.ts, 1, 24))
14+
15+
// This should fail because libdom has been replaced
16+
// by the module above ^
17+
window.localStorage
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
=== /node_modules/@typescript/dom/index.d.ts ===
2+
// NOOP
3+
No type information for this code.=== /node_modules/@typescript/dom/iterable.d.ts ===
4+
interface DOMIterable { abc: string }
5+
>abc : string
6+
7+
=== tests/cases/compiler/index.ts ===
8+
/// <reference lib="dom.iterable" />
9+
const a: DOMIterable = { abc: "Hello" }
10+
>a : DOMIterable
11+
>{ abc: "Hello" } : { abc: string; }
12+
>abc : string
13+
>"Hello" : "Hello"
14+
15+
// This should fail because libdom has been replaced
16+
// by the module above ^
17+
window.localStorage
18+
>window.localStorage : any
19+
>window : any
20+
>localStorage : any
21+

0 commit comments

Comments
 (0)