[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 <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
diff --git a/pkg/dev_compiler/lib/src/compiler/module_builder.dart b/pkg/dev_compiler/lib/src/compiler/module_builder.dart
index 0ba32db..f7790fd 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 @@
 
     return Fun(
       function.params,
-      Block([...importStatements, ...statements, ...function.body.statements]),
+      Block([...importStatements, ...function.body.statements]),
     );
   }
 
@@ -429,7 +429,7 @@
 
     return Fun(
       function.params,
-      Block([...importStatements, ...statements, ...function.body.statements]),
+      Block([...importStatements, ...function.body.statements]),
     );
   }
 
@@ -518,7 +518,7 @@
 
     return Fun(
       function.params,
-      Block([...importStatements, ...statements, ...function.body.statements]),
+      Block([...importStatements, ...function.body.statements]),
     );
   }