diff options
Diffstat (limited to 'src/bun.js/bindings/ZigGlobalObject.cpp')
-rw-r--r-- | src/bun.js/bindings/ZigGlobalObject.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index d3bd623dd..5aee64451 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -3498,15 +3498,18 @@ EncodedJSValue GlobalObject::assignToStream(JSValue stream, JSValue controller) this->m_assignToStream.set(vm, this, function); } - auto scope = DECLARE_CATCH_SCOPE(vm); auto callData = JSC::getCallData(function); JSC::MarkedArgumentBuffer arguments; arguments.append(stream); arguments.append(controller); - auto result = call(this, function, callData, JSC::jsUndefined(), arguments); - if (scope.exception()) - return JSC::JSValue::encode(scope.exception()); + WTF::NakedPtr<JSC::Exception> returnedException = nullptr; + + auto result = JSC::profiledCall(this, ProfilingReason::API, function, callData, JSC::jsUndefined(), arguments, returnedException); + if (returnedException.get()) { + auto* exception = WTFMove(returnedException.get()); + return JSC::JSValue::encode(exception); + } return JSC::JSValue::encode(result); } |