@@ -447,14 +447,9 @@ function transformForReactiveStatement(
447
447
const functionId = ctx . generateUniqueId ( "reactiveStatementScopeFunction" ) ;
448
448
const originalBody = statement . body ;
449
449
ctx . appendOriginal ( originalBody . range [ 0 ] ) ;
450
- ctx . appendVirtualScript ( `function ${ functionId } ()` ) ;
451
- if ( originalBody . type !== "BlockStatement" ) {
452
- ctx . appendVirtualScript ( `{` ) ;
453
- }
450
+ ctx . appendVirtualScript ( `function ${ functionId } (){` ) ;
454
451
ctx . appendOriginal ( originalBody . range [ 1 ] ) ;
455
- if ( originalBody . type !== "BlockStatement" ) {
456
- ctx . appendVirtualScript ( `}` ) ;
457
- }
452
+ ctx . appendVirtualScript ( `}` ) ;
458
453
ctx . appendOriginal ( statement . range [ 1 ] ) ;
459
454
460
455
ctx . restoreContext . addRestoreStatementProcess ( ( node , result ) => {
@@ -466,11 +461,7 @@ function transformForReactiveStatement(
466
461
if ( body . type !== "FunctionDeclaration" || body . id . name !== functionId ) {
467
462
return false ;
468
463
}
469
- if ( originalBody . type === "BlockStatement" ) {
470
- reactiveStatement . body = body . body ;
471
- } else {
472
- reactiveStatement . body = body . body . body [ 0 ] ;
473
- }
464
+ reactiveStatement . body = body . body . body [ 0 ] ;
474
465
reactiveStatement . body . parent = reactiveStatement ;
475
466
476
467
const scopeManager = result . scopeManager as ScopeManager ;
0 commit comments