mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
d1e9088cf0
You can now create a JS object from Ruby-land without segfaulting
22 lines
491 B
Ruby
22 lines
491 B
Ruby
require 'c_spec_helper'
|
|
|
|
describe 'handles' do
|
|
describe '#HandleScope' do
|
|
let(:isolate) { V8::C::Isolate.New }
|
|
|
|
it 'can allocate handle scopes' do
|
|
V8::C::HandleScope(isolate) do
|
|
end
|
|
end
|
|
|
|
it 'isn\'t the end of the world if a ruby exception is raised inside a HandleScope' do
|
|
begin
|
|
V8::C::HandleScope(isolate) do
|
|
raise 'boom!'
|
|
end
|
|
rescue StandardError => e
|
|
expect(e.message).to eq 'boom!'
|
|
end
|
|
end
|
|
end
|
|
end
|