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

remove spurious begin..end blocks

This commit is contained in:
Charles Lowell 2011-09-20 15:48:34 -05:00
parent 6d7e6f6cd2
commit f623c9c468
2 changed files with 16 additions and 20 deletions

View file

@ -5,16 +5,14 @@ module V8
def initialize(try, to)
@to = to
begin
super(initialize_unsafe(try))
rescue Exception => e
@boundaries = [Boundary.new(:rbframes => e.backtrace)]
@value = e
super(<<-EOMSG)
super(initialize_unsafe(try))
rescue Exception => e
@boundaries = [Boundary.new(:rbframes => e.backtrace)]
@value = e
super(<<-EOMSG)
You have uncovered what is probably a BUG in therubyracer exception code. An error report would be very helpful.
JSError#initialize failed!: #{e.message}"
EOMSG
end
end
def initialize_unsafe(try)

View file

@ -8,19 +8,17 @@ module V8
end
def raw
begin
yield
rescue Exception => e
case e
when SystemExit, NoMemoryError
raise e
else
error = V8::C::Exception::Error(V8::C::String::New(e.message))
#TODO: This is almost certainly a crash here.
#we need to hold onto `error` while it bubbles up the javascript stack.
error.SetHiddenValue("TheRubyRacer::Cause", C::External::New(e))
V8::C::ThrowException(error)
end
yield
rescue Exception => e
case e
when SystemExit, NoMemoryError
raise e
else
error = V8::C::Exception::Error(V8::C::String::New(e.message))
#TODO: This is almost certainly a crash here.
#we need to hold onto `error` while it bubbles up the javascript stack.
error.SetHiddenValue("TheRubyRacer::Cause", C::External::New(e))
V8::C::ThrowException(error)
end
end