Skip to content

Commit 292a657

Browse files
committed
wip: fix runtimeConstant marking
1 parent 0ca9137 commit 292a657

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

packages/compiler-core/src/transforms/transformExpression.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,6 @@ export function processExpression(
100100
}
101101

102102
const { inline, bindingMetadata } = context
103-
104-
// const bindings exposed from setup - we know they never change
105-
if (bindingMetadata[node.content] === BindingTypes.CONST) {
106-
node.isRuntimeConstant = true
107-
return node
108-
}
109-
110103
const prefix = (raw: string) => {
111104
const type = hasOwn(bindingMetadata, raw) && bindingMetadata[raw]
112105
if (inline) {
@@ -138,6 +131,10 @@ export function processExpression(
138131
// bail on parens to prevent any possible function invocations.
139132
const bailConstant = rawExp.indexOf(`(`) > -1
140133
if (isSimpleIdentifier(rawExp)) {
134+
// const bindings exposed from setup - we know they never change
135+
if (bindingMetadata[node.content] === BindingTypes.CONST) {
136+
node.isRuntimeConstant = true
137+
}
141138
if (
142139
!asParams &&
143140
!context.identifiers[rawExp] &&

0 commit comments

Comments
 (0)