From c08816917007c2da0962287baee8cfe54928a819 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gabriel=20Loi=C3=A1cono?= <32134586+loiacon@users.noreply.github.com> Date: Fri, 31 Jan 2020 11:43:34 -0300 Subject: [PATCH] style(compiler-core): while/expression instead of while/true (#680) --- packages/compiler-core/src/transforms/vIf.ts | 24 ++++++++------------ 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/packages/compiler-core/src/transforms/vIf.ts b/packages/compiler-core/src/transforms/vIf.ts index 6389d8ea9a..3dcc345e4f 100644 --- a/packages/compiler-core/src/transforms/vIf.ts +++ b/packages/compiler-core/src/transforms/vIf.ts @@ -108,21 +108,17 @@ export const transformIf = createStructuralDirectiveTransform( // attach this branch's codegen node to the v-if root. let parentCondition = sibling.codegenNode .expressions[1] as ConditionalExpression - while (true) { - if ( - parentCondition.alternate.type === - NodeTypes.JS_CONDITIONAL_EXPRESSION - ) { - parentCondition = parentCondition.alternate - } else { - parentCondition.alternate = createCodegenNodeForBranch( - branch, - sibling.branches.length - 1, - context - ) - break - } + while ( + parentCondition.alternate.type === + NodeTypes.JS_CONDITIONAL_EXPRESSION + ) { + parentCondition = parentCondition.alternate } + parentCondition.alternate = createCodegenNodeForBranch( + branch, + sibling.branches.length - 1, + context + ) } else { context.onError( createCompilerError(ErrorCodes.X_V_ELSE_NO_ADJACENT_IF, node.loc) -- 2.47.3