From 92c1c41785ae1d8cb8617e01a1f9aa24e42160c5 Mon Sep 17 00:00:00 2001 From: Iban Eguia Moraza Date: Sun, 27 Nov 2022 12:46:03 +0100 Subject: [PATCH] Fixed compilation --- boa_engine/src/context/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/boa_engine/src/context/mod.rs b/boa_engine/src/context/mod.rs index 1c58bee68d6..3c03bcf03f2 100644 --- a/boa_engine/src/context/mod.rs +++ b/boa_engine/src/context/mod.rs @@ -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 @@ -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 @@ -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> { let _timer = Profiler::global().start_event("Script compilation", "Main"); let mut compiler = ByteCompiler::new(Sym::MAIN, statement_list.strict(), false, self); @@ -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> { 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)?;