1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

chore(ws): remove unused op_ws_send_pong (#22283)

This commit is contained in:
Divy Srivastava 2024-02-06 18:07:20 +05:30 committed by GitHub
parent 428266c06a
commit e568cb8bf8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 1 additions and 21 deletions

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
const EXPECTED_OP_COUNT = 51; const EXPECTED_OP_COUNT = 50;
Deno.test(function checkExposedOps() { Deno.test(function checkExposedOps() {
// @ts-ignore TS doesn't allow to index with symbol // @ts-ignore TS doesn't allow to index with symbol

View file

@ -292,6 +292,5 @@ pub const OP_DETAILS: phf::Map<&'static str, [&'static str; 2]> = phf_map! {
"op_ws_send_binary" => ["send a message on a WebSocket", "closing a `WebSocket` or `WebSocketStream`"], "op_ws_send_binary" => ["send a message on a WebSocket", "closing a `WebSocket` or `WebSocketStream`"],
"op_ws_send_binary_ab" => ["send a message on a WebSocket", "closing a `WebSocket` or `WebSocketStream`"], "op_ws_send_binary_ab" => ["send a message on a WebSocket", "closing a `WebSocket` or `WebSocketStream`"],
"op_ws_send_ping" => ["send a message on a WebSocket", "closing a `WebSocket` or `WebSocketStream`"], "op_ws_send_ping" => ["send a message on a WebSocket", "closing a `WebSocket` or `WebSocketStream`"],
"op_ws_send_pong" => ["send a message on a WebSocket", "closing a `WebSocket` or `WebSocketStream`"],
"op_spawn_wait" => ["wait for a subprocess to exit", "awaiting the result of a `Deno.Process#status` call"], "op_spawn_wait" => ["wait for a subprocess to exit", "awaiting the result of a `Deno.Process#status` call"],
}; };

View file

@ -659,21 +659,6 @@ pub fn op_ws_get_buffered_amount(
.get() as u32 .get() as u32
} }
#[op2(async)]
pub async fn op_ws_send_pong(
state: Rc<RefCell<OpState>>,
#[smi] rid: ResourceId,
) -> Result<(), AnyError> {
let resource = state
.borrow_mut()
.resource_table
.get::<ServerWebSocket>(rid)?;
let lock = resource.reserve_lock();
resource
.write_frame(lock, Frame::pong(EMPTY_PAYLOAD.into()))
.await
}
#[op2(async)] #[op2(async)]
pub async fn op_ws_send_ping( pub async fn op_ws_send_ping(
state: Rc<RefCell<OpState>>, state: Rc<RefCell<OpState>>,
@ -839,7 +824,6 @@ deno_core::extension!(deno_websocket,
op_ws_send_binary_async, op_ws_send_binary_async,
op_ws_send_text_async, op_ws_send_text_async,
op_ws_send_ping, op_ws_send_ping,
op_ws_send_pong,
op_ws_get_buffered_amount, op_ws_get_buffered_amount,
], ],
esm = [ "01_websocket.js", "02_websocketstream.js" ], esm = [ "01_websocket.js", "02_websocketstream.js" ],

View file

@ -614,9 +614,6 @@ const NOT_IMPORTED_OPS = [
"op_format_file_name", "op_format_file_name",
"op_apply_source_map", "op_apply_source_map",
"op_apply_source_map_filename", "op_apply_source_map_filename",
// TODO(bartlomieju): this might be dead code.
"op_ws_send_pong",
]; ];
function removeImportedOps() { function removeImportedOps() {