*/
private JClassType vtableTypeAssigned(JsStatement stat) {
if (!(stat instanceof JsExprStmt)) {
return null;
}
JsExprStmt expr = (JsExprStmt) stat;
if (expr.getExpression() instanceof JsInvocation) {
// Handle a defineClass call.
JsInvocation call = (JsInvocation) expr.getExpression();
if (!(call.getQualifier() instanceof JsNameRef)) {
return null;
}
JsNameRef func = (JsNameRef) call.getQualifier();
JsFunction defineClassJsFunc =
jsprogram.getIndexedFunction("JavaClassHierarchySetupUtil.defineClass");
JsFunction defineClassJsProtoFunc =
jsprogram.getIndexedFunction(
"JavaClassHierarchySetupUtil.defineClassWithPrototype");
if (func.getName() != defineClassJsFunc.getName() && func.getName() !=
defineClassJsProtoFunc.getName()) {
return null;
}
return map.typeForStatement(stat);
}
// Handle String.
if (!(expr.getExpression() instanceof JsBinaryOperation)) {
return null;
}
JsBinaryOperation binExpr = (JsBinaryOperation) expr.getExpression();
if (binExpr.getOperator() != JsBinaryOperator.ASG) {
return null;
}
if (!(binExpr.getArg1() instanceof JsNameRef)) {
return null;