Use constructor name to check if Promise

This commit is contained in:
Ryohei Ikegami 2015-08-01 12:20:16 +09:00
parent 428ad20807
commit c8a794ac34
2 changed files with 2 additions and 2 deletions

View file

@ -20,7 +20,7 @@ wrapArgs = (args, visited=[]) ->
type: 'array', value: wrapArgs(value, visited)
else if Buffer.isBuffer value
type: 'buffer', value: Array::slice.call(value, 0)
else if Promise.resolve(value) == value
else if value? and value.constructor.name is 'Promise'
type: 'promise', then: valueToMeta(value.then.bind(value))
else if value? and typeof value is 'object' and v8Util.getHiddenValue value, 'atomId'
type: 'remote-object', id: v8Util.getHiddenValue value, 'atomId'