[dart2js] Don't inline direct recursion

This avoids a bug in handling ir.Let bindings.

Change-Id: I0ccd932248a550a5017dfe565209e8ef62299ff3
Reviewed-on: https://dart-review.googlesource.com/c/91241
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index 1674df2..1500ab2 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -5044,7 +5044,8 @@
     }
 
     bool heuristicSayGoodToGo() {
-      // Don't inline recursively
+      // Don't inline recursively, directly or indirectly.
+      if (function == targetElement) return false;
       if (_inliningStack.any((entry) => entry.function == function)) {
         return false;
       }