mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Do not emit "export" for classes within modules, and do not write the name of an export default class
This commit is contained in:
@@ -4894,7 +4894,7 @@ module ts {
|
||||
}
|
||||
|
||||
function emitClassDeclarationForES6AndHigher(node: ClassDeclaration) {
|
||||
if (node.flags & NodeFlags.Export) {
|
||||
if (isES6ModuleMemberDeclaration(node)) {
|
||||
write("export ");
|
||||
|
||||
if (node.flags & NodeFlags.Default) {
|
||||
@@ -4903,7 +4903,9 @@ module ts {
|
||||
}
|
||||
|
||||
write("class ");
|
||||
emitDeclarationName(node);
|
||||
if (node.name || !(node.flags & NodeFlags.Default)) {
|
||||
emitDeclarationName(node);
|
||||
}
|
||||
var baseTypeNode = getClassBaseTypeNode(node);
|
||||
if (baseTypeNode) {
|
||||
write(" extends ");
|
||||
|
||||
@@ -6,7 +6,7 @@ export default class {
|
||||
|
||||
|
||||
//// [es6ExportDefaultClassDeclaration2.js]
|
||||
export default class _default {
|
||||
export default class {
|
||||
method() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ new c();
|
||||
new c2();
|
||||
var m1;
|
||||
(function (m1) {
|
||||
export class c3 {
|
||||
class c3 {
|
||||
constructor() {
|
||||
this.x = 10;
|
||||
this.y = 30;
|
||||
@@ -189,7 +189,7 @@ var m1;
|
||||
export { m1 };
|
||||
var m2;
|
||||
(function (m2) {
|
||||
export class c3 {
|
||||
class c3 {
|
||||
constructor() {
|
||||
this.x = 10;
|
||||
this.y = 30;
|
||||
|
||||
@@ -15,7 +15,7 @@ module M {
|
||||
//// [symbolDeclarationEmit12.js]
|
||||
var M;
|
||||
(function (M) {
|
||||
export class C {
|
||||
class C {
|
||||
[Symbol.toPrimitive](x) {
|
||||
}
|
||||
[Symbol.isConcatSpreadable]() {
|
||||
|
||||
Reference in New Issue
Block a user