class StripCode.Strip {
/**
* Determines whether the given node helps to define a
* strip type. For example, goog.inherits(stripType, Object)
* would be such a call.
*
* Also reports an error if a non-strip type inherits from a strip type.
*
* @param t The current traversal
* @param callNode The CALL node
*/
private boolean actsOnStripType(NodeTraversal t, Node callNode) {
SubclassRelationship classes =
compiler.getCodingConvention().getClassesDefinedByCall(callNode);
if (classes != null) {
// It's okay to strip a type that inherits from a non-stripped type
// e.g. goog.inherits(goog.debug.Logger, Object)
if (qualifiedNameBeginsWithStripType(classes.subclassName)) {
return true;
}
// report an error if a non-strip type inherits from a
// strip type.
if (qualifiedNameBeginsWithStripType(classes.superclassName)) {
t.report(callNode, STRIP_TYPE_INHERIT_ERROR,
classes.subclassName, classes.superclassName);
}
}
return false;
}
}