Fixes a few incorrect/unnecessary JsInterop checks
Change-Id: I518d53a737ec15be498978cd43b09e0030e11cc4
diff --git a/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java b/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java
index a521e5b..9672583 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java
@@ -571,7 +571,7 @@
* True if the type is a JSO or interface implemented by a JSO, or a JsType, or a JsFunction.
*/
public boolean canBeInstantiatedInJavascript(JType type) {
- return canBeJavaScriptObject(type) || isOrExtendsJsType(type, false) || isJsFunction(type);
+ return canBeJavaScriptObject(type) || isJsType(type) || isJsFunction(type);
}
public boolean castFailsTrivially(JReferenceType fromType, JReferenceType toType) {
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java b/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java
index a6fb062..e18da72 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java
@@ -29,7 +29,6 @@
import com.google.gwt.dev.jjs.ast.JExpression;
import com.google.gwt.dev.jjs.ast.JField;
import com.google.gwt.dev.jjs.ast.JFieldRef;
-import com.google.gwt.dev.jjs.ast.JInstanceOf;
import com.google.gwt.dev.jjs.ast.JInterfaceType;
import com.google.gwt.dev.jjs.ast.JLocal;
import com.google.gwt.dev.jjs.ast.JLocalRef;
@@ -304,17 +303,6 @@
}
@Override
- public boolean visit(JInstanceOf x, Context ctx) {
- JReferenceType targetType = x.getTestType();
- if (program.typeOracle.isJsType(targetType)
- && ((JDeclaredType) targetType).getJsPrototype() != null) {
- // keep alive JsType with prototype used in cast so it can used in cast checks against JS objects later
- rescue(targetType, true, true);
- }
- return true;
- }
-
- @Override
public boolean visit(JInterfaceType type, Context ctx) {
boolean isReferenced = referencedTypes.contains(type);
boolean isInstantiated = instantiatedTypes.contains(type);