mirror of
https://github.com/electron/electron.git
synced 2026-02-01 18:55:08 -05:00
Better support of array type in RPC.
This commit is contained in:
@@ -8,14 +8,17 @@ class PlainObject
|
||||
constructor: (value) ->
|
||||
@type = typeof value
|
||||
@type = 'value' if value is null
|
||||
@type = 'array' if Array.isArray value
|
||||
|
||||
if @type is 'object' or @type is 'function'
|
||||
if @type is 'array'
|
||||
@members = []
|
||||
@members.push new PlainObject(el) for el in value
|
||||
else if @type is 'object' or @type is 'function'
|
||||
@name = value.constructor.name
|
||||
@id = objectsRegistry.add value
|
||||
|
||||
@members = []
|
||||
for prop, field of value
|
||||
@members.push { name: prop, type: typeof field }
|
||||
@members.push { name: prop, type: typeof field } for prop, field of value
|
||||
else
|
||||
@type = 'value'
|
||||
@value = value
|
||||
|
||||
Reference in New Issue
Block a user