File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
tests/fixtures/parser/ast Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -437,7 +437,12 @@ export function convertAwaitBlock(
437
437
...ctx . getConvertLocation ( {
438
438
start : thenStart ,
439
439
end : endIndexFromFragment ( then , ( ) => {
440
- return awaitBlock . pending ?. range [ 1 ] ?? node . end ;
440
+ return (
441
+ ctx . code . indexOf (
442
+ "}" ,
443
+ node . value ? getWithLoc ( node . value ) . end : thenStart + 5 ,
444
+ ) + 1
445
+ ) ;
441
446
} ) ,
442
447
} ) ,
443
448
} ;
@@ -518,13 +523,13 @@ export function convertAwaitBlock(
518
523
( awaitBlock as SvelteAwaitBlockAwaitCatch ) . kind = "await-catch" ;
519
524
}
520
525
const catchStart =
521
- awaitBlock . pending || awaitBlock . then
526
+ awaitBlock . then || awaitBlock . pending
522
527
? startBlockIndex (
523
528
ctx . code ,
524
529
node . error
525
530
? getWithLoc ( node . error ) . start
526
531
: startIndexFromFragment ( catchFragment , ( ) => {
527
- return ( awaitBlock . pending || awaitBlock . then ) . range [ 1 ] ;
532
+ return ( awaitBlock . then || awaitBlock . pending ) . range [ 1 ] ;
528
533
} ) ,
529
534
":catch" ,
530
535
)
@@ -538,7 +543,12 @@ export function convertAwaitBlock(
538
543
...ctx . getConvertLocation ( {
539
544
start : catchStart ,
540
545
end : endIndexFromFragment ( catchFragment , ( ) => {
541
- return ( awaitBlock . pending || awaitBlock . then ) ?. range [ 1 ] ?? node . end ;
546
+ return (
547
+ ctx . code . indexOf (
548
+ "}" ,
549
+ node . error ? getWithLoc ( node . error ) . end : catchStart + 6 ,
550
+ ) + 1
551
+ ) ;
542
552
} ) ,
543
553
} ) ,
544
554
} as SvelteAwaitCatchBlock ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments