diff options
author | 2023-09-07 18:09:49 -0400 | |
---|---|---|
committer | 2023-09-07 18:09:49 -0400 | |
commit | a5a4d51788bcfcbfb21bdfb6dbff54c1aea3325d (patch) | |
tree | ddf794e4050047a7b9f6fae957922dc7faeda3dd | |
parent | 7ff05309255b9d8c0554531844c8b02155672367 (diff) | |
download | bun-a5a4d51788bcfcbfb21bdfb6dbff54c1aea3325d.tar.gz bun-a5a4d51788bcfcbfb21bdfb6dbff54c1aea3325d.tar.zst bun-a5a4d51788bcfcbfb21bdfb6dbff54c1aea3325d.zip |
revert fn abortListener
-rw-r--r-- | src/bun.js/webcore/response.zig | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/src/bun.js/webcore/response.zig b/src/bun.js/webcore/response.zig index c9dcb668f..52a02fa70 100644 --- a/src/bun.js/webcore/response.zig +++ b/src/bun.js/webcore/response.zig @@ -1392,60 +1392,6 @@ pub const Fetch = struct { if (this.http != null) { HTTPClient.http_thread.scheduleShutdown(this.http.?); } - - var ref = this.promise; - - const promise_value = ref.valueOrEmpty(); - - defer ref.strong.deinit(); - - if (this.signal) |signal| { - this.signal = null; - signal.detach(this); - } - err.ensureStillAlive(); - - if (promise_value.isEmptyOrUndefinedOrNull()) { - log("abortListener no promise", .{}); - if (this.readable_stream_ref.get()) |readable| { - readable.ptr.Bytes.onData( - .{ - .err = .{ .JSValue = err }, - }, - bun.default_allocator, - ); - return; - } - if (this.response.get()) |response_js| { - if (response_js.as(Response)) |response| { - const body = response.body; - if (body.value == .Locked) { - if (body.value.Locked.readable) |readable| { - readable.ptr.Bytes.onData( - .{ - .err = .{ .JSValue = err }, - }, - bun.default_allocator, - ); - return; - } - } - - response.body.value.toErrorInstance(err, globalThis); - return; - } - } - - globalThis.throwValue(err); - return; - } - - log("abortListener with promise", .{}); - - promise_value.ensureStillAlive(); - const promise = promise_value.asAnyPromise() orelse return; - - promise.reject(globalThis, err); } const FetchOptions = struct { |