mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
chore: various op cleanup (#12329)
This commit is contained in:
parent
d67e858506
commit
77a00ce1fb
26 changed files with 131 additions and 185 deletions
|
@ -190,15 +190,14 @@
|
|||
const writable = new WritableStream({
|
||||
write: async (chunk) => {
|
||||
if (typeof chunk === "string") {
|
||||
await core.opAsync("op_ws_send", {
|
||||
rid: this[_rid],
|
||||
await core.opAsync("op_ws_send", this[_rid], {
|
||||
kind: "text",
|
||||
text: chunk,
|
||||
value: chunk,
|
||||
});
|
||||
} else if (chunk instanceof Uint8Array) {
|
||||
await core.opAsync("op_ws_send", {
|
||||
rid: this[_rid],
|
||||
await core.opAsync("op_ws_send", this[_rid], {
|
||||
kind: "binary",
|
||||
value: chunk,
|
||||
}, chunk);
|
||||
} else {
|
||||
throw new TypeError(
|
||||
|
@ -257,8 +256,7 @@
|
|||
break;
|
||||
}
|
||||
case "ping": {
|
||||
await core.opAsync("op_ws_send", {
|
||||
rid: this[_rid],
|
||||
await core.opAsync("op_ws_send", this[_rid], {
|
||||
kind: "pong",
|
||||
});
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue