summaryrefslogtreecommitdiff
path: root/ext/websocket/01_websocket.js
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-10-05 03:13:58 +0530
committerGitHub <noreply@github.com>2023-10-04 21:43:58 +0000
commit1a81b2826d7e0f64831c7a96d3cfb113ea6e7eb7 (patch)
tree020c6005a7d9b1634eaf72f7e8f921f59fd949ff /ext/websocket/01_websocket.js
parentcbddf5756e07fbbe10bd35d23bb9e9c0c685442a (diff)
refactor: rewrite websocket to use op2 macro (#20140)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'ext/websocket/01_websocket.js')
-rw-r--r--ext/websocket/01_websocket.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/ext/websocket/01_websocket.js b/ext/websocket/01_websocket.js
index 5f0f648a7..3417eff67 100644
--- a/ext/websocket/01_websocket.js
+++ b/ext/websocket/01_websocket.js
@@ -26,7 +26,6 @@ const {
ArrayPrototypeJoin,
ArrayPrototypeMap,
ArrayPrototypeSome,
- DataView,
ErrorPrototypeToString,
ObjectDefineProperties,
ObjectPrototypeIsPrototypeOf,
@@ -50,6 +49,7 @@ const {
op_ws_create,
op_ws_close,
op_ws_send_binary,
+ op_ws_send_binary_ab,
op_ws_send_text,
op_ws_next_event,
op_ws_get_buffer,
@@ -336,11 +336,7 @@ class WebSocket extends EventTarget {
PromisePrototypeThen(
// deno-lint-ignore prefer-primordials
data.slice().arrayBuffer(),
- (ab) =>
- op_ws_send_binary(
- this[_rid],
- new DataView(ab),
- ),
+ (ab) => op_ws_send_binary_ab(this[_rid], ab),
);
} else {
const string = String(data);