summaryrefslogtreecommitdiff
path: root/ext/websocket/02_websocketstream.js
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-04-04 15:19:50 +0530
committerGitHub <noreply@github.com>2022-04-04 15:19:50 +0530
commit995d1666ffe44c5f8694f9ef43390ca3ab64bb26 (patch)
tree2cd8eb89c6eb9f631e1eac01472183ea1483aaa8 /ext/websocket/02_websocketstream.js
parentcc49b5e0d80f0c27e90af6ae520a0fec59e577c6 (diff)
chore(ext/websocket): custom arity (#14202)
Diffstat (limited to 'ext/websocket/02_websocketstream.js')
-rw-r--r--ext/websocket/02_websocketstream.js23
1 files changed, 9 insertions, 14 deletions
diff --git a/ext/websocket/02_websocketstream.js b/ext/websocket/02_websocketstream.js
index d41dcceef..50dfac284 100644
--- a/ext/websocket/02_websocketstream.js
+++ b/ext/websocket/02_websocketstream.js
@@ -145,21 +145,20 @@
};
options.signal?.[add](abort);
PromisePrototypeThen(
- core.opAsync("op_ws_create", {
- url: this[_url],
- protocols: options.protocols
+ core.opAsync(
+ "op_ws_create",
+ this[_url],
+ options.protocols
? ArrayPrototypeJoin(options.protocols, ", ")
: "",
- cancelHandle: cancelRid,
- headers: headerListFromHeaders(headers),
- }),
+ cancelRid,
+ headerListFromHeaders(headers),
+ ),
(create) => {
options.signal?.[remove](abort);
if (this[_earlyClose]) {
PromisePrototypeThen(
- core.opAsync("op_ws_close", {
- rid: create.rid,
- }),
+ core.opAsync("op_ws_close", create.rid),
() => {
PromisePrototypeThen(
(async () => {
@@ -369,11 +368,7 @@
this[_earlyClose] = true;
} else if (this[_closed].state === "pending") {
PromisePrototypeCatch(
- core.opAsync("op_ws_close", {
- rid: this[_rid],
- code,
- reason: closeInfo.reason,
- }),
+ core.opAsync("op_ws_close", this[_rid], code, closeInfo.reason),
(err) => {
this[_rid] && core.tryClose(this[_rid]);
this[_closed].reject(err);