@@ -235,11 +235,7 @@ export function defineVisitor(context: IndentContext): NodeListener {
235235 0 ,
236236 openToken ,
237237 )
238- if (
239- node . else . children . length === 1 &&
240- node . else . children [ 0 ] . type === "SvelteIfBlock" &&
241- node . else . children [ 0 ] . elseif
242- ) {
238+ if ( node . else . elseif ) {
243239 // else if
244240 return
245241 }
@@ -254,11 +250,7 @@ export function defineVisitor(context: IndentContext): NodeListener {
254250 offsets . setOffsetToken ( closeCloseTagToken , 0 , openCloseTagToken )
255251 } ,
256252 SvelteElseBlock ( node : AST . SvelteElseBlock ) {
257- if (
258- node . children . length === 1 &&
259- node . children [ 0 ] . type === "SvelteIfBlock" &&
260- node . children [ 0 ] . elseif
261- ) {
253+ if ( node . elseif ) {
262254 return
263255 }
264256 const [ openToken , elseToken , closeToken ] = sourceCode . getFirstTokens (
@@ -351,7 +343,7 @@ export function defineVisitor(context: IndentContext): NodeListener {
351343 }
352344
353345 if ( node . then ) {
354- if ( ! node . pending ) {
346+ if ( node . kind === "await-then" ) {
355347 // {#await expression then value}
356348 const thenToken = sourceCode . getTokenAfter ( exp . lastToken ) !
357349 offsets . setOffsetToken ( thenToken , 1 , openToken )
@@ -376,7 +368,7 @@ export function defineVisitor(context: IndentContext): NodeListener {
376368 }
377369 }
378370 if ( node . catch ) {
379- if ( ! node . pending && ! node . then ) {
371+ if ( node . kind === "await-catch" ) {
380372 // {#await expression catch error}
381373 const catchToken = sourceCode . getTokenAfter ( exp . lastToken ) !
382374 offsets . setOffsetToken ( catchToken , 1 , openToken )
@@ -421,8 +413,7 @@ export function defineVisitor(context: IndentContext): NodeListener {
421413 }
422414 } ,
423415 SvelteAwaitThenBlock ( node : AST . SvelteAwaitThenBlock ) {
424- const parent = node . parent
425- if ( parent . pending ) {
416+ if ( ! node . awaitThen ) {
426417 // {:then value}
427418 const [ openToken , thenToken ] = sourceCode . getFirstTokens ( node , {
428419 count : 2 ,
@@ -449,8 +440,7 @@ export function defineVisitor(context: IndentContext): NodeListener {
449440 }
450441 } ,
451442 SvelteAwaitCatchBlock ( node : AST . SvelteAwaitCatchBlock ) {
452- const parent = node . parent
453- if ( parent . pending || parent . then ) {
443+ if ( ! node . awaitCatch ) {
454444 // {:catch error}
455445 const [ openToken , catchToken ] = sourceCode . getFirstTokens ( node , {
456446 count : 2 ,
0 commit comments