mirror of
https://github.com/rubyjs/therubyrhino
synced 2023-03-27 23:21:34 -04:00
recursively To.ruby a native objects properties so that to_h will properly deal with nested objects
This commit is contained in:
parent
896f9f08a6
commit
c1b8bd473a
1 changed files with 1 additions and 0 deletions
|
@ -57,6 +57,7 @@ module Rhino
|
|||
def to_h
|
||||
{}.tap do |h|
|
||||
each do |k,v|
|
||||
v = To.ruby(v)
|
||||
h[k] = self.class === v ? v.to_h : v
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue