Skip to content

Commit

Permalink
reintroduce missing function
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-finch-tezos committed Nov 2, 2023
1 parent 01ae4c4 commit 3bb946d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions boa_engine/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,17 @@ impl<'host> Context<'host> {
std::mem::replace(&mut self.realm, realm)
}

/// Create a new Realm with the default global bindings.
pub fn create_realm(&mut self) -> JsResult<Realm> {
let realm = Realm::create(&*self.host_hooks, &self.root_shape);

let old_realm = self.enter_realm(realm);

builtins::set_default_global_bindings(self)?;

Ok(self.enter_realm(old_realm))
}

/// Get the remaining instruction count
#[cfg(freature = "fuzz")]
#[inline]
Expand Down

0 comments on commit 3bb946d

Please sign in to comment.