com.google.javascript.jscomp
Class FindExportableNodes

java.lang.Object
  extended by com.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback
      extended by com.google.javascript.jscomp.FindExportableNodes
All Implemented Interfaces:
NodeTraversal.Callback

public class FindExportableNodes
extends NodeTraversal.AbstractPostOrderCallback

Records all of the symbols and properties that should be exported. Currently applies to: - function foo() {} - var foo = function() {} - foo.bar = function() {} - var FOO = ...; - foo.BAR = ...; FOO = BAR = 5; and var FOO = BAR = 5; are not supported because the annotation is ambigous to whether it applies to all the variables or only the first one.


Nested Class Summary
static class FindExportableNodes.GenerateNodeContext
          Context holding the node references required for generating the export calls.
 
Constructor Summary
FindExportableNodes(AbstractCompiler compiler)
           
 
Method Summary
 LinkedHashMap<String,FindExportableNodes.GenerateNodeContext> getExports()
           
 void visit(NodeTraversal t, Node n, Node parent)
          Visits a node in post order (after its children have been visited).
 
Methods inherited from class com.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback
shouldTraverse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindExportableNodes

public FindExportableNodes(AbstractCompiler compiler)
Method Detail

visit

public void visit(NodeTraversal t,
                  Node n,
                  Node parent)
Description copied from interface: NodeTraversal.Callback

Visits a node in post order (after its children have been visited). A node is visited only if all its parents should be traversed (NodeTraversal.Callback.shouldTraverse(NodeTraversal, Node, Node)).

Implementations can have side effects (e.g. modifying the parse tree).


getExports

public LinkedHashMap<String,FindExportableNodes.GenerateNodeContext> getExports()