style(compiler-core): while/expression instead of while/true (#680)
This commit is contained in:
parent
c02e7bc7d6
commit
c088169170
@ -108,21 +108,17 @@ export const transformIf = createStructuralDirectiveTransform(
|
|||||||
// attach this branch's codegen node to the v-if root.
|
// attach this branch's codegen node to the v-if root.
|
||||||
let parentCondition = sibling.codegenNode
|
let parentCondition = sibling.codegenNode
|
||||||
.expressions[1] as ConditionalExpression
|
.expressions[1] as ConditionalExpression
|
||||||
while (true) {
|
while (
|
||||||
if (
|
|
||||||
parentCondition.alternate.type ===
|
parentCondition.alternate.type ===
|
||||||
NodeTypes.JS_CONDITIONAL_EXPRESSION
|
NodeTypes.JS_CONDITIONAL_EXPRESSION
|
||||||
) {
|
) {
|
||||||
parentCondition = parentCondition.alternate
|
parentCondition = parentCondition.alternate
|
||||||
} else {
|
}
|
||||||
parentCondition.alternate = createCodegenNodeForBranch(
|
parentCondition.alternate = createCodegenNodeForBranch(
|
||||||
branch,
|
branch,
|
||||||
sibling.branches.length - 1,
|
sibling.branches.length - 1,
|
||||||
context
|
context
|
||||||
)
|
)
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
context.onError(
|
context.onError(
|
||||||
createCompilerError(ErrorCodes.X_V_ELSE_NO_ADJACENT_IF, node.loc)
|
createCompilerError(ErrorCodes.X_V_ELSE_NO_ADJACENT_IF, node.loc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user