From 42f23f0966e1e1d33fbe33bf6c4b98e477105119 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Wed, 18 Dec 2024 19:42:33 -0800 Subject: [PATCH] PR feedback from #15865 --- src/bun.js/bindings/NodeVM.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bun.js/bindings/NodeVM.cpp b/src/bun.js/bindings/NodeVM.cpp index 336f88e09c1adf..57b76bdd8461f8 100644 --- a/src/bun.js/bindings/NodeVM.cpp +++ b/src/bun.js/bindings/NodeVM.cpp @@ -200,7 +200,6 @@ bool NodeVMGlobalObject::put(JSCell* cell, JSGlobalObject* globalObject, Propert } RETURN_IF_EXCEPTION(scope, false); - slot.setThisValue(sandbox); if (isDeclaredOnSandbox && getter.isAccessor() and (getter.attributes() & PropertyAttribute::DontEnum) == 0) { return true; } @@ -553,8 +552,10 @@ JSC_DEFINE_HOST_FUNCTION(vmModuleRunInNewContext, (JSGlobalObject * globalObject NakedPtr exception; JSValue result = JSC::evaluate(context, sourceCode, context, exception); - if (exception) + if (exception) { throwException(globalObject, scope, exception); + return {}; + } return JSValue::encode(result); }