chore: fix promisify helper (#16544)
* chore: fix promise deprecation helper * fix deprecations * update deprecation tests
This commit is contained in:
parent
63bf370cc0
commit
5a35c3a279
12 changed files with 65 additions and 48 deletions
|
@ -36,7 +36,7 @@ Object.assign(app, {
|
|||
}
|
||||
})
|
||||
|
||||
app.getFileIcon = deprecate.promisify(app.getFileIcon, 3)
|
||||
app.getFileIcon = deprecate.promisify(app.getFileIcon)
|
||||
|
||||
const nativeAppMetrics = app.getAppMetrics
|
||||
app.getAppMetrics = () => {
|
||||
|
|
|
@ -11,10 +11,10 @@ const fromPartition = (partition) => {
|
|||
if (!session[wrappedSymbol]) {
|
||||
session[wrappedSymbol] = true
|
||||
const { cookies } = session
|
||||
cookies.flushStore = deprecate.promisify(cookies.flushStore, 0)
|
||||
cookies.get = deprecate.promisify(cookies.get, 1)
|
||||
cookies.remove = deprecate.promisify(cookies.remove, 2)
|
||||
cookies.set = deprecate.promisify(cookies.set, 1)
|
||||
cookies.flushStore = deprecate.promisify(cookies.flushStore)
|
||||
cookies.get = deprecate.promisify(cookies.get)
|
||||
cookies.remove = deprecate.promisify(cookies.remove)
|
||||
cookies.set = deprecate.promisify(cookies.set)
|
||||
}
|
||||
return session
|
||||
}
|
||||
|
@ -35,6 +35,6 @@ Object.setPrototypeOf(Session.prototype, EventEmitter.prototype)
|
|||
Object.setPrototypeOf(Cookies.prototype, EventEmitter.prototype)
|
||||
|
||||
Session.prototype._init = function () {
|
||||
this.protocol.isProtocolHandled = deprecate.promisify(this.protocol.isProtocolHandled, 2)
|
||||
this.protocol.isProtocolHandled = deprecate.promisify(this.protocol.isProtocolHandled)
|
||||
app.emit('session-created', this)
|
||||
}
|
||||
|
|
|
@ -374,7 +374,7 @@ WebContents.prototype._init = function () {
|
|||
// render-view-deleted event, so ignore the listeners warning.
|
||||
this.setMaxListeners(0)
|
||||
|
||||
this.capturePage = deprecate.promisify(this.capturePage, 2)
|
||||
this.capturePage = deprecate.promisify(this.capturePage)
|
||||
|
||||
// Dispatch IPC messages to the ipc module.
|
||||
this.on('-ipc-message', function (event, internal, channel, args) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue