chore: remove unused _replyInternal method (#26825)
This commit is contained in:
parent
5a5d964720
commit
d3b1566181
2 changed files with 0 additions and 13 deletions
|
@ -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);
|
||||||
|
|
1
typings/internal-electron.d.ts
vendored
1
typings/internal-electron.d.ts
vendored
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue