mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-07-02 14:48:32 -05:00
Don't emit accessors multiple times.
This commit is contained in:
@@ -2545,6 +2545,9 @@ module ts {
|
||||
if (property.kind === SyntaxKind.GetAccessor || property.kind === SyntaxKind.SetAccessor) {
|
||||
// TODO (drosen): Reconcile with 'emitMemberFunctions'.
|
||||
var accessors = getAllAccessorDeclarations(node.properties, <AccessorDeclaration>property);
|
||||
if (property !== accessors.firstAccessor) {
|
||||
continue;
|
||||
}
|
||||
write("Object.defineProperty(");
|
||||
emit(tempVar);
|
||||
write(", ");
|
||||
|
||||
@@ -60,15 +60,7 @@ var x = (_a = {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
}),
|
||||
Object.defineProperty(_a, "foo", {
|
||||
get: function () {
|
||||
if (1 == 1) {
|
||||
return 10;
|
||||
}
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
}),
|
||||
,
|
||||
_a.p2 = 20,
|
||||
_a
|
||||
);
|
||||
|
||||
@@ -56,15 +56,7 @@ var x = (_a = {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
}),
|
||||
Object.defineProperty(_a, "foo", {
|
||||
get: function () {
|
||||
if (1 == 1) {
|
||||
return 10;
|
||||
}
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
}),
|
||||
,
|
||||
_a.p2 = 20,
|
||||
_a
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user