com.google.javascript.rhino.testing
Class AbstractStaticScope<T>

java.lang.Object
  extended by com.google.javascript.rhino.testing.AbstractStaticScope<T>
All Implemented Interfaces:
StaticScope<T>
Direct Known Subclasses:
MapBasedScope

public abstract class AbstractStaticScope<T>
extends Object
implements StaticScope<T>

A scope that just returns null for everything.


Constructor Summary
AbstractStaticScope()
           
 
Method Summary
 StaticSlot<T> getOwnSlot(String name)
          Like getSlot but does not recurse into parent scopes.
 StaticScope<T> getParentScope()
          Returns the scope enclosing this one or null if none.
 Node getRootNode()
          Returns the root node associated with this scope.
abstract  StaticSlot<T> getSlot(String name)
          Returns any defined slot within this scope for this name.
 T getTypeOfThis()
          Returns the expected type of this in the current scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStaticScope

public AbstractStaticScope()
Method Detail

getRootNode

public Node getRootNode()
Description copied from interface: StaticScope
Returns the root node associated with this scope. May be null.

Specified by:
getRootNode in interface StaticScope<T>

getParentScope

public StaticScope<T> getParentScope()
Description copied from interface: StaticScope
Returns the scope enclosing this one or null if none.

Specified by:
getParentScope in interface StaticScope<T>

getSlot

public abstract StaticSlot<T> getSlot(String name)
Description copied from interface: StaticScope
Returns any defined slot within this scope for this name. This call continues searching through parent scopes if a slot with this name is not found in the current scope.

Specified by:
getSlot in interface StaticScope<T>
Parameters:
name - The name of the variable slot to look up.
Returns:
The defined slot for the variable, or null if no definition exists.

getOwnSlot

public StaticSlot<T> getOwnSlot(String name)
Description copied from interface: StaticScope
Like getSlot but does not recurse into parent scopes.

Specified by:
getOwnSlot in interface StaticScope<T>

getTypeOfThis

public T getTypeOfThis()
Description copied from interface: StaticScope
Returns the expected type of this in the current scope.

Specified by:
getTypeOfThis in interface StaticScope<T>