TypeScript/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js

34 lines
753 B
JavaScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts]
class clodule<T> {
id: string;
value: T;
private static sfn(id: string) { return 42; }
}
module clodule {
// error: duplicate identifier expected
export function fn<T>(x: T, y: T): number {
return clodule.sfn('a');
}
}
//// [ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js]
var clodule = (function () {
function clodule() {
}
clodule.sfn = function (id) {
return 42;
};
return clodule;
})();
var clodule;
(function (clodule) {
function fn(x, y) {
return clodule.sfn('a');
}
clodule.fn = fn;
})(clodule || (clodule = {}));