)
})
+ test('should prefix in assignment', () => {
+ const node = parseWithExpressionTransform(
+ `{{ x = 1 }}`
+ ) as InterpolationNode
+ expect(node.content).toMatchObject({
+ type: NodeTypes.COMPOUND_EXPRESSION,
+ children: [{ content: `_ctx.x` }, ` = 1`]
+ })
+ })
+
+ test('should prefix in assignment pattern', () => {
+ const node = parseWithExpressionTransform(
+ `{{ { x, y: [z] } = obj }}`
+ ) as InterpolationNode
+ expect(node.content).toMatchObject({
+ type: NodeTypes.COMPOUND_EXPRESSION,
+ children: [
+ `{ x: `,
+ { content: `_ctx.x` },
+ `, y: [`,
+ { content: `_ctx.z` },
+ `] } = `,
+ { content: `_ctx.obj` }
+ ]
+ })
+ })
+
describe('ES Proposals support', () => {
test('bigInt', () => {
const node = parseWithExpressionTransform(