@@ -244,6 +244,7 @@ function parseAttributeValue(code: string, parserOptions: any, globalLocationCal
244
244
const quoted = ( firstChar === "\"" || firstChar === "'" )
245
245
const locationCalculator = globalLocationCalculator . getSubCalculatorAfter ( node . range [ 0 ] + ( quoted ? 1 : 0 ) )
246
246
const result = (
247
+ quoted && node . value === "" ? { expression : null , tokens : [ ] , comments : [ ] , variables : [ ] , references : [ ] } :
247
248
directiveName === "for" ? parseVForExpression ( node . value , locationCalculator , parserOptions ) :
248
249
directiveName === "on" ? parseVOnExpression ( node . value , locationCalculator , parserOptions ) :
249
250
/* otherwise */ parseExpression ( node . value , locationCalculator , parserOptions )
@@ -323,7 +324,9 @@ export function convertToDirective(code: string, parserOptions: any, locationCal
323
324
expression : ret . expression ,
324
325
references : ret . references ,
325
326
}
326
- ret . expression . parent = directive . value
327
+ if ( ret . expression != null ) {
328
+ ret . expression . parent = directive . value
329
+ }
327
330
328
331
for ( const variable of ret . variables ) {
329
332
node . parent . parent . variables . push ( variable )
@@ -398,7 +401,9 @@ export function processMustache(parserOptions: any, globalLocationCalculator: Lo
398
401
399
402
node . expression = ret . expression
400
403
node . references = ret . references
401
- ret . expression . parent = node
404
+ if ( ret . expression != null ) {
405
+ ret . expression . parent = node
406
+ }
402
407
403
408
replaceTokens ( document , { range } , ret . tokens )
404
409
insertComments ( document , ret . comments )
0 commit comments