Class TypeCheck

    • Field Detail

      • INEXISTENT_PROPERTY

        public static final DiagnosticType INEXISTENT_PROPERTY
      • STRICT_INEXISTENT_PROPERTY

        public static final DiagnosticType STRICT_INEXISTENT_PROPERTY
      • STRICT_INEXISTENT_UNION_PROPERTY

        public static final DiagnosticType STRICT_INEXISTENT_UNION_PROPERTY
      • 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 TypedScope processForTesting​(Node externsRoot,
                                            Node jsRoot)
        Main entry point of this phase for testing code.
        Parameters:
        externsRoot - may be null or a ROOT node. If null the externs are not typechecked. Note: the externs node must always exist in the AST, even if not typechecked.
        jsRoot - must be a ROOT node and the second child of the global ROOT.
      • 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.