🎨 Support non-native promises
This commit is contained in:
parent
4cd0de0e87
commit
32073fa079
5 changed files with 24 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const {ipcRenderer, CallbacksRegistry} = require('electron')
|
||||
const {ipcRenderer, isPromise, CallbacksRegistry} = require('electron')
|
||||
|
||||
const callbacksRegistry = new CallbacksRegistry()
|
||||
|
||||
|
@ -44,7 +44,7 @@ var wrapArgs = function (args, visited) {
|
|||
value: value.getTime()
|
||||
}
|
||||
} else if ((value != null) && typeof value === 'object') {
|
||||
if (value.constructor != null && value.constructor.name === 'Promise') {
|
||||
if (isPromise(value)) {
|
||||
return {
|
||||
type: 'promise',
|
||||
then: valueToMeta(function (onFulfilled, onRejected) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue