|
1 | | -=== tests/cases/compiler/exportDefaultProperty.ts === |
2 | | -export default "".length |
3 | | ->"".length : Symbol(String.length, Decl(lib.d.ts, --, --)) |
| 1 | +=== tests/cases/compiler/index.ts === |
| 2 | +/// <reference path="declarations.d.ts" /> |
| 3 | +import fooBar from "foobar"; |
| 4 | +>fooBar : Symbol(fooBar, Decl(index.ts, 1, 6)) |
| 5 | + |
| 6 | +import X = fooBar.X; |
| 7 | +>X : Symbol(X, Decl(index.ts, 1, 28)) |
| 8 | +>fooBar : Symbol(fooBar, Decl(index.ts, 1, 6)) |
| 9 | +>X : Symbol(fooBar.X, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16)) |
| 10 | + |
| 11 | +import X2 from "foobarx"; |
| 12 | +>X2 : Symbol(X2, Decl(index.ts, 3, 6)) |
| 13 | + |
| 14 | +const x: X = X; |
| 15 | +>x : Symbol(x, Decl(index.ts, 4, 5)) |
| 16 | +>X : Symbol(X, Decl(index.ts, 1, 28)) |
| 17 | +>X : Symbol(X, Decl(index.ts, 1, 28)) |
| 18 | + |
| 19 | +const x2: X2 = X2; |
| 20 | +>x2 : Symbol(x2, Decl(index.ts, 5, 5)) |
| 21 | +>X2 : Symbol(X2, Decl(index.ts, 3, 6)) |
| 22 | +>X2 : Symbol(X2, Decl(index.ts, 3, 6)) |
| 23 | + |
| 24 | +import B from "./a"; |
| 25 | +>B : Symbol(B, Decl(index.ts, 7, 6)) |
| 26 | + |
| 27 | +const b: B = new B(B.b); |
| 28 | +>b : Symbol(b, Decl(index.ts, 8, 5)) |
| 29 | +>B : Symbol(B, Decl(index.ts, 7, 6)) |
| 30 | +>B : Symbol(B, Decl(index.ts, 7, 6)) |
| 31 | +>B.b : Symbol(B.b, Decl(a.ts, 2, 37)) |
| 32 | +>B : Symbol(B, Decl(index.ts, 7, 6)) |
| 33 | +>b : Symbol(B.b, Decl(a.ts, 2, 37)) |
| 34 | + |
| 35 | +import fooLength from "./b"; |
| 36 | +>fooLength : Symbol(fooLength, Decl(index.ts, 10, 6)) |
| 37 | + |
| 38 | +fooLength + 1; |
| 39 | +>fooLength : Symbol(fooLength, Decl(index.ts, 10, 6)) |
| 40 | + |
| 41 | +=== tests/cases/compiler/declarations.d.ts === |
| 42 | +// This test is just like exportEqualsProperty, but with `export default`. |
| 43 | + |
| 44 | +declare namespace foo.bar { |
| 45 | +>foo : Symbol(foo, Decl(declarations.d.ts, 0, 0)) |
| 46 | +>bar : Symbol(bar, Decl(declarations.d.ts, 2, 22)) |
| 47 | + |
| 48 | + export type X = number; |
| 49 | +>X : Symbol(X, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16)) |
| 50 | + |
| 51 | + export const X: number; |
| 52 | +>X : Symbol(X, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16)) |
| 53 | +} |
| 54 | + |
| 55 | +declare module "foobar" { |
| 56 | + export default foo.bar; |
| 57 | +>foo.bar : Symbol(default, Decl(declarations.d.ts, 2, 22)) |
| 58 | +>foo : Symbol(foo, Decl(declarations.d.ts, 0, 0)) |
| 59 | +>bar : Symbol(default, Decl(declarations.d.ts, 2, 22)) |
| 60 | +} |
| 61 | + |
| 62 | +declare module "foobarx" { |
| 63 | + export default foo.bar.X; |
| 64 | +>foo.bar.X : Symbol(default, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16)) |
| 65 | +>foo.bar : Symbol(foo.bar, Decl(declarations.d.ts, 2, 22)) |
| 66 | +>foo : Symbol(foo, Decl(declarations.d.ts, 0, 0)) |
| 67 | +>bar : Symbol(foo.bar, Decl(declarations.d.ts, 2, 22)) |
| 68 | +>X : Symbol(default, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16)) |
| 69 | +} |
| 70 | + |
| 71 | +=== tests/cases/compiler/a.ts === |
| 72 | +namespace A { |
| 73 | +>A : Symbol(A, Decl(a.ts, 0, 0)) |
| 74 | + |
| 75 | + export class B { constructor(b: number) {} } |
| 76 | +>B : Symbol(B, Decl(a.ts, 0, 13), Decl(a.ts, 1, 48)) |
| 77 | +>b : Symbol(b, Decl(a.ts, 1, 33)) |
| 78 | + |
| 79 | + export namespace B { export const b: number = 0; } |
| 80 | +>B : Symbol(B, Decl(a.ts, 0, 13), Decl(a.ts, 1, 48)) |
| 81 | +>b : Symbol(b, Decl(a.ts, 2, 37)) |
| 82 | +} |
| 83 | +export default A.B; |
| 84 | +>A.B : Symbol(default, Decl(a.ts, 0, 13), Decl(a.ts, 1, 48)) |
| 85 | +>A : Symbol(A, Decl(a.ts, 0, 0)) |
| 86 | +>B : Symbol(default, Decl(a.ts, 0, 13), Decl(a.ts, 1, 48)) |
| 87 | + |
| 88 | +=== tests/cases/compiler/b.ts === |
| 89 | +export default "foo".length; |
| 90 | +>"foo".length : Symbol(String.length, Decl(lib.d.ts, --, --)) |
4 | 91 | >length : Symbol(String.length, Decl(lib.d.ts, --, --)) |
5 | 92 |
|
0 commit comments