mirror of
https://github.com/rails/execjs
synced 2023-03-27 23:21:20 -04:00
Unbox mustang objects
This commit is contained in:
parent
e019c4b5c3
commit
f13676923f
1 changed files with 6 additions and 0 deletions
|
@ -44,6 +44,12 @@ module ExecJS
|
|||
raise RuntimeError, value.message
|
||||
when Mustang::V8::Error
|
||||
raise ProgramError, value.message
|
||||
when Mustang::V8::Object
|
||||
value.inject({}) { |h, (k, v)|
|
||||
v = unbox(v)
|
||||
h[k] = v if v
|
||||
h
|
||||
}
|
||||
else
|
||||
value.respond_to?(:delegate) ? value.delegate : value
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue