From 484e8edc695505042b0586509dd0637476cdcda5 Mon Sep 17 00:00:00 2001 From: daiwei Date: Sun, 8 Dec 2024 15:35:33 +0800 Subject: [PATCH] chore: add semi when necessary --- packages/compiler-vapor/src/generators/operation.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/compiler-vapor/src/generators/operation.ts b/packages/compiler-vapor/src/generators/operation.ts index f03005039..8dc196e59 100644 --- a/packages/compiler-vapor/src/generators/operation.ts +++ b/packages/compiler-vapor/src/generators/operation.ts @@ -85,8 +85,10 @@ export function genEffects( for (let i = 0; i < effects.length; i++) { const effect = (context.processingRenderEffect = effects[i]) operationsCount += effect.operations.length + const frags = genEffect(effect, context, declareNames) + const needSemi = frag[frag.length - 1] === ')' && frags[0] === '(' i > 0 && push(NEWLINE) - push(...genEffect(effect, context, declareNames)) + push(needSemi ? ';' : undefined, ...frags) } const newLineCount = frag.filter(frag => frag === NEWLINE).length