mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Merge pull request #5137 from Microsoft/fixExportDefaultClassStatics
Fix emit for ES6 export default class with static initializers.
This commit is contained in:
@@ -4785,8 +4785,8 @@ 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 with static initializers
|
||||
if ((node.name || (node.flags & NodeFlags.Default && staticProperties.length > 0)) && !thisNodeIsDecorated) {
|
||||
write(" ");
|
||||
emitDeclarationName(node);
|
||||
}
|
||||
@@ -5645,8 +5645,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
}
|
||||
|
||||
/*
|
||||
* Some bundlers (SystemJS builder) sometimes want to rename dependencies.
|
||||
* Here we check if alternative name was provided for a given moduleName and return it if possible.
|
||||
* Some bundlers (SystemJS builder) sometimes want to rename dependencies.
|
||||
* Here we check if alternative name was provided for a given moduleName and return it if possible.
|
||||
*/
|
||||
function tryRenameExternalModule(moduleName: LiteralExpression): string {
|
||||
if (currentSourceFile.renamedDependencies && hasProperty(currentSourceFile.renamedDependencies, moduleName.text)) {
|
||||
@@ -7074,7 +7074,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
return shouldEmitEnumDeclaration(<EnumDeclaration>node);
|
||||
}
|
||||
|
||||
// If the node is emitted in specialized fashion, dont emit comments as this node will handle
|
||||
// If the node is emitted in specialized fashion, dont emit comments as this node will handle
|
||||
// emitting comments when emitting itself
|
||||
Debug.assert(!isSpecializedCommentHandling(node));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user