1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
=== tests/cases/conformance/internalModules/codeGeneration/nameCollision.ts ===
module A {
>A : typeof A
// these 2 statements force an underscore before the 'A'
// in the generated function call.
var A = 12;
>A : number
>12 : 12
var _A = '';
>_A : string
>'' : ""
}
module B {
>B : typeof B
var A = 12;
>A : number
>12 : 12
}
module B {
>B : typeof B
// re-opened module with colliding name
// this should add an underscore.
class B {
>B : B
name: string;
>name : string
}
}
module X {
>X : typeof X
var X = 13;
>X : number
>13 : 13
export module Y {
>Y : typeof X.Y
var Y = 13;
>Y : number
>13 : 13
export module Z {
>Z : typeof X.Y.Z
var X = 12;
>X : number
>12 : 12
var Y = 12;
>Y : number
>12 : 12
var Z = 12;
>Z : number
>12 : 12
}
}
}
module Y.Y {
>Y : typeof Y
>Y : typeof Y.Y
export enum Y {
>Y : Y
Red, Blue
>Red : Y.Red
>Blue : Y.Blue
}
}
// no collision, since interface doesn't
// generate code.
module D {
>D : typeof D
export interface D {
id: number;
>id : number
}
export var E = 'hello';
>E : string
>'hello' : "hello"
}
|