From 66b5f0b4804918acf9e09d78ff7be8162ce26175 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 14 Feb 2020 16:41:55 -0500 Subject: [PATCH] chore: fix hoistStatic exhaustive check --- packages/compiler-core/src/codegen.ts | 3 +++ packages/compiler-core/src/transforms/hoistStatic.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/compiler-core/src/codegen.ts b/packages/compiler-core/src/codegen.ts index 856be6b9..4d0b7298 100644 --- a/packages/compiler-core/src/codegen.ts +++ b/packages/compiler-core/src/codegen.ts @@ -597,6 +597,9 @@ function genNode(node: CodegenNode | symbol | string, context: CodegenContext) { break /* istanbul ignore next */ + case NodeTypes.IF_BRANCH: + // noop + break default: if (__DEV__) { assert(false, `unhandled codegen node type: ${(node as any).type}`) diff --git a/packages/compiler-core/src/transforms/hoistStatic.ts b/packages/compiler-core/src/transforms/hoistStatic.ts index 968fc591..a2569164 100644 --- a/packages/compiler-core/src/transforms/hoistStatic.ts +++ b/packages/compiler-core/src/transforms/hoistStatic.ts @@ -143,6 +143,7 @@ export function isStaticNode( return true case NodeTypes.IF: case NodeTypes.FOR: + case NodeTypes.IF_BRANCH: return false case NodeTypes.INTERPOLATION: case NodeTypes.TEXT_CALL: