@@ -244,6 +244,7 @@ function parseAttributeValue(code: string, parserOptions: any, globalLocationCal
244244 const quoted = ( firstChar === "\"" || firstChar === "'" )
245245 const locationCalculator = globalLocationCalculator . getSubCalculatorAfter ( node . range [ 0 ] + ( quoted ? 1 : 0 ) )
246246 const result = (
247+ quoted && node . value === "" ? { expression : null , tokens : [ ] , comments : [ ] , variables : [ ] , references : [ ] } :
247248 directiveName === "for" ? parseVForExpression ( node . value , locationCalculator , parserOptions ) :
248249 directiveName === "on" ? parseVOnExpression ( node . value , locationCalculator , parserOptions ) :
249250 /* otherwise */ parseExpression ( node . value , locationCalculator , parserOptions )
@@ -323,7 +324,9 @@ export function convertToDirective(code: string, parserOptions: any, locationCal
323324 expression : ret . expression ,
324325 references : ret . references ,
325326 }
326- ret . expression . parent = directive . value
327+ if ( ret . expression != null ) {
328+ ret . expression . parent = directive . value
329+ }
327330
328331 for ( const variable of ret . variables ) {
329332 node . parent . parent . variables . push ( variable )
@@ -398,7 +401,9 @@ export function processMustache(parserOptions: any, globalLocationCalculator: Lo
398401
399402 node . expression = ret . expression
400403 node . references = ret . references
401- ret . expression . parent = node
404+ if ( ret . expression != null ) {
405+ ret . expression . parent = node
406+ }
402407
403408 replaceTokens ( document , { range } , ret . tokens )
404409 insertComments ( document , ret . comments )
0 commit comments