Add missing visitNode call to object literal members

Object literal elements that are neither spread elements, nor property assignments would not have visitNode called on them. Therefore, the esnext transformer would not be called on them and their children.

Fixes #16765.
This commit is contained in:
Jan Melcher authored and Jan Melcher committed 2017-08-13 15:11:48 +02:00
1 parent d03d1074ee
commit 903d137cea
1 file changed
+3 -3
+3 -3
View File
@@ -158,8 +158,8 @@ namespace ts {
return visitEachChild(node, visitor, context);
}
function chunkObjectLiteralElements(elements: ReadonlyArray<ObjectLiteralElement>): Expression[] {
let chunkObject: (ShorthandPropertyAssignment | PropertyAssignment)[];
function chunkObjectLiteralElements(elements: ReadonlyArray<ObjectLiteralElementLike>): Expression[] {
let chunkObject: ObjectLiteralElementLike[];
const objects: Expression[] = [];
for (const e of elements) {
if (e.kind === SyntaxKind.SpreadAssignment) {
@@ -179,7 +179,7 @@ namespace ts {
chunkObject.push(createPropertyAssignment(p.name, visitNode(p.initializer, visitor, isExpression)));
}
else {
chunkObject.push(e as ShorthandPropertyAssignment);
chunkObject.push(visitNode(e, visitor, isObjectLiteralElementLike));
}
}
}