mirror of
https://github.com/rails/execjs
synced 2023-03-27 23:21:20 -04:00
fix for jruby 1.8 mode
This commit is contained in:
parent
9bf032ca79
commit
f3b12493ff
2 changed files with 7 additions and 7 deletions
|
@ -23,7 +23,7 @@ Gem::Specification.new do |s|
|
|||
s.add_development_dependency "mustang"
|
||||
s.add_development_dependency "therubyracer"
|
||||
else
|
||||
s.add_development_dependency "therubyrhino"
|
||||
s.add_development_dependency "therubyrhino", ">=1.73.3"
|
||||
end
|
||||
|
||||
s.authors = ["Sam Stephenson", "Josh Peek"]
|
||||
|
|
|
@ -23,7 +23,7 @@ module ExecJS
|
|||
if /\S/ =~ source
|
||||
unbox @rhino_context.eval("(#{source})")
|
||||
end
|
||||
rescue ::Rhino::JavascriptError => e
|
||||
rescue ::Rhino::JSError => e
|
||||
if e.message == "syntax error"
|
||||
raise RuntimeError, e.message
|
||||
else
|
||||
|
@ -33,7 +33,7 @@ module ExecJS
|
|||
|
||||
def call(properties, *args)
|
||||
unbox @rhino_context.eval(properties).call(*args)
|
||||
rescue ::Rhino::JavascriptError => e
|
||||
rescue ::Rhino::JSError => e
|
||||
if e.message == "syntax error"
|
||||
raise RuntimeError, e.message
|
||||
else
|
||||
|
@ -42,13 +42,13 @@ module ExecJS
|
|||
end
|
||||
|
||||
def unbox(value)
|
||||
case value = ::Rhino::To.ruby(value)
|
||||
when ::Rhino::NativeFunction
|
||||
case value = ::Rhino::to_ruby(value)
|
||||
when Java::OrgMozillaJavascript::NativeFunction
|
||||
nil
|
||||
when ::Rhino::NativeObject
|
||||
when Java::OrgMozillaJavascript::NativeObject
|
||||
value.inject({}) do |vs, (k, v)|
|
||||
case v
|
||||
when ::Rhino::NativeFunction, ::Rhino::J::Function
|
||||
when Java::OrgMozillaJavascript::NativeFunction, ::Rhino::JS::Function
|
||||
nil
|
||||
else
|
||||
vs[k] = unbox(v)
|
||||
|
|
Loading…
Add table
Reference in a new issue