From f673d038446f9aef3c634883df8ebb3a453ddeb3 Mon Sep 17 00:00:00 2001 From: Haled Odat <8566042+HalidOdat@users.noreply.github.com> Date: Tue, 25 Jul 2023 17:39:43 +0200 Subject: [PATCH] Fix typo --- boa_engine/src/bytecompiler/jump_control.rs | 6 +++--- boa_engine/src/module/source.rs | 2 -- boa_engine/src/script.rs | 2 -- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/boa_engine/src/bytecompiler/jump_control.rs b/boa_engine/src/bytecompiler/jump_control.rs index e64da76a6b8..d531eab6ec6 100644 --- a/boa_engine/src/bytecompiler/jump_control.rs +++ b/boa_engine/src/bytecompiler/jump_control.rs @@ -21,7 +21,7 @@ use boa_interner::Sym; pub(crate) enum JumpRecordAction { /// Places a [`Opcode::Jump`], transfers to a specified [`JumpControlInfo`] to be handled when it gets poped. Transfer { - /// [`JumpControlInfo`] index to be transfered. + /// [`JumpControlInfo`] index to be transferred. index: u32, }, @@ -31,7 +31,7 @@ pub(crate) enum JumpRecordAction { /// Closes the an iterator. CloseIterator { r#async: bool }, - /// Handles finally which needs to be done if we are in the try or catch section of a try statement that + /// Handles finally, this needs to be done if we are in the try or catch section of a try statement that /// has a finally block. /// /// It places push integer value [`Opcode`] as well as [`Opcode::PushFalse`], which means don't [`ReThrow`](Opcode::ReThrow). @@ -53,7 +53,7 @@ pub(crate) enum JumpRecordAction { /// ``` /// /// Both `continue` and `break` must go through the finally, but the `continue` goes to the beginning of the loop, - /// but the `break` goes to the end of the loop, this is solved by having a jump table (See [`Opcode::JumpTable`]) + /// and the `break` goes to the end of the loop, this is solved by having a jump table (See [`Opcode::JumpTable`]) /// at the end of finally (It is constructed in [`ByteCompiler::pop_try_with_finally_control_info()`]). HandleFinally { /// Jump table index. diff --git a/boa_engine/src/module/source.rs b/boa_engine/src/module/source.rs index 4bda801c8d3..f079b15ded1 100644 --- a/boa_engine/src/module/source.rs +++ b/boa_engine/src/module/source.rs @@ -1743,7 +1743,6 @@ impl SourceTextModule { // 6. Set the VariableEnvironment of moduleContext to module.[[Environment]]. // 7. Set the LexicalEnvironment of moduleContext to module.[[Environment]]. std::mem::swap(&mut context.vm.environments, &mut environments); - let stack = std::mem::take(&mut context.vm.stack); // 2. Set the Function of moduleContext to null. let function = context.vm.active_function.take(); // 3. Set the Realm of moduleContext to module.[[Realm]]. @@ -1763,7 +1762,6 @@ impl SourceTextModule { let result = context.run(); std::mem::swap(&mut context.vm.environments, &mut environments); - context.vm.stack = stack; context.vm.active_function = function; context.vm.active_runnable = active_runnable; context.swap_realm(&mut realm); diff --git a/boa_engine/src/script.rs b/boa_engine/src/script.rs index 07d73da2a92..b8a19b69a3f 100644 --- a/boa_engine/src/script.rs +++ b/boa_engine/src/script.rs @@ -138,7 +138,6 @@ impl Script { let old_realm = context.enter_realm(self.inner.realm.clone()); let active_function = context.vm.active_function.take(); - let stack = std::mem::take(&mut context.vm.stack); let old_active = context .vm .active_runnable @@ -154,7 +153,6 @@ impl Script { let record = context.run(); context.vm.pop_frame(); - context.vm.stack = stack; context.vm.active_function = active_function; context.vm.active_runnable = old_active; context.enter_realm(old_realm);