From 6dcd4621bd41fd3367b52a9d3d9cdd2d36f209fb Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Mon, 12 May 2025 22:44:58 +0100 Subject: [PATCH] src: remove unused `checkMessagePort` internal binding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/58267 Reviewed-By: Yagiz Nizipli Reviewed-By: Luigi Pinca Reviewed-By: Darshan Sen Reviewed-By: James M Snell Reviewed-By: Ulises Gascón Reviewed-By: Chengzhong Wu --- src/node_messaging.cc | 9 --------- src/node_messaging.h | 1 - typings/internalBinding/messaging.d.ts | 1 - 3 files changed, 11 deletions(-) diff --git a/src/node_messaging.cc b/src/node_messaging.cc index 30987ca04be..60e7066a46b 100644 --- a/src/node_messaging.cc +++ b/src/node_messaging.cc @@ -1141,13 +1141,6 @@ void MessagePort::Stop(const FunctionCallbackInfo& args) { port->Stop(); } -void MessagePort::CheckType(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args); - args.GetReturnValue().Set( - GetMessagePortConstructorTemplate(env->isolate_data()) - ->HasInstance(args[0])); -} - void MessagePort::Drain(const FunctionCallbackInfo& args) { MessagePort* port; ASSIGN_OR_RETURN_UNWRAP(&port, args[0].As()); @@ -1731,7 +1724,6 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data, // These are not methods on the MessagePort prototype, because // the browser equivalents do not provide them. SetMethod(isolate, target, "stopMessagePort", MessagePort::Stop); - SetMethod(isolate, target, "checkMessagePort", MessagePort::CheckType); SetMethod(isolate, target, "drainMessagePort", MessagePort::Drain); SetMethod( isolate, target, "receiveMessageOnPort", MessagePort::ReceiveMessage); @@ -1767,7 +1759,6 @@ static void RegisterExternalReferences(ExternalReferenceRegistry* registry) { registry->Register(MessagePort::PostMessage); registry->Register(MessagePort::Start); registry->Register(MessagePort::Stop); - registry->Register(MessagePort::CheckType); registry->Register(MessagePort::Drain); registry->Register(MessagePort::ReceiveMessage); registry->Register(MessagePort::MoveToContext); diff --git a/src/node_messaging.h b/src/node_messaging.h index 169ff0ba19e..3a838a39200 100644 --- a/src/node_messaging.h +++ b/src/node_messaging.h @@ -261,7 +261,6 @@ class MessagePort : public HandleWrap { static void PostMessage(const v8::FunctionCallbackInfo& args); static void Start(const v8::FunctionCallbackInfo& args); static void Stop(const v8::FunctionCallbackInfo& args); - static void CheckType(const v8::FunctionCallbackInfo& args); static void Drain(const v8::FunctionCallbackInfo& args); static void ReceiveMessage(const v8::FunctionCallbackInfo& args); diff --git a/typings/internalBinding/messaging.d.ts b/typings/internalBinding/messaging.d.ts index 93a1a050887..efcc67f0557 100644 --- a/typings/internalBinding/messaging.d.ts +++ b/typings/internalBinding/messaging.d.ts @@ -23,7 +23,6 @@ export interface MessagingBinding { MessagePort: typeof InternalMessagingBinding.MessagePort; JSTransferable: typeof InternalMessagingBinding.JSTransferable; stopMessagePort(port: typeof InternalMessagingBinding.MessagePort): void; - checkMessagePort(port: unknown): boolean; drainMessagePort(port: typeof InternalMessagingBinding.MessagePort): void; receiveMessageOnPort(port: typeof InternalMessagingBinding.MessagePort): any; moveMessagePortToContext(port: typeof InternalMessagingBinding.MessagePort, context: any): typeof InternalMessagingBinding.MessagePort;