From e94de78d2bb73240999163a264b0fcf6605f026a Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Wed, 6 Nov 2024 20:42:13 +0000 Subject: [PATCH] [ddc] Remove statements from the Fun returned by buildFunctionWithImports This list of statements is intended to support additional statements that need to be emitted to handle imports/exports. For the incremental case, no non-import statements exist and can be safely omitted from the body. We should be intentional about including these if needed later to avoid accidentally including unnecessary statements. Change-Id: I726bb9e980d43c1edd1d0bda2d9be897586638ea Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393163 Reviewed-by: Nicholas Shahan Commit-Queue: Srujan Gaddam --- pkg/dev_compiler/lib/src/compiler/module_builder.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/dev_compiler/lib/src/compiler/module_builder.dart b/pkg/dev_compiler/lib/src/compiler/module_builder.dart index 0ba32db4b23..f7790fd0771 100644 --- a/pkg/dev_compiler/lib/src/compiler/module_builder.dart +++ b/pkg/dev_compiler/lib/src/compiler/module_builder.dart @@ -259,7 +259,7 @@ class DdcModuleBuilder extends _ModuleBuilder { return Fun( function.params, - Block([...importStatements, ...statements, ...function.body.statements]), + Block([...importStatements, ...function.body.statements]), ); } @@ -429,7 +429,7 @@ class AmdModuleBuilder extends _ModuleBuilder { return Fun( function.params, - Block([...importStatements, ...statements, ...function.body.statements]), + Block([...importStatements, ...function.body.statements]), ); } @@ -518,7 +518,7 @@ class DdcLibraryBundleBuilder extends _ModuleBuilder { return Fun( function.params, - Block([...importStatements, ...statements, ...function.body.statements]), + Block([...importStatements, ...function.body.statements]), ); }