From d3b15661812a5655a1fd6ea1e20d4630a0d65f62 Mon Sep 17 00:00:00 2001 From: Jeremy Rose Date: Mon, 7 Dec 2020 09:19:26 -0800 Subject: [PATCH] chore: remove unused _replyInternal method (#26825) --- lib/browser/api/web-contents.ts | 12 ------------ typings/internal-electron.d.ts | 1 - 2 files changed, 13 deletions(-) diff --git a/lib/browser/api/web-contents.ts b/lib/browser/api/web-contents.ts index ce5e5a5f10ab..344e27169332 100644 --- a/lib/browser/api/web-contents.ts +++ b/lib/browser/api/web-contents.ts @@ -461,16 +461,6 @@ const addReplyToEvent = (event: any) => { }; }; -const addReplyInternalToEvent = (event: any) => { - Object.defineProperty(event, '_replyInternal', { - configurable: false, - enumerable: false, - value: (...args: any[]) => { - event.sender._sendToFrameInternal(event.frameId, ...args); - } - }); -}; - const addReturnValueToEvent = (event: any) => { Object.defineProperty(event, 'returnValue', { set: (value) => event.sendReply(value), @@ -515,7 +505,6 @@ WebContents.prototype._init = function () { // Dispatch IPC messages to the ipc module. this.on('-ipc-message' as any, function (this: Electron.WebContents, event: any, internal: boolean, channel: string, args: any[]) { if (internal) { - addReplyInternalToEvent(event); ipcMainInternal.emit(channel, event, ...args); } else { addReplyToEvent(event); @@ -541,7 +530,6 @@ WebContents.prototype._init = function () { this.on('-ipc-message-sync' as any, function (this: Electron.WebContents, event: any, internal: boolean, channel: string, args: any[]) { addReturnValueToEvent(event); if (internal) { - addReplyInternalToEvent(event); ipcMainInternal.emit(channel, event, ...args); } else { addReplyToEvent(event); diff --git a/typings/internal-electron.d.ts b/typings/internal-electron.d.ts index 86dad40ee623..94b36dd9931a 100644 --- a/typings/internal-electron.d.ts +++ b/typings/internal-electron.d.ts @@ -237,7 +237,6 @@ declare namespace ElectronInternal { // Internal IPC has _replyInternal and NO reply method interface IpcMainInternalEvent extends Omit { - _replyInternal(...args: any[]): void; } interface IpcMainInternal extends NodeJS.EventEmitter {