@@ -17,7 +17,6 @@ import {
17
17
isLiteralWhitelisted ,
18
18
NodeTypes ,
19
19
unwrapTSNode ,
20
- walkIdentifiers ,
21
20
type SimpleExpressionNode ,
22
21
type TextNode ,
23
22
} from '@vue/compiler-dom'
@@ -137,7 +136,7 @@ export function resolveExpression(
137
136
if ( ! node ) return createSimpleExpression ( '' , true )
138
137
node = unwrapTSNode (
139
138
node . type === 'JSXExpressionContainer' ? node . expression : node ,
140
- )
139
+ ) as Node
141
140
const isStatic =
142
141
node . type === 'StringLiteral' ||
143
142
node . type === 'JSXText' ||
@@ -163,20 +162,17 @@ export function resolveExpression(
163
162
node . start ! -= 7
164
163
}
165
164
}
166
- if ( ! isResolved ) {
167
- const offset = node . start ! - 1
168
- walkIdentifiers (
169
- node ,
170
- ( id ) => {
171
- if ( ! id . loc ) return
172
- id . start = id . loc . start . index ! - offset
173
- id . end = id . loc . end . index ! - offset
174
- } ,
175
- true ,
176
- )
177
- resolvedExpressions . add ( node )
178
- }
179
- return resolveSimpleExpression ( source , isStatic , location , node )
165
+
166
+ return resolveSimpleExpression (
167
+ source ,
168
+ isStatic ,
169
+ location ,
170
+ isStatic
171
+ ? undefined
172
+ : parseExpression ( `(${ source } )` , {
173
+ plugins : context . options . expressionPlugins ,
174
+ } ) ,
175
+ )
180
176
}
181
177
182
178
export function resolveSimpleExpression (
@@ -309,7 +305,7 @@ export function resolveExpressionWithFn(node: Node, context: TransformContext) {
309
305
false ,
310
306
node . loc ,
311
307
parseExpression ( `(${ text } )=>{}` , {
312
- plugins : [ 'typescript' ] ,
308
+ plugins : context . options . expressionPlugins ,
313
309
} ) ,
314
310
)
315
311
}
0 commit comments