mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
Generate names of form class_N for anonymous classes
This commit is contained in:
parent
b518dc1e5b
commit
413f278424
@ -264,6 +264,10 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return makeUniqueName("default");
|
||||
}
|
||||
|
||||
function generateNameForClassExpression() {
|
||||
return makeUniqueName("class");
|
||||
}
|
||||
|
||||
function generateNameForNode(node: Node) {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.Identifier:
|
||||
@ -276,9 +280,10 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return generateNameForImportOrExportDeclaration(<ImportDeclaration | ExportDeclaration>node);
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
case SyntaxKind.ClassExpression:
|
||||
case SyntaxKind.ExportAssignment:
|
||||
return generateNameForExportDefault();
|
||||
case SyntaxKind.ClassExpression:
|
||||
return generateNameForClassExpression();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,8 +6,8 @@ function f() {
|
||||
//// [anonymousClassExpression1.js]
|
||||
function f() {
|
||||
return typeof (function () {
|
||||
function default_1() {
|
||||
function class_1() {
|
||||
}
|
||||
return default_1;
|
||||
return class_1;
|
||||
})() === "function";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user