🎨 Support non-native promises
This commit is contained in:
parent
4cd0de0e87
commit
32073fa079
5 changed files with 24 additions and 4 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
const electron = require('electron')
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const {ipcMain} = electron
|
||||
const {ipcMain, isPromise} = electron
|
||||
|
||||
const objectsRegistry = require('./objects-registry')
|
||||
|
||||
|
@ -65,7 +65,7 @@ let valueToMeta = function (sender, value, optimizeSimpleObject = false) {
|
|||
meta.type = 'error'
|
||||
} else if (value instanceof Date) {
|
||||
meta.type = 'date'
|
||||
} else if (value.constructor != null && value.constructor.name === 'Promise') {
|
||||
} else if (isPromise(value)) {
|
||||
meta.type = 'promise'
|
||||
} else if (value.hasOwnProperty('callee') && value.length != null) {
|
||||
// Treat the arguments object as array.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue