summaryrefslogtreecommitdiff
path: root/op_crates/fetch/26_fetch.js
diff options
context:
space:
mode:
Diffstat (limited to 'op_crates/fetch/26_fetch.js')
-rw-r--r--op_crates/fetch/26_fetch.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/op_crates/fetch/26_fetch.js b/op_crates/fetch/26_fetch.js
index d4b2680ec..0fd825e16 100644
--- a/op_crates/fetch/26_fetch.js
+++ b/op_crates/fetch/26_fetch.js
@@ -884,29 +884,29 @@
if (body != null) {
zeroCopy = new Uint8Array(body.buffer, body.byteOffset, body.byteLength);
}
- return core.jsonOpSync("op_fetch", args, ...(zeroCopy ? [zeroCopy] : []));
+ return core.jsonOpSync("op_fetch", args, zeroCopy);
}
/**
- * @param {{rid: number}} args
+ * @param {number} rid
* @returns {Promise<{status: number, statusText: string, headers: Record<string,string[]>, url: string, responseRid: number}>}
*/
- function opFetchSend(args) {
- return core.jsonOpAsync("op_fetch_send", args);
+ function opFetchSend(rid) {
+ return core.jsonOpAsync("op_fetch_send", rid);
}
/**
- * @param {{rid: number}} args
+ * @param {number} rid
* @param {Uint8Array} body
* @returns {Promise<void>}
*/
- function opFetchRequestWrite(args, body) {
+ function opFetchRequestWrite(rid, body) {
const zeroCopy = new Uint8Array(
body.buffer,
body.byteOffset,
body.byteLength,
);
- return core.jsonOpAsync("op_fetch_request_write", args, zeroCopy);
+ return core.jsonOpAsync("op_fetch_request_write", rid, zeroCopy);
}
const NULL_BODY_STATUS = [101, 204, 205, 304];
@@ -1276,7 +1276,7 @@
*/
async write(chunk, controller) {
try {
- await opFetchRequestWrite({ rid: requestBodyRid }, chunk);
+ await opFetchRequestWrite(requestBodyRid, chunk);
} catch (err) {
controller.error(err);
}
@@ -1288,7 +1288,7 @@
body.pipeTo(writer);
}
- return await opFetchSend({ rid: requestRid });
+ return await opFetchSend(requestRid);
}
/**
@@ -1400,9 +1400,9 @@
async pull(controller) {
try {
const chunk = new Uint8Array(16 * 1024 + 256);
- const { read } = await core.jsonOpAsync(
+ const read = await core.jsonOpAsync(
"op_fetch_response_read",
- { rid },
+ rid,
chunk,
);
if (read != 0) {