mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
Merge pull request #11397 from Microsoft/release-2.0.5_fix11384
[Release-2.0.5] Do not emit wrong extra comma
This commit is contained in:
commit
be85524319
@ -1968,17 +1968,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
emitObjectLiteralBody(node, firstComputedPropertyIndex);
|
||||
|
||||
for (let i = firstComputedPropertyIndex, n = properties.length; i < n; i++) {
|
||||
writeComma();
|
||||
|
||||
const property = properties[i];
|
||||
|
||||
emitStart(property);
|
||||
if (property.kind === SyntaxKind.GetAccessor || property.kind === SyntaxKind.SetAccessor) {
|
||||
// TODO (drosen): Reconcile with 'emitMemberFunctions'.
|
||||
const accessors = getAllAccessorDeclarations(node.properties, <AccessorDeclaration>property);
|
||||
if (property !== accessors.firstAccessor) {
|
||||
continue;
|
||||
}
|
||||
writeComma();
|
||||
emitStart(property);
|
||||
write("Object.defineProperty(");
|
||||
emit(tempVar);
|
||||
write(", ");
|
||||
@ -2019,6 +2018,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
emitEnd(property);
|
||||
}
|
||||
else {
|
||||
writeComma();
|
||||
emitStart(property);
|
||||
emitLeadingComments(property);
|
||||
emitStart(property.name);
|
||||
emit(tempVar);
|
||||
@ -2039,9 +2040,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
else {
|
||||
Debug.fail("ObjectLiteralElement type not accounted for: " + property.kind);
|
||||
}
|
||||
emitEnd(property);
|
||||
}
|
||||
|
||||
emitEnd(property);
|
||||
}
|
||||
|
||||
writeComma();
|
||||
|
||||
@ -60,7 +60,6 @@ var x = (_a = {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
}),
|
||||
,
|
||||
_a.p2 = 20,
|
||||
_a
|
||||
);
|
||||
|
||||
@ -56,7 +56,6 @@ var x = (_a = {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
}),
|
||||
,
|
||||
_a.p2 = 20,
|
||||
_a
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user