Small refactor in JsFunction.

Change-Id: I00694255580c3cacfc2a4e246b8c7be67dd7b53b
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java b/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java
index 69a01c6..af64f2f 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java
@@ -1414,15 +1414,6 @@
       setupGwtOnLoad();
 
       embedBindingProperties();
-
-      if (program.getRunAsyncs().size() > 0) {
-        // Prevent onLoad from being pruned.
-        JMethod onLoadMethod = program.getIndexedMethod("AsyncFragmentLoader.onLoad");
-        JsName name = names.get(onLoadMethod);
-        assert name != null;
-        JsFunction function = (JsFunction) name.getStaticRef();
-        function.setArtificiallyRescued(true);
-      }
     }
 
     private void generateRemainingClassLiterals() {
diff --git a/dev/core/src/com/google/gwt/dev/js/JsUnusedFunctionRemover.java b/dev/core/src/com/google/gwt/dev/js/JsUnusedFunctionRemover.java
index 40694e6..975d34a 100644
--- a/dev/core/src/com/google/gwt/dev/js/JsUnusedFunctionRemover.java
+++ b/dev/core/src/com/google/gwt/dev/js/JsUnusedFunctionRemover.java
@@ -48,7 +48,8 @@
       JsName name = f.getName();
 
       // Anonymous function, ignore it
-      if (name == null || seen.contains(name) || f.isArtificiallyRescued()) {
+      if (name == null || seen.contains(name)
+          || program.getIndexedFunction("AsyncFragmentLoader.onLoad") == f) {
         return;
       }
 
diff --git a/dev/core/src/com/google/gwt/dev/js/ast/JsFunction.java b/dev/core/src/com/google/gwt/dev/js/ast/JsFunction.java
index 587600c..9458096 100644
--- a/dev/core/src/com/google/gwt/dev/js/ast/JsFunction.java
+++ b/dev/core/src/com/google/gwt/dev/js/ast/JsFunction.java
@@ -28,7 +28,6 @@
   protected JsBlock body;
   protected final List<JsParameter> params = new ArrayList<JsParameter>();
   protected final JsScope scope;
-  private boolean artificiallyRescued;
   private boolean isClinit;
   private boolean fromJava;
   private JsFunction superClinit;
@@ -123,10 +122,6 @@
     return name != null;
   }
 
-  public boolean isArtificiallyRescued() {
-    return artificiallyRescued;
-  }
-
   @Override
   public boolean isBooleanFalse() {
     return false;
@@ -154,10 +149,6 @@
     this.isClinit = true;
   }
 
-  public void setArtificiallyRescued(boolean rescued) {
-    this.artificiallyRescued = rescued;
-  }
-
   public void setBody(JsBlock body) {
     this.body = body;
   }