Class ReferenceCollectingCallback

    • Method Detail

      • process

        public void process​(Node externs,
                            Node root)
        Convenience method for running this pass over a tree with this class as a callback.
        Specified by:
        process in interface CompilerPass
        Parameters:
        externs - Top of external JS tree
        root - Top of JS tree
      • process

        public void process​(Node root)
      • hotSwapScript

        public void hotSwapScript​(Node scriptRoot,
                                  Node originalRoot)
        Same as process but only runs on a part of AST associated to one script.
        Specified by:
        hotSwapScript in interface HotSwapCompilerPass
        Parameters:
        scriptRoot - Root node corresponding to the file that is modified, should be of type Token.SCRIPT.
        originalRoot - Root node corresponding to the original version of the file that is modified. Should be of type token.SCRIPT.
      • visit

        public void visit​(NodeTraversal t,
                          Node n,
                          Node parent)
        For each node, update the block stack and reference collection as appropriate.
        Specified by:
        visit in interface NodeTraversal.Callback
        Parameters:
        t - The current traversal.
        n - The current node.
        parent - The parent of the current node.
      • shouldTraverse

        public boolean shouldTraverse​(NodeTraversal nodeTraversal,
                                      Node n,
                                      Node parent)
        Updates block stack.
        Specified by:
        shouldTraverse in interface NodeTraversal.Callback
        Parameters:
        nodeTraversal - The current traversal.
        n - The current node.
        parent - The parent of the current node.
        Returns:
        whether the children of this node should be visited