From: Evan You Date: Fri, 13 Nov 2020 03:44:18 +0000 (-0500) Subject: wip: fix runtimeConstant marking X-Git-Tag: v3.0.3~50^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=292a657861e5799ec14dab1b6e4d5def003f49d0;p=thirdparty%2Fvuejs%2Fcore.git wip: fix runtimeConstant marking --- diff --git a/packages/compiler-core/src/transforms/transformExpression.ts b/packages/compiler-core/src/transforms/transformExpression.ts index 276c8cb1bd..f72bd16bb3 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] &&