1
0
Fork 0
mirror of https://github.com/rails/execjs synced 2023-03-27 23:21:20 -04:00

Unbox mustang objects

This commit is contained in:
Joshua Peek 2011-09-13 09:45:31 -05:00
parent e019c4b5c3
commit f13676923f

View file

@ -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