diff options
author | 2023-07-01 13:30:33 -0700 | |
---|---|---|
committer | 2023-07-01 13:30:33 -0700 | |
commit | 583ec55d1d35254e034bb8403b9a7d9a2fd76781 (patch) | |
tree | ce65df8b334308f5058c960f2c9fc024e4aa2d75 /src/bun.js/webcore/blob.zig | |
parent | 58c0e16b7af71309c8b36cefd68bf349d809a189 (diff) | |
download | bun-jarred/strong.tar.gz bun-jarred/strong.tar.zst bun-jarred/strong.zip |
💪jarred/strong
Diffstat (limited to 'src/bun.js/webcore/blob.zig')
-rw-r--r-- | src/bun.js/webcore/blob.zig | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/bun.js/webcore/blob.zig b/src/bun.js/webcore/blob.zig index faf503a3f..407a55fe4 100644 --- a/src/bun.js/webcore/blob.zig +++ b/src/bun.js/webcore/blob.zig @@ -436,11 +436,11 @@ pub const Blob = struct { var globalThis = this.globalThis; var file_blob = this.file_blob; switch (value.*) { - .Error => |err| { + .Error => |*err| { file_blob.detach(); _ = value.use(); bun.default_allocator.destroy(this); - promise.reject(globalThis, err); + promise.reject(globalThis, err.swap()); }, .Used => { file_blob.detach(); @@ -701,8 +701,7 @@ pub const Blob = struct { }, .Error => { destination_blob.detach(); - const err = response.body.value.Error; - JSC.C.JSValueUnprotect(ctx, err.asObjectRef()); + const err = response.body.value.Error.swap(); _ = response.body.value.use(); return JSC.JSPromise.rejectedPromiseValue(ctx.ptr(), err).asObjectRef(); }, @@ -736,8 +735,7 @@ pub const Blob = struct { }, .Error => { destination_blob.detach(); - const err = request.body.value.Error; - JSC.C.JSValueUnprotect(ctx, err.asObjectRef()); + const err = request.body.value.Error.swap(); _ = request.body.value.use(); return JSC.JSPromise.rejectedPromiseValue(ctx.ptr(), err).asObjectRef(); }, |