Update emitter.ts

Proposed fix for #4908

Can anybody confirm if I'm on a right track?
This commit is contained in:
MartyIX 2015-09-27 22:51:49 +02:00 committed by Martin Vseticka
parent d9559d58ca
commit 08a494ecbf
2 changed files with 5 additions and 3 deletions

View File

@ -4529,8 +4529,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
write("class");
// check if this is an "export default class" as it may not have a name. Do not emit the name if the class is decorated.
if ((node.name || !(node.flags & NodeFlags.Default)) && !thisNodeIsDecorated) {
// 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) {
write(" ");
emitDeclarationName(node);
}

View File

@ -7,7 +7,7 @@ c.c;
//// [classExpressionES63.js]
let C = class class_1 extends class class_2 extends class class_3 {
let C = class extends class extends class {
constructor() {
this.a = 1;
}