summaryrefslogtreecommitdiff
path: root/ext/websocket/01_websocket.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/01_websocket.js
parentcc49b5e0d80f0c27e90af6ae520a0fec59e577c6 (diff)
chore(ext/websocket): custom arity (#14202)
Diffstat (limited to 'ext/websocket/01_websocket.js')
-rw-r--r--ext/websocket/01_websocket.js25
1 files changed, 8 insertions, 17 deletions
diff --git a/ext/websocket/01_websocket.js b/ext/websocket/01_websocket.js
index 2c6337eef..19c5e2875 100644
--- a/ext/websocket/01_websocket.js
+++ b/ext/websocket/01_websocket.js
@@ -223,10 +223,11 @@
}
PromisePrototypeThen(
- core.opAsync("op_ws_create", {
- url: wsURL.href,
- protocols: ArrayPrototypeJoin(protocols, ", "),
- }),
+ core.opAsync(
+ "op_ws_create",
+ wsURL.href,
+ ArrayPrototypeJoin(protocols, ", "),
+ ),
(create) => {
this[_rid] = create.rid;
this[_extensions] = create.extensions;
@@ -234,9 +235,7 @@
if (this[_readyState] === CLOSING) {
PromisePrototypeThen(
- core.opAsync("op_ws_close", {
- rid: this[_rid],
- }),
+ core.opAsync("op_ws_close", this[_rid]),
() => {
this[_readyState] = CLOSED;
@@ -369,11 +368,7 @@
this[_readyState] = CLOSING;
PromisePrototypeThen(
- core.opAsync("op_ws_close", {
- rid: this[_rid],
- code,
- reason,
- }),
+ core.opAsync("op_ws_close", this[_rid], code, reason),
() => {
this[_readyState] = CLOSED;
const event = new CloseEvent("close", {
@@ -473,11 +468,7 @@
this[_idleTimeoutTimeout] = setTimeout(async () => {
this[_readyState] = CLOSING;
const reason = "No response from ping frame.";
- await core.opAsync("op_ws_close", {
- rid: this[_rid],
- code: 1001,
- reason,
- });
+ await core.opAsync("op_ws_close", this[_rid], 1001, reason);
this[_readyState] = CLOSED;
const errEvent = new ErrorEvent("error", {