Don't emit accessors multiple times.
This commit is contained in:
parent
ce85b14589
commit
0fd783f3ef
3 changed files with 5 additions and 18 deletions
|
@ -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
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue