Class MapBasedScope
- java.lang.Object
-
- com.google.javascript.rhino.testing.AbstractStaticScope<JSType>
-
- com.google.javascript.rhino.testing.MapBasedScope
-
- All Implemented Interfaces:
StaticScope<JSType>
public class MapBasedScope extends AbstractStaticScope<JSType>
A scope based on a simple hashmap.
-
-
Constructor Summary
Constructors Constructor Description MapBasedScope(java.util.Map<java.lang.String,? extends JSType> namesToTypes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MapBasedScope
emptyScope()
StaticSlot<JSType>
getSlot(java.lang.String name)
Returns any defined slot within this scope for this name.-
Methods inherited from class com.google.javascript.rhino.testing.AbstractStaticScope
getOwnSlot, getParentScope, getRootNode, getTypeOfThis
-
-
-
-
Constructor Detail
-
MapBasedScope
public MapBasedScope(java.util.Map<java.lang.String,? extends JSType> namesToTypes)
-
-
Method Detail
-
emptyScope
public static MapBasedScope emptyScope()
-
getSlot
public StaticSlot<JSType> getSlot(java.lang.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 interfaceStaticScope<JSType>
- Specified by:
getSlot
in classAbstractStaticScope<JSType>
- Parameters:
name
- The name of the variable slot to look up.- Returns:
- The defined slot for the variable, or
null
if no definition exists.
-
-