@@ -256,15 +256,15 @@ function insertError(
256
256
* @param globalLocationCalculator The location calculator to adjust the locations of nodes.
257
257
* @param node The attribute node to replace. This function modifies this node directly.
258
258
* @param tagName The name of this tag.
259
- * @param directiveName The name of this directive.
259
+ * @param directiveKey The key of this directive.
260
260
*/
261
261
function parseAttributeValue (
262
262
code : string ,
263
263
parserOptions : any ,
264
264
globalLocationCalculator : LocationCalculator ,
265
265
node : VLiteral ,
266
266
tagName : string ,
267
- directiveName : string ,
267
+ directiveKey : VDirectiveKey ,
268
268
) : ExpressionParseResult {
269
269
const firstChar = code [ node . range [ 0 ] ]
270
270
const quoted = firstChar === '"' || firstChar === "'"
@@ -281,21 +281,21 @@ function parseAttributeValue(
281
281
variables : [ ] ,
282
282
references : [ ] ,
283
283
}
284
- } else if ( directiveName === "for" ) {
284
+ } else if ( directiveKey . name === "for" ) {
285
285
result = parseVForExpression (
286
286
node . value ,
287
287
locationCalculator ,
288
288
parserOptions ,
289
289
)
290
- } else if ( directiveName === "on" ) {
290
+ } else if ( directiveKey . name === "on" && directiveKey . argument != null ) {
291
291
result = parseVOnExpression (
292
292
node . value ,
293
293
locationCalculator ,
294
294
parserOptions ,
295
295
)
296
296
} else if (
297
- directiveName === "slot-scope" ||
298
- ( tagName === "template" && directiveName === "scope" )
297
+ directiveKey . name === "slot-scope" ||
298
+ ( tagName === "template" && directiveKey . name === "scope" )
299
299
) {
300
300
result = parseSlotScopeExpression (
301
301
node . value ,
@@ -398,7 +398,7 @@ export function convertToDirective(
398
398
locationCalculator ,
399
399
node . value ,
400
400
node . parent . parent . name ,
401
- directive . key . name ,
401
+ directive . key ,
402
402
)
403
403
404
404
directive . value = {
0 commit comments