Package com.google.javascript.jscomp
Class Scope
- java.lang.Object
-
- com.google.javascript.jscomp.AbstractScope<Scope,Var>
-
- com.google.javascript.jscomp.Scope
-
- All Implemented Interfaces:
StaticScope
,java.io.Serializable
public final class Scope extends AbstractScope<Scope,Var>
Scope contains information about a variable scope in JavaScript. Scopes can be nested, a scope points back to its parent scope. A Scope contains information about variables defined in that scope.- See Also:
NodeTraversal
, Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDepth()
The depth of the scope.Scope
getParent()
Returns the parent scope, or null if this is the global scope.Scope
untyped()
-
Methods inherited from class com.google.javascript.jscomp.AbstractScope
getAllAccessibleVariables, getAllSymbols, getArgumentsVar, getClosestContainerScope, getClosestHoistScope, getGlobalScope, getOwnSlot, getParentScope, getRootNode, getSlot, getVar, getVarCount, getVarIterable, hasOwnImplicitSlot, hasOwnSlot, hasSlot, isBlockScope, isCatchScope, isFunctionBlockScope, isFunctionScope, isGlobal, isLocal, isModuleScope, toString, typed
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.javascript.rhino.StaticScope
getTopmostScopeOfEventualDeclaration
-
-
-
-
Method Detail
-
untyped
public Scope untyped()
- Overrides:
untyped
in classAbstractScope<Scope,Var>
-
getDepth
public int getDepth()
Description copied from class:AbstractScope
The depth of the scope. The global scope has depth 0.- Specified by:
getDepth
in classAbstractScope<Scope,Var>
-
getParent
public Scope getParent()
Description copied from class:AbstractScope
Returns the parent scope, or null if this is the global scope.- Specified by:
getParent
in classAbstractScope<Scope,Var>
-
-