2014-07-13 01:04:16 +02:00
|
|
|
//// [moduleVisibilityTest1.ts]
|
|
|
|
|
|
|
|
|
|
|
|
module OuterMod {
|
|
|
|
export function someExportedOuterFunc() { return -1; }
|
|
|
|
|
|
|
|
export module OuterInnerMod {
|
|
|
|
export function someExportedOuterInnerFunc() { return "foo"; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
import OuterInnerAlias = OuterMod.OuterInnerMod;
|
|
|
|
|
|
|
|
module M {
|
|
|
|
|
|
|
|
export module InnerMod {
|
|
|
|
export function someExportedInnerFunc() { return -2; }
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum E {
|
|
|
|
A,
|
|
|
|
B,
|
|
|
|
C,
|
|
|
|
}
|
|
|
|
|
|
|
|
export var x = 5;
|
|
|
|
export declare var exported_var;
|
|
|
|
|
|
|
|
var y = x + x;
|
|
|
|
|
|
|
|
|
|
|
|
export interface I {
|
|
|
|
someMethod():number;
|
|
|
|
}
|
|
|
|
|
|
|
|
class B {public b = 0;}
|
|
|
|
|
|
|
|
export class C implements I {
|
|
|
|
public someMethodThatCallsAnOuterMethod() {return OuterInnerAlias.someExportedOuterInnerFunc();}
|
|
|
|
public someMethodThatCallsAnInnerMethod() {return InnerMod.someExportedInnerFunc();}
|
|
|
|
public someMethodThatCallsAnOuterInnerMethod() {return OuterMod.someExportedOuterFunc();}
|
|
|
|
public someMethod() { return 0; }
|
|
|
|
public someProp = 1;
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
function someInnerFunc() { return 2; }
|
|
|
|
var someInnerVar = 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var someModuleVar = 4;
|
|
|
|
|
|
|
|
function someModuleFunction() { return 5;}
|
|
|
|
}
|
|
|
|
|
|
|
|
module M {
|
|
|
|
export var c = x;
|
|
|
|
export var meb = M.E.B;
|
|
|
|
}
|
|
|
|
|
|
|
|
var cprime : M.I = <M.I>null;
|
|
|
|
|
|
|
|
var c = new M.C();
|
|
|
|
var z = M.x;
|
|
|
|
var alpha = M.E.A;
|
|
|
|
var omega = M.exported_var;
|
|
|
|
c.someMethodThatCallsAnOuterMethod();
|
|
|
|
|
|
|
|
|
|
|
|
//// [moduleVisibilityTest1.js]
|
|
|
|
var OuterMod;
|
|
|
|
(function (OuterMod) {
|
2015-02-07 05:03:24 +01:00
|
|
|
function someExportedOuterFunc() { return -1; }
|
2014-07-13 01:04:16 +02:00
|
|
|
OuterMod.someExportedOuterFunc = someExportedOuterFunc;
|
2014-09-07 02:40:19 +02:00
|
|
|
var OuterInnerMod;
|
2014-07-13 01:04:16 +02:00
|
|
|
(function (OuterInnerMod) {
|
2015-02-07 05:03:24 +01:00
|
|
|
function someExportedOuterInnerFunc() { return "foo"; }
|
2014-07-13 01:04:16 +02:00
|
|
|
OuterInnerMod.someExportedOuterInnerFunc = someExportedOuterInnerFunc;
|
2014-09-07 02:40:19 +02:00
|
|
|
})(OuterInnerMod = OuterMod.OuterInnerMod || (OuterMod.OuterInnerMod = {}));
|
2014-07-13 01:04:16 +02:00
|
|
|
})(OuterMod || (OuterMod = {}));
|
|
|
|
var OuterInnerAlias = OuterMod.OuterInnerMod;
|
|
|
|
var M;
|
|
|
|
(function (M) {
|
2014-09-07 02:40:19 +02:00
|
|
|
var InnerMod;
|
2014-07-13 01:04:16 +02:00
|
|
|
(function (InnerMod) {
|
2015-02-07 05:03:24 +01:00
|
|
|
function someExportedInnerFunc() { return -2; }
|
2014-07-13 01:04:16 +02:00
|
|
|
InnerMod.someExportedInnerFunc = someExportedInnerFunc;
|
2014-09-07 02:40:19 +02:00
|
|
|
})(InnerMod = M.InnerMod || (M.InnerMod = {}));
|
2014-07-13 01:04:16 +02:00
|
|
|
(function (E) {
|
|
|
|
E[E["A"] = 0] = "A";
|
|
|
|
E[E["B"] = 1] = "B";
|
|
|
|
E[E["C"] = 2] = "C";
|
|
|
|
})(M.E || (M.E = {}));
|
|
|
|
var E = M.E;
|
|
|
|
M.x = 5;
|
|
|
|
var y = M.x + M.x;
|
|
|
|
var B = (function () {
|
|
|
|
function B() {
|
|
|
|
this.b = 0;
|
|
|
|
}
|
|
|
|
return B;
|
|
|
|
})();
|
|
|
|
var C = (function () {
|
|
|
|
function C() {
|
|
|
|
this.someProp = 1;
|
2015-02-07 05:03:24 +01:00
|
|
|
function someInnerFunc() { return 2; }
|
2014-07-13 01:04:16 +02:00
|
|
|
var someInnerVar = 3;
|
|
|
|
}
|
2015-02-07 05:03:24 +01:00
|
|
|
C.prototype.someMethodThatCallsAnOuterMethod = function () { return OuterInnerAlias.someExportedOuterInnerFunc(); };
|
|
|
|
C.prototype.someMethodThatCallsAnInnerMethod = function () { return InnerMod.someExportedInnerFunc(); };
|
|
|
|
C.prototype.someMethodThatCallsAnOuterInnerMethod = function () { return OuterMod.someExportedOuterFunc(); };
|
|
|
|
C.prototype.someMethod = function () { return 0; };
|
2014-07-13 01:04:16 +02:00
|
|
|
return C;
|
|
|
|
})();
|
|
|
|
M.C = C;
|
|
|
|
var someModuleVar = 4;
|
2015-02-07 05:03:24 +01:00
|
|
|
function someModuleFunction() { return 5; }
|
2014-07-13 01:04:16 +02:00
|
|
|
})(M || (M = {}));
|
|
|
|
var M;
|
|
|
|
(function (M) {
|
|
|
|
M.c = M.x;
|
|
|
|
M.meb = 1 /* B */;
|
|
|
|
})(M || (M = {}));
|
|
|
|
var cprime = null;
|
|
|
|
var c = new M.C();
|
|
|
|
var z = M.x;
|
|
|
|
var alpha = 0 /* A */;
|
|
|
|
var omega = M.exported_var;
|
|
|
|
c.someMethodThatCallsAnOuterMethod();
|