chore: remove unused _replyInternal method (#26825)

This commit is contained in:
Jeremy Rose 2020-12-07 09:19:26 -08:00 committed by GitHub
parent 5a5d964720
commit d3b1566181
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 13 deletions

View file

@ -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) => { const addReturnValueToEvent = (event: any) => {
Object.defineProperty(event, 'returnValue', { Object.defineProperty(event, 'returnValue', {
set: (value) => event.sendReply(value), set: (value) => event.sendReply(value),
@ -515,7 +505,6 @@ WebContents.prototype._init = function () {
// Dispatch IPC messages to the ipc module. // 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[]) { this.on('-ipc-message' as any, function (this: Electron.WebContents, event: any, internal: boolean, channel: string, args: any[]) {
if (internal) { if (internal) {
addReplyInternalToEvent(event);
ipcMainInternal.emit(channel, event, ...args); ipcMainInternal.emit(channel, event, ...args);
} else { } else {
addReplyToEvent(event); 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[]) { this.on('-ipc-message-sync' as any, function (this: Electron.WebContents, event: any, internal: boolean, channel: string, args: any[]) {
addReturnValueToEvent(event); addReturnValueToEvent(event);
if (internal) { if (internal) {
addReplyInternalToEvent(event);
ipcMainInternal.emit(channel, event, ...args); ipcMainInternal.emit(channel, event, ...args);
} else { } else {
addReplyToEvent(event); addReplyToEvent(event);

View file

@ -237,7 +237,6 @@ declare namespace ElectronInternal {
// Internal IPC has _replyInternal and NO reply method // Internal IPC has _replyInternal and NO reply method
interface IpcMainInternalEvent extends Omit<Electron.IpcMainEvent, 'reply'> { interface IpcMainInternalEvent extends Omit<Electron.IpcMainEvent, 'reply'> {
_replyInternal(...args: any[]): void;
} }
interface IpcMainInternal extends NodeJS.EventEmitter { interface IpcMainInternal extends NodeJS.EventEmitter {