Make sure all sync messages get a return value.

This commit is contained in:
Cheng Zhao 2013-09-20 21:39:07 +08:00
parent a9c824eba1
commit 07b5039c64
2 changed files with 3 additions and 0 deletions

View file

@ -75,6 +75,7 @@ ipc.on 'ATOM_BROWSER_GLOBAL', (event, processId, routingId, name) ->
ipc.on 'ATOM_BROWSER_RELEASE_RENDER_VIEW', (event, processId, routingId) ->
objectsRegistry.clear processId, routingId
event.returnValue = null
ipc.on 'ATOM_BROWSER_CURRENT_WINDOW', (event, processId, routingId) ->
try
@ -127,6 +128,7 @@ ipc.on 'ATOM_BROWSER_MEMBER_SET', (event, processId, routingId, id, name, value)
try
obj = objectsRegistry.get id
obj[name] = value
event.returnValue = null
catch e
event.returnValue = errorToMeta e

View file

@ -72,6 +72,7 @@ metaToValue = (meta) ->
ret.__defineSetter__ member.name, (value) ->
# Set member data.
ipc.sendChannelSync 'ATOM_BROWSER_MEMBER_SET', meta.id, member.name, value
value
ret.__defineGetter__ member.name, ->
# Get member data.