Skip to content

Commit 903d137

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 d03d107 commit 903d137

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/compiler/transformers/esnext.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ namespace ts {
158158
return visitEachChild(node, visitor, context);
159159
}
160160

161-
function chunkObjectLiteralElements(elements: ReadonlyArray<ObjectLiteralElement>): Expression[] {
162-
let chunkObject: (ShorthandPropertyAssignment | PropertyAssignment)[];
161+
function chunkObjectLiteralElements(elements: ReadonlyArray<ObjectLiteralElementLike>): Expression[] {
162+
let chunkObject: ObjectLiteralElementLike[];
163163
const objects: Expression[] = [];
164164
for (const e of elements) {
165165
if (e.kind === SyntaxKind.SpreadAssignment) {
@@ -179,7 +179,7 @@ namespace ts {
179179
chunkObject.push(createPropertyAssignment(p.name, visitNode(p.initializer, visitor, isExpression)));
180180
}
181181
else {
182-
chunkObject.push(e as ShorthandPropertyAssignment);
182+
chunkObject.push(visitNode(e, visitor, isObjectLiteralElementLike));
183183
}
184184
}
185185
}

0 commit comments

Comments
 (0)