1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00
therubyracer/lib/v8/error/protect.rb
2012-06-14 22:34:38 -05:00

20 lines
No EOL
390 B
Ruby

class V8::Error
module Protect
def protect
yield
rescue Football => e
e.kickoff!
rescue Exception => e
e.extend Football
e.kickoff!
end
end
module Football
def kickoff!
error = V8::C::Exception::Error(message)
error.SetHiddenValue("rr::Football", V8::C::External::New(self))
V8::C::ThrowException(error)
end
end
end