Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Commit

Permalink
fix for jruby 1.8 mode
Browse files Browse the repository at this point in the history
  • Loading branch information
stereobooster committed May 15, 2012
1 parent 9bf032c commit f3b1249
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion execjs.gemspec
Expand Up @@ -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"]
Expand Down
12 changes: 6 additions & 6 deletions lib/execjs/ruby_rhino_runtime.rb
Expand Up @@ -23,7 +23,7 @@ def eval(source, options = {})
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
Expand All @@ -33,7 +33,7 @@ def eval(source, options = {})

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
Expand All @@ -42,13 +42,13 @@ def call(properties, *args)
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)
Expand Down

0 comments on commit f3b1249

Please sign in to comment.