Skip to content

Commit

Permalink
Fixed compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Razican authored and jedel1043 committed Feb 1, 2023
1 parent 781a259 commit 92c1c41
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions boa_engine/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl Context<'_> {
ContextBuilder::default()
}

/// Evaluates the given script `Source` by compiling down to bytecode, then interpreting the
/// Evaluates the given script `src` by compiling down to bytecode, then interpreting the
/// bytecode into a value.
///
/// # Examples
Expand Down Expand Up @@ -184,7 +184,7 @@ impl Context<'_> {
result
}

/// Evaluates the given ECMAScript module by compiling down to bytecode, then interpreting the
/// Evaluates the given module `src` by compiling down to bytecode, then interpreting the
/// bytecode into a value.
///
/// # Examples
Expand Down Expand Up @@ -235,7 +235,7 @@ impl Context<'_> {
parser.parse_module(&mut self.interner)
}

/// Compile the AST into a `CodeBlock` ready to be executed by the VM.
/// Compile the script AST into a `CodeBlock` ready to be executed by the VM.
pub fn compile_script(&mut self, statement_list: &StatementList) -> JsResult<Gc<CodeBlock>> {
let _timer = Profiler::global().start_event("Script compilation", "Main");
let mut compiler = ByteCompiler::new(Sym::MAIN, statement_list.strict(), false, self);
Expand All @@ -247,6 +247,7 @@ impl Context<'_> {
/// Compile the module AST into a `CodeBlock` ready to be executed by the VM.
pub fn compile_module(&mut self, statement_list: &ModuleItemList) -> JsResult<Gc<CodeBlock>> {
let _timer = Profiler::global().start_event("Module compilation", "Main");

let mut compiler = ByteCompiler::new(Sym::MAIN, true, false, self);
compiler.create_module_decls(statement_list, false);
compiler.compile_module_item_list(statement_list, false)?;
Expand Down

0 comments on commit 92c1c41

Please sign in to comment.