Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat committed Jul 25, 2023
1 parent b653639 commit f673d03
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 3 additions & 3 deletions boa_engine/src/bytecompiler/jump_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},

Expand All @@ -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).
Expand All @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions boa_engine/src/module/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]].
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions boa_engine/src/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit f673d03

Please sign in to comment.