mirror of
https://github.com/denoland/deno.git
synced 2025-10-01 22:51:14 +00:00
refactor: remove dispatch_json.js from cli/rt and cli/tsc (#7521)
Instead use Deno.core.jsonOpSync and Deno.core.jsonOpAsync
This commit is contained in:
parent
104aebdfb5
commit
6c4da0e429
31 changed files with 177 additions and 373 deletions
|
@ -1,12 +1,12 @@
|
|||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
((window) => {
|
||||
const core = window.Deno.core;
|
||||
const { notImplemented } = window.__bootstrap.util;
|
||||
const { getHeaderValueParams, isTypedArray } = window.__bootstrap.webUtil;
|
||||
const { Blob, bytesSymbol: blobBytesSymbol } = window.__bootstrap.blob;
|
||||
const { read } = window.__bootstrap.io;
|
||||
const { close } = window.__bootstrap.resources;
|
||||
const { sendSync, sendAsync } = window.__bootstrap.dispatchJson;
|
||||
const Body = window.__bootstrap.body;
|
||||
const { ReadableStream } = window.__bootstrap.streams;
|
||||
const { MultipartBuilder } = window.__bootstrap.multipart;
|
||||
|
@ -17,7 +17,7 @@
|
|||
}
|
||||
|
||||
function opCreateHttpClient(args) {
|
||||
return sendSync("op_create_http_client", args);
|
||||
return core.jsonOpSync("op_create_http_client", args);
|
||||
}
|
||||
|
||||
class HttpClient {
|
||||
|
@ -35,7 +35,7 @@
|
|||
zeroCopy = new Uint8Array(body.buffer, body.byteOffset, body.byteLength);
|
||||
}
|
||||
|
||||
return sendAsync("op_fetch", args, ...(zeroCopy ? [zeroCopy] : []));
|
||||
return core.jsonOpAsync("op_fetch", args, ...(zeroCopy ? [zeroCopy] : []));
|
||||
}
|
||||
|
||||
const NULL_BODY_STATUS = [101, 204, 205, 304];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue