})
})
+ test('should not duplicate object key with same name as value', () => {
+ const node = parseWithExpressionTransform(
+ `{{ { foo: foo } }}`
+ ) as InterpolationNode
+ expect(node.content).toMatchObject({
+ type: NodeTypes.COMPOUND_EXPRESSION,
+ children: [`{ foo: `, { content: `_ctx.foo` }, ` }`]
+ })
+ })
+
test('should prefix a computed object property key', () => {
const node = parseWithExpressionTransform(
`{{ { [foo]: bar } }}`
isStaticProperty(parent) &&
parent.value === node &&
parent.key.type === 'Identifier' &&
- parent.key.name === (node as Identifier).name
+ parent.key.name === (node as Identifier).name &&
+ parent.key.start === node.start
)
}