File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
packages/compiler-core/src/transforms Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -227,18 +227,20 @@ export function processExpression(
227
227
const isScopeVarReference = context . identifiers [ rawExp ]
228
228
const isAllowedGlobal = isGloballyAllowed ( rawExp )
229
229
const isLiteral = isLiteralWhitelisted ( rawExp )
230
- if ( ! asParams && ! isScopeVarReference && ! isAllowedGlobal && ! isLiteral ) {
230
+ if (
231
+ ! asParams &&
232
+ ! isScopeVarReference &&
233
+ ! isLiteral &&
234
+ ( ! isAllowedGlobal || bindingMetadata [ rawExp ] )
235
+ ) {
231
236
// const bindings exposed from setup can be skipped for patching but
232
237
// cannot be hoisted to module scope
233
- if ( isConst ( bindingMetadata [ node . content ] ) ) {
238
+ if ( isConst ( bindingMetadata [ rawExp ] ) ) {
234
239
node . constType = ConstantTypes . CAN_SKIP_PATCH
235
240
}
236
241
node . content = rewriteIdentifier ( rawExp )
237
242
} else if ( ! isScopeVarReference ) {
238
- if ( isAllowedGlobal && bindingMetadata [ rawExp ] ) {
239
- // #9482
240
- node . content = rewriteIdentifier ( rawExp )
241
- } else if ( isLiteral ) {
243
+ if ( isLiteral ) {
242
244
node . constType = ConstantTypes . CAN_STRINGIFY
243
245
} else {
244
246
node . constType = ConstantTypes . CAN_HOIST
You can’t perform that action at this time.
0 commit comments