35 lines
798 B
JavaScript
35 lines
798 B
JavaScript
//// [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) {
|
|
// error: duplicate identifier expected
|
|
function fn(x, y) {
|
|
return clodule.sfn('a');
|
|
}
|
|
clodule.fn = fn;
|
|
})(clodule || (clodule = {}));
|