public final class Symbol extends Object implements Comparable<Symbol>
NativeArguments objects and parameters stored in Object[]
parameter to variable-arity functions. Those use the #getFieldIndex() property to refer
to their location.| Modifier and Type | Field and Description |
|---|---|
static int |
HAS_BEEN_DECLARED
Is this symbol seen a declaration? Used for block scoped LET and CONST symbols only.
|
static int |
IS_BLOCK_FUNCTION_DECLARATION
Is this symbol a block function declaration?
|
static int |
IS_CATCH_PARAMETER
Is this symbol a catch parameter binding?
|
static int |
IS_CONST
Is this a const binding
|
static int |
IS_DECLARED_IN_SWITCH_BLOCK
Is this symbol declared in an unprotected switch case context?
|
static int |
IS_FUNCTION_SELF
Is this a function self-reference symbol
|
static int |
IS_GLOBAL
Is this a global binding
|
static int |
IS_HOISTABLE_DECLARATION
Is this a hoistable var declaration?
|
static int |
IS_HOISTED_BLOCK_FUNCTION
Is this symbol a block function declaration hoisted into the body scope.
|
static int |
IS_IMPORT_BINDING
Is this symbol an indirect import binding of a module environment?
|
static int |
IS_INTERNAL
Is this an internal symbol, never represented explicitly in source code
|
static int |
IS_LET
Is this a let binding
|
static int |
IS_PARAM
Is this a parameter
|
static int |
IS_PRIVATE_NAME
Is this symbol a private name?
|
static int |
IS_PRIVATE_NAME_ACCESSOR
Is this symbol a private name associated with an accessor?
|
static int |
IS_PRIVATE_NAME_METHOD
Is this symbol a private name associated with a method?
|
static int |
IS_PRIVATE_NAME_STATIC
Is this symbol a private name associated with a static member?
|
static int |
IS_PROGRAM_LEVEL
Is this a program level symbol?
|
static int |
IS_THIS
Is this a this symbol
|
static int |
IS_VAR
Is this a var binding
|
static int |
IS_VAR_REDECLARED_HERE
Is this symbol a var declaration binding that needs to be initialized with the value of the
parent's scope's binding with the same name? Used for parameter bindings that are replicated
in the body's VariableEnvironment.
|
static int |
KINDMASK
Mask for kind flags
|
| Constructor and Description |
|---|
Symbol(String name,
int flags)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Symbol other) |
int |
getFlags()
Get the symbol flags
|
String |
getName()
Get the name of this symbol
|
int |
getUseCount()
Get the symbol's use count
|
boolean |
hasBeenDeclared()
Has this symbol been declared
|
boolean |
isBlockFunctionDeclaration()
Is this symbol a block function declaration.
|
boolean |
isBlockScoped()
Is this a block scoped symbol
|
boolean |
isCatchParameter() |
boolean |
isConst()
Check if this symbol is a constant
|
boolean |
isDeclaredInSwitchBlock()
Has this symbol been declared
|
boolean |
isFunctionSelf()
Flag this symbol as a function's self-referencing symbol.
|
boolean |
isGlobal()
Check if this symbol is a global (undeclared) variable
|
boolean |
isHoistableDeclaration()
Check if this symbol is a hoistable var declaration.
|
boolean |
isHoistedBlockFunctionDeclaration()
Is this symbol a hoisted block function declaration.
|
boolean |
isImportBinding() |
boolean |
isInternal()
Check if this is an internal symbol, without an explicit JavaScript source code equivalent
|
boolean |
isLet()
Check if this symbol is a let
|
boolean |
isParam()
Check if this symbol is a function parameter
|
boolean |
isPrivateAccessor()
Is this symbol a private name associated with an accessor.
|
boolean |
isPrivateField()
Is this symbol a private name associated with a field.
|
boolean |
isPrivateMethod()
Is this symbol a private name associated with a method.
|
boolean |
isPrivateName()
Is this symbol a private name.
|
boolean |
isPrivateNameStatic()
Is this symbol a private name associated with a static member.
|
boolean |
isProgramLevel()
Check if this is a program (script) level definition
|
boolean |
isThis()
Check if this symbol represents
this |
boolean |
isVar()
Check if this symbol is a variable
|
boolean |
isVarRedeclaredHere() |
void |
setHasBeenDeclared()
Mark this symbol as declared
|
void |
setHasBeenDeclared(boolean declared)
Mark this symbol as declared/undeclared
|
void |
setHoistedBlockFunctionDeclaration()
Mark this symbol as a hoisted block function declaration.
|
String |
toString() |
public static final int IS_LET
public static final int IS_CONST
public static final int IS_VAR
public static final int KINDMASK
public static final int IS_GLOBAL
public static final int IS_PARAM
public static final int IS_THIS
public static final int IS_INTERNAL
public static final int IS_FUNCTION_SELF
public static final int IS_HOISTABLE_DECLARATION
public static final int IS_PROGRAM_LEVEL
public static final int HAS_BEEN_DECLARED
public static final int IS_HOISTED_BLOCK_FUNCTION
public static final int IS_VAR_REDECLARED_HERE
public static final int IS_DECLARED_IN_SWITCH_BLOCK
public static final int IS_IMPORT_BINDING
public static final int IS_CATCH_PARAMETER
public static final int IS_BLOCK_FUNCTION_DECLARATION
public static final int IS_PRIVATE_NAME
public static final int IS_PRIVATE_NAME_STATIC
public static final int IS_PRIVATE_NAME_METHOD
public static final int IS_PRIVATE_NAME_ACCESSOR
public Symbol(String name, int flags)
name - name of symbolflags - symbol flagspublic int compareTo(Symbol other)
compareTo in interface Comparable<Symbol>public boolean isHoistableDeclaration()
VarNode.isHoistableDeclaration()public boolean isVar()
public boolean isGlobal()
public boolean isParam()
public boolean isProgramLevel()
public boolean isConst()
public boolean isInternal()
public boolean isThis()
thispublic boolean isLet()
public boolean isFunctionSelf()
public boolean isBlockScoped()
public boolean hasBeenDeclared()
public void setHasBeenDeclared()
public void setHasBeenDeclared(boolean declared)
public int getFlags()
public String getName()
public int getUseCount()
public boolean isDeclaredInSwitchBlock()
public boolean isImportBinding()
Symbol.IS_IMPORT_BINDINGpublic boolean isCatchParameter()
Symbol.IS_CATCH_PARAMETERpublic boolean isVarRedeclaredHere()
public boolean isHoistedBlockFunctionDeclaration()
public void setHoistedBlockFunctionDeclaration()
public boolean isBlockFunctionDeclaration()
public boolean isPrivateName()
public boolean isPrivateNameStatic()
public boolean isPrivateField()
public boolean isPrivateMethod()
public boolean isPrivateAccessor()