mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Removed Object.defineProperty for function name
This commit is contained in:
@@ -3898,6 +3898,8 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
emitToken(SyntaxKind.CloseBraceToken, node.members.end);
|
||||
scopeEmitEnd();
|
||||
|
||||
// TODO(rbuckton): Need to go back to `let _a = class C {}` approach, removing the defineProperty call for now.
|
||||
|
||||
// For a decorated class, we need to assign its name (if it has one). This is because we emit
|
||||
// the class as a class expression to avoid the double-binding of the identifier:
|
||||
//
|
||||
@@ -3907,15 +3909,6 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
//
|
||||
if (thisNodeIsDecorated) {
|
||||
write(";");
|
||||
if (node.name) {
|
||||
writeLine();
|
||||
write("Object.defineProperty(");
|
||||
emitDeclarationName(node);
|
||||
write(", \"name\", { value: \"");
|
||||
emitDeclarationName(node);
|
||||
write("\", configurable: true });");
|
||||
writeLine();
|
||||
}
|
||||
}
|
||||
|
||||
// Emit static property assignment. Because classDeclaration is lexically evaluated,
|
||||
|
||||
Reference in New Issue
Block a user