diff --git a/packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts b/packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts index 2466fffe8..4db7aa619 100644 --- a/packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts +++ b/packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts @@ -402,6 +402,33 @@ describe('compiler: expression transform', () => { ) }) + 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(