Skip to content

Commit 20a94ec

Browse files
committed
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 microsoft#16765.
1 parent aeb5264 commit 20a94ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/transformers/esnext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ namespace ts {
157157
}
158158

159159
function chunkObjectLiteralElements(elements: ObjectLiteralElement[]): Expression[] {
160-
let chunkObject: (ShorthandPropertyAssignment | PropertyAssignment)[];
160+
let chunkObject: ObjectLiteralElementLike[];
161161
const objects: Expression[] = [];
162162
for (const e of elements) {
163163
if (e.kind === SyntaxKind.SpreadAssignment) {
@@ -177,7 +177,7 @@ namespace ts {
177177
chunkObject.push(createPropertyAssignment(p.name, visitNode(p.initializer, visitor, isExpression)));
178178
}
179179
else {
180-
chunkObject.push(e as ShorthandPropertyAssignment);
180+
chunkObject.push(visitNode(e as ObjectLiteralElementLike, visitor, isObjectLiteralElementLike));
181181
}
182182
}
183183
}

0 commit comments

Comments
 (0)