From 292a657861e5799ec14dab1b6e4d5def003f49d0 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 12 Nov 2020 22:44:18 -0500 Subject: [PATCH] wip: fix runtimeConstant marking --- .../src/transforms/transformExpression.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/compiler-core/src/transforms/transformExpression.ts b/packages/compiler-core/src/transforms/transformExpression.ts index 276c8cb1..f72bd16b 100644 --- a/packages/compiler-core/src/transforms/transformExpression.ts +++ b/packages/compiler-core/src/transforms/transformExpression.ts @@ -100,13 +100,6 @@ export function processExpression( } const { inline, bindingMetadata } = context - - // const bindings exposed from setup - we know they never change - if (bindingMetadata[node.content] === BindingTypes.CONST) { - node.isRuntimeConstant = true - return node - } - const prefix = (raw: string) => { const type = hasOwn(bindingMetadata, raw) && bindingMetadata[raw] if (inline) { @@ -138,6 +131,10 @@ export function processExpression( // bail on parens to prevent any possible function invocations. const bailConstant = rawExp.indexOf(`(`) > -1 if (isSimpleIdentifier(rawExp)) { + // const bindings exposed from setup - we know they never change + if (bindingMetadata[node.content] === BindingTypes.CONST) { + node.isRuntimeConstant = true + } if ( !asParams && !context.identifiers[rawExp] &&