Enum boa::syntax::ast::node::declaration::DeclarationList [−][src]
pub enum DeclarationList {
Const(Box<[Declaration]>),
Let(Box<[Declaration]>),
Var(Box<[Declaration]>),
}Variants
Const(Box<[Declaration]>)The const statements are block-scoped, much like variables defined using the let
keyword.
This declaration creates a constant whose scope can be either global or local to the block in which it is declared. Global constants do not become properties of the window object, unlike var variables.
An initializer for a constant is required. You must specify its value in the same statement in which it’s declared. (This makes sense, given that it can’t be changed later.)
More information:
Tuple Fields of Const
0: Box<[Declaration]>Let(Box<[Declaration]>)The let statement declares a block scope local variable, optionally initializing it to a
value.
let allows you to declare variables that are limited to a scope of a block statement, or
expression on which it is used, unlike the var keyword, which defines a variable
globally, or locally to an entire function regardless of block scope.
Just like const the let does not create properties of the window object when declared
globally (in the top-most scope).
More information:
Tuple Fields of Let
0: Box<[Declaration]>Var(Box<[Declaration]>)The var statement declares a variable, optionally initializing it to a value.
var declarations, wherever they occur, are processed before any code is executed. This is called hoisting, and is discussed further below.
The scope of a variable declared with var is its current execution context, which is either the enclosing function or, for variables declared outside any function, global. If you re-declare a JavaScript variable, it will not lose its value.
Assigning a value to an undeclared variable implicitly creates it as a global variable (it becomes a property of the global object) when the assignment is executed.
More information:
Tuple Fields of Var
0: Box<[Declaration]>Trait Implementations
Performs the conversion.
Performs the conversion.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Runs Finalize::finalize() on this object and all contained subobjects Read more
Auto Trait Implementations
impl !RefUnwindSafe for DeclarationList
impl !Send for DeclarationList
impl !Sync for DeclarationList
impl Unpin for DeclarationList
impl UnwindSafe for DeclarationList
Blanket Implementations
Mutably borrows from an owned value. Read more