boa_engine 0.21.1

Boa is a Javascript lexer, parser and compiler written in Rust. Currently, it has support for some of the language.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::bytecompiler::ByteCompiler;
use boa_ast::statement::Block;

impl ByteCompiler<'_> {
    /// Compile a [`Block`] `boa_ast` node
    pub(crate) fn compile_block(&mut self, block: &Block, use_expr: bool) {
        let scope = self.push_declarative_scope(block.scope());
        self.block_declaration_instantiation(block);
        self.compile_statement_list(block.statement_list(), use_expr, true);
        self.pop_declarative_scope(scope);
    }
}