Merge pull request #1225 from deepak1556/remote_lib_patch
using Object.defineProperty instead of __defineMethods__
This commit is contained in:
commit
1679115302
1 changed files with 11 additions and 8 deletions
|
@ -69,15 +69,18 @@ metaToValue = (meta) ->
|
|||
ret = ipc.sendSync 'ATOM_BROWSER_MEMBER_CALL', meta.id, member.name, wrapArgs(arguments)
|
||||
return metaToValue ret
|
||||
else
|
||||
ret.__defineSetter__ member.name, (value) ->
|
||||
# Set member data.
|
||||
ipc.sendSync 'ATOM_BROWSER_MEMBER_SET', meta.id, member.name, value
|
||||
value
|
||||
Object.defineProperty ret, member.name,
|
||||
enumerable: true,
|
||||
configurable: false,
|
||||
set: (value) ->
|
||||
# Set member data.
|
||||
ipc.sendSync 'ATOM_BROWSER_MEMBER_SET', meta.id, member.name, value
|
||||
value
|
||||
|
||||
ret.__defineGetter__ member.name, ->
|
||||
# Get member data.
|
||||
ret = ipc.sendSync 'ATOM_BROWSER_MEMBER_GET', meta.id, member.name
|
||||
metaToValue ret
|
||||
get: ->
|
||||
# Get member data.
|
||||
ret = ipc.sendSync 'ATOM_BROWSER_MEMBER_GET', meta.id, member.name
|
||||
metaToValue ret
|
||||
|
||||
# Track delegate object's life time, and tell the browser to clean up
|
||||
# when the object is GCed.
|
||||
|
|
Loading…
Reference in a new issue