Class ReferenceCollector

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  ReferenceCollector.Behavior
      Way for callers to add specific behavior during traversal that utilizes the built-up reference information.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Iterable<Var> getAllSymbols()
      Gets the variables that were referenced in this callback.
      ReferenceCollection getReferences​(Var v)
      Gets the reference collection for the given variable.
      Scope getScope​(Var var)
      Returns the scope for a given symbol.
      void hotSwapScript​(Node scriptRoot, Node originalRoot)
      Same as process but only runs on a part of AST associated to one script.
      void process​(Node root)  
      void process​(Node externs, Node root)
      Convenience method for running this pass over a tree with this class as a callback.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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.