From 82da7ada9a7e7a9891b5648b1a77210c99a66a50 Mon Sep 17 00:00:00 2001 From: Haled Odat <8566042+HalidOdat@users.noreply.github.com> Date: Fri, 22 Sep 2023 14:44:07 +0200 Subject: [PATCH] Inject realm before crossing the function boundry --- boa_engine/src/vm/mod.rs | 3 +++ 1 file changed, 3 insertions(+) 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() {