diff --git a/boa_engine/src/vm/mod.rs b/boa_engine/src/vm/mod.rs index 373dc9e6986..aa40c57e09a 100644 --- a/boa_engine/src/vm/mod.rs +++ b/boa_engine/src/vm/mod.rs @@ -446,6 +446,9 @@ impl Context<'_> { return CompletionRecord::Throw(err); } + // Inject realm before crossing the function boundry + let err = err.inject_realm(self.realm().clone()); + self.vm.pop_frame(); while let Some(frame) = self.vm.frames.last_mut() {