fix worker.test.ts

This commit is contained in:
Meghan Denny
2025-09-23 00:05:54 -07:00
parent 0c0dc471da
commit 9effd4df31
3 changed files with 6 additions and 3 deletions

View File

@@ -596,9 +596,8 @@ pub const JSGlobalObject = opaque {
return @as(*jsc.VirtualMachine, @ptrCast(@alignCast(this.bunVMUnsafe())));
}
extern fn JSC__JSGlobalObject__handleRejectedPromises(*JSGlobalObject) void;
pub fn handleRejectedPromises(this: *JSGlobalObject) void {
return bun.jsc.fromJSHostCallGeneric(this, @src(), JSC__JSGlobalObject__handleRejectedPromises, .{this}) catch @panic("unreachable");
return bun.cpp.JSC__JSGlobalObject__handleRejectedPromises(this);
}
extern fn ZigGlobalObject__readableStreamToArrayBuffer(*JSGlobalObject, JSValue) JSValue;

View File

@@ -4059,7 +4059,10 @@ void GlobalObject::handleRejectedPromises()
continue;
Bun__handleRejectedPromise(this, promise);
if (auto ex = scope.exception()) this->reportUncaughtExceptionAtEventLoop(this, ex);
if (auto ex = scope.exception()) {
scope.clearException();
this->reportUncaughtExceptionAtEventLoop(this, ex);
}
}
}

View File

@@ -3649,6 +3649,7 @@ JSC::EncodedJSValue JSC__JSGlobalObject__generateHeapSnapshot(JSC::JSGlobalObjec
JSC::VM* JSC__JSGlobalObject__vm(JSC::JSGlobalObject* arg0) { return &arg0->vm(); };
[[ZIG_EXPORT(nothrow)]]
void JSC__JSGlobalObject__handleRejectedPromises(JSC::JSGlobalObject* arg0)
{
return jsCast<Zig::GlobalObject*>(arg0)->handleRejectedPromises();