Fix emit for ES6 export default class with static initializers. Fixes #5136.

This commit is contained in:
Ron Buckton
2015-10-06 12:02:55 -07:00
parent e7c2003164
commit 64b6c9f52e
5 changed files with 28 additions and 2 deletions

View File

@@ -4785,8 +4785,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
// emit name if
// - node has a name
// - this is default export and target is not ES6 (for ES6 `export default` does not need to be compiled downlevel)
if ((node.name || (node.flags & NodeFlags.Default && languageVersion < ScriptTarget.ES6)) && !thisNodeIsDecorated) {
// - this is default export and target is not ES6 (for ES6 `export default` does not need to be compiled downlevel)
// - this is default export with static initializers
if ((node.name || (node.flags & NodeFlags.Default && (languageVersion < ScriptTarget.ES6
|| staticProperties.length > 0))) && !thisNodeIsDecorated) {
write(" ");
emitDeclarationName(node);
}