|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.javascript.jscomp.TypeCheck
public class TypeCheck
Checks the types of JS expressions against any declared type information.
Field Summary | |
---|---|
protected static DiagnosticType |
NOT_A_CONSTRUCTOR
|
protected static String |
OVERRIDING_PROTOTYPE_WITH_NON_OBJECT
|
Constructor Summary | |
---|---|
TypeCheck(AbstractCompiler compiler,
com.google.javascript.jscomp.ReverseAbstractInterpreter reverseInterpreter,
JSTypeRegistry typeRegistry,
CheckLevel reportMissingOverride,
CheckLevel reportUnknownTypes)
|
|
TypeCheck(AbstractCompiler compiler,
com.google.javascript.jscomp.ReverseAbstractInterpreter reverseInterpreter,
JSTypeRegistry typeRegistry,
Scope topScope,
com.google.javascript.jscomp.ScopeCreator scopeCreator,
CheckLevel reportMissingOverride,
CheckLevel reportUnknownTypes)
|
Method Summary | |
---|---|
void |
check(Node node,
boolean externs)
|
void |
process(Node externsRoot,
Node jsRoot)
Main entry point for this phase of processing. |
Scope |
processForTesting(Node externsRoot,
Node jsRoot)
Main entry point of this phase for testing code. |
boolean |
shouldTraverse(NodeTraversal t,
Node n,
Node parent)
Visits a node in pre order (before visiting its children) and decides whether this node's children should be traversed. |
void |
visit(NodeTraversal t,
Node n,
Node parent)
This is the meat of the type checking. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String OVERRIDING_PROTOTYPE_WITH_NON_OBJECT
protected static final DiagnosticType NOT_A_CONSTRUCTOR
Constructor Detail |
---|
public TypeCheck(AbstractCompiler compiler, com.google.javascript.jscomp.ReverseAbstractInterpreter reverseInterpreter, JSTypeRegistry typeRegistry, Scope topScope, com.google.javascript.jscomp.ScopeCreator scopeCreator, CheckLevel reportMissingOverride, CheckLevel reportUnknownTypes)
public TypeCheck(AbstractCompiler compiler, com.google.javascript.jscomp.ReverseAbstractInterpreter reverseInterpreter, JSTypeRegistry typeRegistry, CheckLevel reportMissingOverride, CheckLevel reportUnknownTypes)
Method Detail |
---|
public void process(Node externsRoot, Node jsRoot)
process
in interface CompilerPass
externsRoot
- The root of the externs parse tree.jsRoot
- The root of the input parse tree to be checked.public Scope processForTesting(Node externsRoot, Node jsRoot)
public void check(Node node, boolean externs)
public boolean shouldTraverse(NodeTraversal t, Node n, Node parent)
NodeTraversal.Callback
Visits a node in pre order (before visiting its children) and decides
whether this node's children should be traversed. If children are
traversed, they will be visited by
NodeTraversal.Callback.visit(NodeTraversal, Node, Node)
in post order.
Implementations can have side effects (e.g. modifying the parse tree).
shouldTraverse
in interface NodeTraversal.Callback
public void visit(NodeTraversal t, Node n, Node parent)
visit
in interface NodeTraversal.Callback
t
- The node traversal object that supplies context, such as the
scope chain to use in name lookups as well as error reporting.n
- The node being visited.parent
- The parent of the node n.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |