Emit export class declaration in es6 format.

Note since we havent yet changed the emitting of class declaration to es6 format,
we are just exporting the constructor function

Conflicts:
	src/compiler/emitter.ts
This commit is contained in:
Mohamed Hegazy
2015-03-12 10:27:46 -07:00
parent b091fa57ef
commit 6bcbe824aa
9 changed files with 594 additions and 119 deletions
+7 -1
View File
@@ -4748,7 +4748,12 @@ module ts {
}
write(");");
emitEnd(node);
if (node.flags & NodeFlags.Export && !(node.flags & NodeFlags.Default)) {
if (isES6ModuleMemberDeclaration(node)) {
// 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();
emitStart(node);
emitModuleMemberName(node);
@@ -4757,6 +4762,7 @@ module ts {
emitEnd(node);
write(";");
}
if (languageVersion < ScriptTarget.ES6 && node.parent === currentSourceFile && node.name) {
emitExportMemberAssignments(node.name);
}