mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
20 lines
No EOL
390 B
Ruby
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 |