Class TypeCheck

    • Field Detail

      • OVERRIDING_PROTOTYPE_WITH_NON_OBJECT

        protected static final java.lang.String OVERRIDING_PROTOTYPE_WITH_NON_OBJECT
        See Also:
        Constant Field Values
      • NOT_A_CONSTRUCTOR

        protected static final DiagnosticType NOT_A_CONSTRUCTOR
    • Method Detail

      • process

        public void process​(Node externsRoot,
                            Node jsRoot)
        Main entry point for this phase of processing. This follows the pattern for JSCompiler phases.
        Specified by:
        process in interface CompilerPass
        Parameters:
        externsRoot - The root of the externs parse tree.
        jsRoot - The root of the input parse tree to be checked.
      • processForTesting

        public Scope processForTesting​(Node externsRoot,
                                       Node jsRoot)
        Main entry point of this phase for testing code.
      • check

        public void check​(Node node,
                          boolean externs)
      • visit

        public void visit​(NodeTraversal t,
                          Node n,
                          Node parent)
        This is the meat of the type checking. It is basically one big switch, with each case representing one type of parse tree node. The individual cases are usually pretty straightforward.
        Specified by:
        visit in interface NodeTraversal.Callback
        Parameters:
        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.