1
0
Fork 0
mirror of https://github.com/rubyjs/therubyrhino synced 2023-03-27 23:21:34 -04:00

inspect seems to print non-sense for native rhino objects

This commit is contained in:
kares 2012-05-29 12:23:55 +02:00
parent 6c962f7db0
commit 9e872e7d36

View file

@ -85,6 +85,13 @@ class Java::OrgMozillaJavascript::ScriptableObject
to_h.to_json(*args)
end
# make sure inspect prints the same as to_s (on --1.8)
# otherwise JRuby might play it a little smart e.g. :
# "#<#<Class:0xd790a8>:0x557c15>" instead of "Error: bar"
def inspect
toString
end
# Delegate methods to JS object if possible when called from Ruby.
def method_missing(name, *args)
name_str = name.to_s