TypeScript/tests/baselines/reference/commentsExternalModules.js

173 lines
3.9 KiB
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [tests/cases/compiler/commentsExternalModules.ts] ////
//// [commentsExternalModules_0.ts]
/** Module comment*/
export module m1 {
/** b's comment*/
export var b: number;
/** foo's comment*/
function foo() {
return b;
}
/** m2 comments*/
export module m2 {
/** class comment;*/
export class c {
};
/** i*/
export var i = new c();
}
/** exported function*/
export function fooExport() {
return foo();
}
}
m1.fooExport();
var myvar = new m1.m2.c();
/** Module comment */
export module m4 {
/** b's comment */
export var b: number;
/** foo's comment
*/
function foo() {
return b;
}
/** m2 comments
*/
export module m2 {
/** class comment; */
export class c {
};
/** i */
export var i = new c();
}
/** exported function */
export function fooExport() {
return foo();
}
}
m4.fooExport();
var myvar2 = new m4.m2.c();
//// [commentsExternalModules_1.ts]
/**This is on import declaration*/
import extMod = require("commentsExternalModules_0"); // trailing comment1
2014-07-13 01:04:16 +02:00
extMod.m1.fooExport();
var newVar = new extMod.m1.m2.c();
extMod.m4.fooExport();
var newVar2 = new extMod.m4.m2.c();
//// [commentsExternalModules_0.js]
define(["require", "exports"], function (require, exports) {
2014-08-14 15:53:37 +02:00
/** Module comment*/
var m1;
2014-07-13 01:04:16 +02:00
(function (m1) {
/** b's comment*/
2014-07-13 01:04:16 +02:00
m1.b;
/** foo's comment*/
2014-07-13 01:04:16 +02:00
function foo() {
return m1.b;
}
2014-08-14 15:53:37 +02:00
/** m2 comments*/
var m2;
2014-07-13 01:04:16 +02:00
(function (m2) {
/** class comment;*/
2014-07-13 01:04:16 +02:00
var c = (function () {
function c() {
}
return c;
})();
m2.c = c;
;
/** i*/
2014-07-13 01:04:16 +02:00
m2.i = new c();
})(m2 = m1.m2 || (m1.m2 = {}));
/** exported function*/
2014-07-13 01:04:16 +02:00
function fooExport() {
return foo();
}
m1.fooExport = fooExport;
})(m1 = exports.m1 || (exports.m1 = {}));
2014-07-13 01:04:16 +02:00
m1.fooExport();
var myvar = new m1.m2.c();
2014-08-14 15:53:37 +02:00
/** Module comment */
var m4;
2014-07-13 01:04:16 +02:00
(function (m4) {
/** b's comment */
2014-07-13 01:04:16 +02:00
m4.b;
/** foo's comment
*/
2014-07-13 01:04:16 +02:00
function foo() {
return m4.b;
}
/** m2 comments
*/
var m2;
2014-07-13 01:04:16 +02:00
(function (m2) {
/** class comment; */
2014-07-13 01:04:16 +02:00
var c = (function () {
function c() {
}
return c;
})();
m2.c = c;
;
/** i */
2014-07-13 01:04:16 +02:00
m2.i = new c();
})(m2 = m4.m2 || (m4.m2 = {}));
/** exported function */
2014-07-13 01:04:16 +02:00
function fooExport() {
return foo();
}
m4.fooExport = fooExport;
})(m4 = exports.m4 || (exports.m4 = {}));
2014-07-13 01:04:16 +02:00
m4.fooExport();
var myvar2 = new m4.m2.c();
});
//// [commentsExternalModules_1.js]
define(["require", "exports", "commentsExternalModules_0"], function (require, exports, extMod) {
extMod.m1.fooExport();
var newVar = new extMod.m1.m2.c();
extMod.m4.fooExport();
var newVar2 = new extMod.m4.m2.c();
});
//// [commentsExternalModules_0.d.ts]
/** Module comment*/
2014-07-13 01:04:16 +02:00
export declare module m1 {
/** b's comment*/
2014-07-12 01:36:06 +02:00
var b: number;
/** m2 comments*/
2014-07-13 01:04:16 +02:00
module m2 {
/** class comment;*/
2014-07-13 01:04:16 +02:00
class c {
}
/** i*/
2014-07-12 01:36:06 +02:00
var i: c;
2014-07-13 01:04:16 +02:00
}
/** exported function*/
2014-07-12 01:36:06 +02:00
function fooExport(): number;
2014-07-13 01:04:16 +02:00
}
/** Module comment */
2014-07-13 01:04:16 +02:00
export declare module m4 {
/** b's comment */
2014-07-12 01:36:06 +02:00
var b: number;
/** m2 comments
*/
2014-07-13 01:04:16 +02:00
module m2 {
/** class comment; */
2014-07-13 01:04:16 +02:00
class c {
}
/** i */
2014-07-12 01:36:06 +02:00
var i: c;
2014-07-13 01:04:16 +02:00
}
/** exported function */
2014-07-12 01:36:06 +02:00
function fooExport(): number;
2014-07-13 01:04:16 +02:00
}
//// [commentsExternalModules_1.d.ts]