#[repr(C)]pub struct BlockStatement<'gc> {
pub metadata: NodeMetadata<'gc>,
pub body: NodeList<'gc>,
pub implicit: Cell<bool>,
pub scope: Cell<Option<SemaId>>,
pub buffer_id: Cell<u32>,
pub is_lazy_function_body: Cell<bool>,
pub param_yield: Cell<bool>,
pub param_await: Cell<bool>,
pub contains_arrow_functions: Cell<bool>,
pub may_contain_arrow_functions_using_arguments: Cell<bool>,
}Expand description
The BlockStatement AST node.
Fields§
§metadata: NodeMetadata<'gc>Source range, debug location, paren count, and node id.
body: NodeList<'gc>ESTree body property.
implicit: Cell<bool>ESTree implicit property.
scope: Cell<Option<SemaId>>Sema: the lexical scope created by this node, if any.
buffer_id: Cell<u32>The source buffer id in which this block was found.
is_lazy_function_body: Cell<bool>True if this is a function body pruned while pre-parsing.
param_yield: Cell<bool>For a lazy block, the Yield param to restore when parsed eagerly.
param_await: Cell<bool>For a lazy block, the Await param to restore when parsed eagerly.
contains_arrow_functions: Cell<bool>Whether this function contains an arrow function. Read by lazy
compilation to populate the FunctionInfo.
may_contain_arrow_functions_using_arguments: Cell<bool>Conservative estimate of whether an arrow function here may use
arguments, so a non-arrow function must eagerly capture it.
Implementations§
Source§impl<'gc> BlockStatement<'gc>
impl<'gc> BlockStatement<'gc>
Sourcepub fn new(
metadata: NodeMetadata<'gc>,
body: NodeList<'gc>,
implicit: bool,
) -> Self
pub fn new( metadata: NodeMetadata<'gc>, body: NodeList<'gc>, implicit: bool, ) -> Self
Build BlockStatement from its metadata and ESTree.def fields.
Decoration fields start at their defaults.