mirror of
https://github.com/electron/electron.git
synced 2026-01-25 15:28:11 -05:00
Support remote Promise in browser
This commit is contained in:
@@ -50,6 +50,7 @@ unwrapArgs = (sender, args) ->
|
||||
when 'remote-object' then objectsRegistry.get meta.id
|
||||
when 'array' then unwrapArgs sender, meta.value
|
||||
when 'buffer' then new Buffer(meta.value)
|
||||
when 'promise' then Promise.resolve(then: metaToValue(meta.then))
|
||||
when 'object'
|
||||
ret = v8Util.createObjectWithName meta.name
|
||||
for member in meta.members
|
||||
|
||||
@@ -20,6 +20,8 @@ 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
|
||||
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'
|
||||
else if value? and typeof value is 'object'
|
||||
|
||||
Reference in New Issue
Block a user