diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 0489fd70313..edd6be126d5 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -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, property); + if (property !== accessors.firstAccessor) { + continue; + } write("Object.defineProperty("); emit(tempVar); write(", "); diff --git a/tests/baselines/reference/computedPropertyNames49_ES5.js b/tests/baselines/reference/computedPropertyNames49_ES5.js index 542017d42c1..3427ea665a0 100644 --- a/tests/baselines/reference/computedPropertyNames49_ES5.js +++ b/tests/baselines/reference/computedPropertyNames49_ES5.js @@ -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 ); diff --git a/tests/baselines/reference/computedPropertyNames50_ES5.js b/tests/baselines/reference/computedPropertyNames50_ES5.js index 1d73938553e..a74561295be 100644 --- a/tests/baselines/reference/computedPropertyNames50_ES5.js +++ b/tests/baselines/reference/computedPropertyNames50_ES5.js @@ -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 );