Assign Promise.resolve to constant
This commit is contained in:
parent
e0260d6f53
commit
dbe9893d29
2 changed files with 4 additions and 4 deletions
|
@ -3,6 +3,7 @@
|
|||
const events = require('events')
|
||||
const path = require('path')
|
||||
const Module = require('module')
|
||||
const resolvePromise = Promise.resolve.bind(Promise)
|
||||
|
||||
// We modified the original process.argv to let node.js load the
|
||||
// atom-renderer.js, we need to restore it here.
|
||||
|
@ -39,7 +40,7 @@ electron.ipcRenderer.on('ELECTRON_INTERNAL_RENDERER_SYNC_WEB_FRAME_METHOD', (eve
|
|||
|
||||
electron.ipcRenderer.on('ELECTRON_INTERNAL_RENDERER_ASYNC_WEB_FRAME_METHOD', (event, requestId, method, args) => {
|
||||
const responseCallback = function (result) {
|
||||
Promise.resolve(result)
|
||||
resolvePromise(result)
|
||||
.then((resolvedResult) => {
|
||||
event.sender.send(`ELECTRON_INTERNAL_BROWSER_ASYNC_WEB_FRAME_RESPONSE_${requestId}`, null, resolvedResult)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue