diff options
Diffstat (limited to 'ext/websocket/02_websocketstream.js')
-rw-r--r-- | ext/websocket/02_websocketstream.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ext/websocket/02_websocketstream.js b/ext/websocket/02_websocketstream.js index f7c4d4d0f..82f306333 100644 --- a/ext/websocket/02_websocketstream.js +++ b/ext/websocket/02_websocketstream.js @@ -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; |