220 lines
8.6 KiB
Text
220 lines
8.6 KiB
Text
=== tests/cases/compiler/importDecl_1.ts ===
|
|
///<reference path='importDecl_require.ts'/>
|
|
///<reference path='importDecl_require1.ts'/>
|
|
///<reference path='importDecl_require2.ts'/>
|
|
///<reference path='importDecl_require3.ts'/>
|
|
///<reference path='importDecl_require4.ts'/>
|
|
import m4 = require("importDecl_require"); // Emit used
|
|
>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0))
|
|
|
|
export var x4 = m4.x;
|
|
>x4 : Symbol(x4, Decl(importDecl_1.ts, 6, 10))
|
|
>m4.x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10))
|
|
>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0))
|
|
>x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10))
|
|
|
|
export var d4 = m4.d;
|
|
>d4 : Symbol(d4, Decl(importDecl_1.ts, 7, 10))
|
|
>m4.d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0))
|
|
>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0))
|
|
>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0))
|
|
|
|
export var f4 = m4.foo();
|
|
>f4 : Symbol(f4, Decl(importDecl_1.ts, 8, 10))
|
|
>m4.foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16))
|
|
>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0))
|
|
>foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16))
|
|
|
|
export module m1 {
|
|
>m1 : Symbol(m1, Decl(importDecl_1.ts, 8, 25))
|
|
|
|
export var x2 = m4.x;
|
|
>x2 : Symbol(x2, Decl(importDecl_1.ts, 11, 14))
|
|
>m4.x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10))
|
|
>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0))
|
|
>x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10))
|
|
|
|
export var d2 = m4.d;
|
|
>d2 : Symbol(d2, Decl(importDecl_1.ts, 12, 14))
|
|
>m4.d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0))
|
|
>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0))
|
|
>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0))
|
|
|
|
export var f2 = m4.foo();
|
|
>f2 : Symbol(f2, Decl(importDecl_1.ts, 13, 14))
|
|
>m4.foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16))
|
|
>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0))
|
|
>foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16))
|
|
|
|
var x3 = m4.x;
|
|
>x3 : Symbol(x3, Decl(importDecl_1.ts, 15, 7))
|
|
>m4.x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10))
|
|
>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0))
|
|
>x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10))
|
|
|
|
var d3 = m4.d;
|
|
>d3 : Symbol(d3, Decl(importDecl_1.ts, 16, 7))
|
|
>m4.d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0))
|
|
>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0))
|
|
>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0))
|
|
|
|
var f3 = m4.foo();
|
|
>f3 : Symbol(f3, Decl(importDecl_1.ts, 17, 7))
|
|
>m4.foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16))
|
|
>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0))
|
|
>foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16))
|
|
}
|
|
|
|
//Emit global only usage
|
|
import glo_m4 = require("importDecl_require1");
|
|
>glo_m4 : Symbol(glo_m4, Decl(importDecl_1.ts, 18, 1))
|
|
|
|
export var useGlo_m4_d4 = glo_m4.d;
|
|
>useGlo_m4_d4 : Symbol(useGlo_m4_d4, Decl(importDecl_1.ts, 22, 10))
|
|
>glo_m4.d : Symbol(glo_m4.d, Decl(importDecl_require1.ts, 0, 0))
|
|
>glo_m4 : Symbol(glo_m4, Decl(importDecl_1.ts, 18, 1))
|
|
>d : Symbol(glo_m4.d, Decl(importDecl_require1.ts, 0, 0))
|
|
|
|
export var useGlo_m4_f4 = glo_m4.foo();
|
|
>useGlo_m4_f4 : Symbol(useGlo_m4_f4, Decl(importDecl_1.ts, 23, 10))
|
|
>glo_m4.foo : Symbol(glo_m4.foo, Decl(importDecl_require1.ts, 3, 9))
|
|
>glo_m4 : Symbol(glo_m4, Decl(importDecl_1.ts, 18, 1))
|
|
>foo : Symbol(glo_m4.foo, Decl(importDecl_require1.ts, 3, 9))
|
|
|
|
//Emit even when used just in function type
|
|
import fncOnly_m4 = require("importDecl_require2");
|
|
>fncOnly_m4 : Symbol(fncOnly_m4, Decl(importDecl_1.ts, 23, 39))
|
|
|
|
export var useFncOnly_m4_f4 = fncOnly_m4.foo();
|
|
>useFncOnly_m4_f4 : Symbol(useFncOnly_m4_f4, Decl(importDecl_1.ts, 27, 10))
|
|
>fncOnly_m4.foo : Symbol(fncOnly_m4.foo, Decl(importDecl_require2.ts, 3, 16))
|
|
>fncOnly_m4 : Symbol(fncOnly_m4, Decl(importDecl_1.ts, 23, 39))
|
|
>foo : Symbol(fncOnly_m4.foo, Decl(importDecl_require2.ts, 3, 16))
|
|
|
|
// only used privately no need to emit
|
|
import private_m4 = require("importDecl_require3");
|
|
>private_m4 : Symbol(private_m4, Decl(importDecl_1.ts, 27, 47))
|
|
|
|
export module usePrivate_m4_m1 {
|
|
>usePrivate_m4_m1 : Symbol(usePrivate_m4_m1, Decl(importDecl_1.ts, 30, 51))
|
|
|
|
var x3 = private_m4.x;
|
|
>x3 : Symbol(x3, Decl(importDecl_1.ts, 32, 7))
|
|
>private_m4.x : Symbol(private_m4.x, Decl(importDecl_require3.ts, 3, 10))
|
|
>private_m4 : Symbol(private_m4, Decl(importDecl_1.ts, 27, 47))
|
|
>x : Symbol(private_m4.x, Decl(importDecl_require3.ts, 3, 10))
|
|
|
|
var d3 = private_m4.d;
|
|
>d3 : Symbol(d3, Decl(importDecl_1.ts, 33, 7))
|
|
>private_m4.d : Symbol(private_m4.d, Decl(importDecl_require3.ts, 0, 0))
|
|
>private_m4 : Symbol(private_m4, Decl(importDecl_1.ts, 27, 47))
|
|
>d : Symbol(private_m4.d, Decl(importDecl_require3.ts, 0, 0))
|
|
|
|
var f3 = private_m4.foo();
|
|
>f3 : Symbol(f3, Decl(importDecl_1.ts, 34, 7))
|
|
>private_m4.foo : Symbol(private_m4.foo, Decl(importDecl_require3.ts, 3, 16))
|
|
>private_m4 : Symbol(private_m4, Decl(importDecl_1.ts, 27, 47))
|
|
>foo : Symbol(private_m4.foo, Decl(importDecl_require3.ts, 3, 16))
|
|
}
|
|
|
|
// Do not emit unused import
|
|
import m5 = require("importDecl_require4");
|
|
>m5 : Symbol(m5, Decl(importDecl_1.ts, 35, 1))
|
|
|
|
export var d = m5.foo2();
|
|
>d : Symbol(d, Decl(importDecl_1.ts, 39, 10))
|
|
>m5.foo2 : Symbol(m5.foo2, Decl(importDecl_require4.ts, 0, 42))
|
|
>m5 : Symbol(m5, Decl(importDecl_1.ts, 35, 1))
|
|
>foo2 : Symbol(m5.foo2, Decl(importDecl_require4.ts, 0, 42))
|
|
|
|
// Do not emit multiple used import statements
|
|
import multiImport_m4 = require("importDecl_require"); // Emit used
|
|
>multiImport_m4 : Symbol(multiImport_m4, Decl(importDecl_1.ts, 39, 25))
|
|
|
|
export var useMultiImport_m4_x4 = multiImport_m4.x;
|
|
>useMultiImport_m4_x4 : Symbol(useMultiImport_m4_x4, Decl(importDecl_1.ts, 43, 10))
|
|
>multiImport_m4.x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10))
|
|
>multiImport_m4 : Symbol(multiImport_m4, Decl(importDecl_1.ts, 39, 25))
|
|
>x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10))
|
|
|
|
export var useMultiImport_m4_d4 = multiImport_m4.d;
|
|
>useMultiImport_m4_d4 : Symbol(useMultiImport_m4_d4, Decl(importDecl_1.ts, 44, 10))
|
|
>multiImport_m4.d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0))
|
|
>multiImport_m4 : Symbol(multiImport_m4, Decl(importDecl_1.ts, 39, 25))
|
|
>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0))
|
|
|
|
export var useMultiImport_m4_f4 = multiImport_m4.foo();
|
|
>useMultiImport_m4_f4 : Symbol(useMultiImport_m4_f4, Decl(importDecl_1.ts, 45, 10))
|
|
>multiImport_m4.foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16))
|
|
>multiImport_m4 : Symbol(multiImport_m4, Decl(importDecl_1.ts, 39, 25))
|
|
>foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16))
|
|
|
|
=== tests/cases/compiler/importDecl_require.ts ===
|
|
export class d {
|
|
>d : Symbol(d, Decl(importDecl_require.ts, 0, 0))
|
|
|
|
foo: string;
|
|
>foo : Symbol(foo, Decl(importDecl_require.ts, 0, 16))
|
|
}
|
|
export var x: d;
|
|
>x : Symbol(x, Decl(importDecl_require.ts, 3, 10))
|
|
>d : Symbol(d, Decl(importDecl_require.ts, 0, 0))
|
|
|
|
export function foo(): d { return null; }
|
|
>foo : Symbol(foo, Decl(importDecl_require.ts, 3, 16))
|
|
>d : Symbol(d, Decl(importDecl_require.ts, 0, 0))
|
|
|
|
=== tests/cases/compiler/importDecl_require1.ts ===
|
|
export class d {
|
|
>d : Symbol(d, Decl(importDecl_require1.ts, 0, 0))
|
|
|
|
bar: string;
|
|
>bar : Symbol(bar, Decl(importDecl_require1.ts, 0, 16))
|
|
}
|
|
var x: d;
|
|
>x : Symbol(x, Decl(importDecl_require1.ts, 3, 3))
|
|
>d : Symbol(d, Decl(importDecl_require1.ts, 0, 0))
|
|
|
|
export function foo(): d { return null; }
|
|
>foo : Symbol(foo, Decl(importDecl_require1.ts, 3, 9))
|
|
>d : Symbol(d, Decl(importDecl_require1.ts, 0, 0))
|
|
|
|
=== tests/cases/compiler/importDecl_require2.ts ===
|
|
export class d {
|
|
>d : Symbol(d, Decl(importDecl_require2.ts, 0, 0))
|
|
|
|
baz: string;
|
|
>baz : Symbol(baz, Decl(importDecl_require2.ts, 0, 16))
|
|
}
|
|
export var x: d;
|
|
>x : Symbol(x, Decl(importDecl_require2.ts, 3, 10))
|
|
>d : Symbol(d, Decl(importDecl_require2.ts, 0, 0))
|
|
|
|
export function foo(): d { return null; }
|
|
>foo : Symbol(foo, Decl(importDecl_require2.ts, 3, 16))
|
|
>d : Symbol(d, Decl(importDecl_require2.ts, 0, 0))
|
|
|
|
=== tests/cases/compiler/importDecl_require3.ts ===
|
|
export class d {
|
|
>d : Symbol(d, Decl(importDecl_require3.ts, 0, 0))
|
|
|
|
bing: string;
|
|
>bing : Symbol(bing, Decl(importDecl_require3.ts, 0, 16))
|
|
}
|
|
export var x: d;
|
|
>x : Symbol(x, Decl(importDecl_require3.ts, 3, 10))
|
|
>d : Symbol(d, Decl(importDecl_require3.ts, 0, 0))
|
|
|
|
export function foo(): d { return null; }
|
|
>foo : Symbol(foo, Decl(importDecl_require3.ts, 3, 16))
|
|
>d : Symbol(d, Decl(importDecl_require3.ts, 0, 0))
|
|
|
|
=== tests/cases/compiler/importDecl_require4.ts ===
|
|
import m4 = require("importDecl_require");
|
|
>m4 : Symbol(m4, Decl(importDecl_require4.ts, 0, 0))
|
|
|
|
export function foo2(): m4.d { return null; }
|
|
>foo2 : Symbol(foo2, Decl(importDecl_require4.ts, 0, 42))
|
|
>m4 : Symbol(m4, Decl(importDecl_require4.ts, 0, 0))
|
|
>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0))
|
|
|