Class AbstractStaticScope<T>
- java.lang.Object
-
- com.google.javascript.rhino.testing.AbstractStaticScope<T>
-
- All Implemented Interfaces:
StaticScope<T>
- Direct Known Subclasses:
MapBasedScope
public abstract class AbstractStaticScope<T> extends java.lang.Object implements StaticScope<T>
A scope that just returns null for everything.
-
-
Constructor Summary
Constructors Constructor Description AbstractStaticScope()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StaticSlot<T>getOwnSlot(java.lang.String name)LikegetSlotbut does not recurse into parent scopes.StaticScope<T>getParentScope()Returns the scope enclosing this one or null if none.NodegetRootNode()Returns the root node associated with this scope.abstract StaticSlot<T>getSlot(java.lang.String name)Returns any defined slot within this scope for this name.TgetTypeOfThis()Returns the expected type ofthisin the current scope.
-
-
-
Method Detail
-
getRootNode
public Node getRootNode()
Description copied from interface:StaticScopeReturns the root node associated with this scope. May be null.- Specified by:
getRootNodein interfaceStaticScope<T>
-
getParentScope
public StaticScope<T> getParentScope()
Description copied from interface:StaticScopeReturns the scope enclosing this one or null if none.- Specified by:
getParentScopein interfaceStaticScope<T>
-
getSlot
public abstract StaticSlot<T> getSlot(java.lang.String name)
Description copied from interface:StaticScopeReturns 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:
getSlotin interfaceStaticScope<T>- Parameters:
name- The name of the variable slot to look up.- Returns:
- The defined slot for the variable, or
nullif no definition exists.
-
getOwnSlot
public StaticSlot<T> getOwnSlot(java.lang.String name)
Description copied from interface:StaticScopeLikegetSlotbut does not recurse into parent scopes.- Specified by:
getOwnSlotin interfaceStaticScope<T>
-
getTypeOfThis
public T getTypeOfThis()
Description copied from interface:StaticScopeReturns the expected type ofthisin the current scope.- Specified by:
getTypeOfThisin interfaceStaticScope<T>
-
-