pub enum VarKind {
Show 15 variants
Normal,
FunctionDecl,
NewFunctionDecl,
Catch,
LexicalCatch,
FunctionName,
PrivateField,
PrivateMethod,
PrivateGetter,
PrivateSetter,
PrivateGetterSetter,
GlobalFunctionDecl,
Using,
UsingMethod,
With,
}Expand description
What a declared name is used for, which decides how it is displayed and how the function prologue initialises it.
Variants§
Normal
An ordinary binding.
FunctionDecl
A lexical binding holding a hoisted function declaration.
NewFunctionDecl
A lexical binding holding a hoisted async/generator function declaration.
Catch
A catch parameter.
LexicalCatch
A name bound by a destructuring catch parameter.
It is a let in every way that decides scope — the reference’s dump prints
0: let e for catch ({e}) — except that it is initialised as the handler is
entered, so neither a read nor a write needs the dead-zone check that an ordinary
let does.
FunctionName
The name bound to a named function expression, visible inside itself.
PrivateField
A private class field.
PrivateMethod
A private class method.
PrivateGetter
A private class getter.
PrivateSetter
A private class setter.
PrivateGetterSetter
A private class accessor pair (get and set sharing one name).
GlobalFunctionDecl
A global function declaration.
Using
A using declaration’s binding.
UsingMethod
The hidden local holding a using declaration’s cached dispose method.
With
The hidden local holding a with statement’s boxed object.
Marked rather than merely named so the runtime can find the active ones without
guessing from a name prefix: an eval inside a with has to resolve names
against these objects before it reaches the realm.