Cleanup the code determining value's type
This commit is contained in:
parent
d3bff7fffc
commit
ff1b7d18f6
2 changed files with 35 additions and 46 deletions
|
@ -45,17 +45,19 @@ var wrapArgs = function (args, visited) {
|
|||
type: 'date',
|
||||
value: value.getTime()
|
||||
}
|
||||
} else if ((value != null ? value.constructor.name : void 0) === 'Promise') {
|
||||
return {
|
||||
type: 'promise',
|
||||
then: valueToMeta(function (v) { value.then(v) })
|
||||
}
|
||||
} else if ((value != null) && typeof value === 'object' && v8Util.getHiddenValue(value, 'atomId')) {
|
||||
return {
|
||||
type: 'remote-object',
|
||||
id: v8Util.getHiddenValue(value, 'atomId')
|
||||
}
|
||||
} else if ((value != null) && typeof value === 'object') {
|
||||
if (value.constructor != null && value.constructor.name === 'Promise') {
|
||||
return {
|
||||
type: 'promise',
|
||||
then: valueToMeta(function (v) { value.then(v) })
|
||||
}
|
||||
} else if (v8Util.getHiddenValue(value, 'atomId')) {
|
||||
return {
|
||||
type: 'remote-object',
|
||||
id: v8Util.getHiddenValue(value, 'atomId')
|
||||
}
|
||||
}
|
||||
|
||||
ret = {
|
||||
type: 'object',
|
||||
name: value.constructor.name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue