use of com.google.javascript.rhino.jstype.StaticTypedScope in project closure-compiler by google.
the class TypeInferenceTest method getParamNameNode.
/**
* Returns the NAME node {@code name} from the PARAM_LIST of the top level of type inference.
*/
private Node getParamNameNode(String name) {
StaticTypedScope staticScope = checkNotNull(returnScope.getDeclarationScope(), returnScope);
StaticTypedSlot slot = checkNotNull(staticScope.getSlot(name), staticScope);
StaticTypedRef declaration = checkNotNull(slot.getDeclaration(), slot);
Node node = checkNotNull(declaration.getNode(), declaration);
assertNode(node).hasType(Token.NAME);
assertThat(stream(node.getAncestors()).filter(Node::isParamList).collect(toImmutableList())).isNotEmpty();
return node;
}
Aggregations