TypeScript/tests/baselines/reference/exportCodeGen.types

120 lines
3.1 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/internalModules/codeGeneration/exportCodeGen.ts ===
// should replace all refs to 'x' in the body,
// with fully qualified
module A {
2015-04-13 23:01:57 +02:00
>A : typeof A, Symbol(A, Decl(exportCodeGen.ts, 0, 0))
2014-08-15 23:33:16 +02:00
export var x = 12;
2015-04-13 23:01:57 +02:00
>x : number, Symbol(x, Decl(exportCodeGen.ts, 4, 14))
2015-04-13 21:36:11 +02:00
>12 : number
2014-08-15 23:33:16 +02:00
function lt12() {
2015-04-13 23:01:57 +02:00
>lt12 : () => boolean, Symbol(lt12, Decl(exportCodeGen.ts, 4, 22))
2014-08-15 23:33:16 +02:00
return x < 12;
>x < 12 : boolean
2015-04-13 23:01:57 +02:00
>x : number, Symbol(x, Decl(exportCodeGen.ts, 4, 14))
2015-04-13 21:36:11 +02:00
>12 : number
2014-08-15 23:33:16 +02:00
}
}
// should not fully qualify 'x'
module B {
2015-04-13 23:01:57 +02:00
>B : typeof B, Symbol(B, Decl(exportCodeGen.ts, 8, 1))
2014-08-15 23:33:16 +02:00
var x = 12;
2015-04-13 23:01:57 +02:00
>x : number, Symbol(x, Decl(exportCodeGen.ts, 12, 7))
2015-04-13 21:36:11 +02:00
>12 : number
2014-08-15 23:33:16 +02:00
function lt12() {
2015-04-13 23:01:57 +02:00
>lt12 : () => boolean, Symbol(lt12, Decl(exportCodeGen.ts, 12, 15))
2014-08-15 23:33:16 +02:00
return x < 12;
>x < 12 : boolean
2015-04-13 23:01:57 +02:00
>x : number, Symbol(x, Decl(exportCodeGen.ts, 12, 7))
2015-04-13 21:36:11 +02:00
>12 : number
2014-08-15 23:33:16 +02:00
}
}
// not copied, since not exported
module C {
2015-04-13 23:01:57 +02:00
>C : typeof C, Symbol(C, Decl(exportCodeGen.ts, 16, 1))
2014-08-15 23:33:16 +02:00
function no() {
2015-04-13 23:01:57 +02:00
>no : () => boolean, Symbol(no, Decl(exportCodeGen.ts, 19, 10))
2014-08-15 23:33:16 +02:00
return false;
2015-04-13 21:36:11 +02:00
>false : boolean
2014-08-15 23:33:16 +02:00
}
}
// copies, since exported
module D {
2015-04-13 23:01:57 +02:00
>D : typeof D, Symbol(D, Decl(exportCodeGen.ts, 23, 1))
2014-08-15 23:33:16 +02:00
export function yes() {
2015-04-13 23:01:57 +02:00
>yes : () => boolean, Symbol(yes, Decl(exportCodeGen.ts, 26, 10))
2014-08-15 23:33:16 +02:00
return true;
2015-04-13 21:36:11 +02:00
>true : boolean
2014-08-15 23:33:16 +02:00
}
}
// validate all exportable statements
module E {
2015-04-13 23:01:57 +02:00
>E : typeof E, Symbol(E, Decl(exportCodeGen.ts, 30, 1))
2014-08-15 23:33:16 +02:00
export enum Color { Red }
2015-04-13 23:01:57 +02:00
>Color : Color, Symbol(Color, Decl(exportCodeGen.ts, 33, 10))
>Red : Color, Symbol(Color.Red, Decl(exportCodeGen.ts, 34, 23))
2014-08-15 23:33:16 +02:00
export function fn() { }
2015-04-13 23:01:57 +02:00
>fn : () => void, Symbol(fn, Decl(exportCodeGen.ts, 34, 29))
2014-08-15 23:33:16 +02:00
export interface I { id: number }
2015-04-13 23:01:57 +02:00
>I : I, Symbol(I, Decl(exportCodeGen.ts, 35, 28))
>id : number, Symbol(id, Decl(exportCodeGen.ts, 36, 24))
2014-08-15 23:33:16 +02:00
export class C { name: string }
2015-04-13 23:01:57 +02:00
>C : C, Symbol(C, Decl(exportCodeGen.ts, 36, 37))
>name : string, Symbol(name, Decl(exportCodeGen.ts, 37, 20))
2014-08-15 23:33:16 +02:00
export module M {
2015-04-13 23:01:57 +02:00
>M : typeof M, Symbol(M, Decl(exportCodeGen.ts, 37, 35))
2014-08-15 23:33:16 +02:00
export var x = 42;
2015-04-13 23:01:57 +02:00
>x : number, Symbol(x, Decl(exportCodeGen.ts, 39, 18))
2015-04-13 21:36:11 +02:00
>42 : number
2014-08-15 23:33:16 +02:00
}
}
// validate all exportable statements,
// which are not exported
module F {
2015-04-13 23:01:57 +02:00
>F : typeof F, Symbol(F, Decl(exportCodeGen.ts, 41, 1))
2014-08-15 23:33:16 +02:00
enum Color { Red }
2015-04-13 23:01:57 +02:00
>Color : Color, Symbol(Color, Decl(exportCodeGen.ts, 45, 10))
>Red : Color, Symbol(Color.Red, Decl(exportCodeGen.ts, 46, 16))
2014-08-15 23:33:16 +02:00
function fn() { }
2015-04-13 23:01:57 +02:00
>fn : () => void, Symbol(fn, Decl(exportCodeGen.ts, 46, 22))
2014-08-15 23:33:16 +02:00
interface I { id: number }
2015-04-13 23:01:57 +02:00
>I : I, Symbol(I, Decl(exportCodeGen.ts, 47, 21))
>id : number, Symbol(id, Decl(exportCodeGen.ts, 48, 17))
2014-08-15 23:33:16 +02:00
class C { name: string }
2015-04-13 23:01:57 +02:00
>C : C, Symbol(C, Decl(exportCodeGen.ts, 48, 30))
>name : string, Symbol(name, Decl(exportCodeGen.ts, 49, 13))
2014-08-15 23:33:16 +02:00
module M {
2015-04-13 23:01:57 +02:00
>M : typeof M, Symbol(M, Decl(exportCodeGen.ts, 49, 28))
2014-08-15 23:33:16 +02:00
var x = 42;
2015-04-13 23:01:57 +02:00
>x : number, Symbol(x, Decl(exportCodeGen.ts, 51, 11))
2015-04-13 21:36:11 +02:00
>42 : number
2014-08-15 23:33:16 +02:00
}
}