Export classes defined wihtin internal modules correctelly
This commit is contained in:
parent
99108694d5
commit
3d802438f1
|
@ -4929,6 +4929,18 @@ module ts {
|
||||||
// a lexical declaration such as a LexicalDeclaration or a ClassDeclaration.
|
// a lexical declaration such as a LexicalDeclaration or a ClassDeclaration.
|
||||||
writeLine();
|
writeLine();
|
||||||
emitMemberAssignments(node, NodeFlags.Static);
|
emitMemberAssignments(node, NodeFlags.Static);
|
||||||
|
|
||||||
|
// If this is an exported classes, but not on the top level (i.e. on an internal
|
||||||
|
// module), export it
|
||||||
|
if (!isES6ModuleMemberDeclaration(node) && (node.flags & NodeFlags.Export)) {
|
||||||
|
writeLine();
|
||||||
|
emitStart(node);
|
||||||
|
emitModuleMemberName(node);
|
||||||
|
write(" = ");
|
||||||
|
emitDeclarationName(node);
|
||||||
|
emitEnd(node);
|
||||||
|
write(";");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function emitClassDeclarationBelowES6(node: ClassDeclaration) {
|
function emitClassDeclarationBelowES6(node: ClassDeclaration) {
|
||||||
|
@ -4972,11 +4984,7 @@ module ts {
|
||||||
write(");");
|
write(");");
|
||||||
emitEnd(node);
|
emitEnd(node);
|
||||||
|
|
||||||
if (isES6ModuleMemberDeclaration(node)) {
|
if (node.flags & NodeFlags.Export && !(node.flags & NodeFlags.Default)) {
|
||||||
// TODO update this to emit "export class " when ES67 class emit is available
|
|
||||||
emitES6NamedExportForDeclaration(node);
|
|
||||||
}
|
|
||||||
else if (node.flags & NodeFlags.Export && !(node.flags & NodeFlags.Default)) {
|
|
||||||
writeLine();
|
writeLine();
|
||||||
emitStart(node);
|
emitStart(node);
|
||||||
emitModuleMemberName(node);
|
emitModuleMemberName(node);
|
||||||
|
|
|
@ -165,6 +165,7 @@ var m1;
|
||||||
}
|
}
|
||||||
c3.k = 20;
|
c3.k = 20;
|
||||||
c3.l = 30;
|
c3.l = 30;
|
||||||
|
m1.c3 = c3;
|
||||||
class c4 {
|
class c4 {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.x = 10;
|
this.x = 10;
|
||||||
|
@ -205,6 +206,7 @@ var m2;
|
||||||
}
|
}
|
||||||
c3.k = 20;
|
c3.k = 20;
|
||||||
c3.l = 30;
|
c3.l = 30;
|
||||||
|
m2.c3 = c3;
|
||||||
class c4 {
|
class c4 {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.x = 10;
|
this.x = 10;
|
||||||
|
|
|
@ -27,4 +27,5 @@ var M;
|
||||||
set [Symbol.isRegExp](x) {
|
set [Symbol.isRegExp](x) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
M.C = C;
|
||||||
})(M || (M = {}));
|
})(M || (M = {}));
|
||||||
|
|
Loading…
Reference in a new issue