Skip to content

Commit

Permalink
Refactor environment, exception handling and jumping in VM
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat committed Jun 26, 2023
1 parent 9b25ecf commit b5b2a5a
Show file tree
Hide file tree
Showing 29 changed files with 1,005 additions and 1,138 deletions.
2 changes: 2 additions & 0 deletions boa_engine/src/bytecompiler/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use boa_ast::expression::Identifier;
impl ByteCompiler<'_, '_> {
/// Push either a new declarative or function environment on the compile time environment stack.
pub(crate) fn push_compile_environment(&mut self, function_scope: bool) {
self.current_open_environments_count += 1;
self.current_environment = Rc::new(RefCell::new(CompileTimeEnvironment::new(
self.current_environment.clone(),
function_scope,
Expand All @@ -16,6 +17,7 @@ impl ByteCompiler<'_, '_> {
/// Pops the top compile time environment and returns its index in the compile time environments array.
#[track_caller]
pub(crate) fn pop_compile_environment(&mut self) -> u32 {
self.current_open_environments_count -= 1;
let index = self.compile_environments.len() as u32;
self.compile_environments
.push(self.current_environment.clone());
Expand Down
Loading

0 comments on commit b5b2a5a

Please sign in to comment.