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

Add ability to create handle scopes

This commit is contained in:
Georgy Angelov 2015-03-18 22:08:34 +00:00
parent 2fca33f9d0
commit 1f7192ca85
4 changed files with 31 additions and 2 deletions

View file

@ -10,9 +10,9 @@ extern "C" {
void Init_init() {
V8::Init();
Isolate::Init();
Handles::Init();
// v8::Locker lock();
// GC::Init();
// Handles::Init();
// Accessor::Init();
// Context::Init();
// Invocation::Init();

22
spec/c/handles_spec.rb Normal file
View file

@ -0,0 +1,22 @@
require 'v8/init'
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

View file

@ -1,7 +1,7 @@
require 'v8/init'
describe V8::C::Isolate do
it "can create a new isolate" do
it 'can create a new isolate' do
expect(V8::C::Isolate.New).to be
end
end

7
spec/c/v8_spec.rb Normal file
View file

@ -0,0 +1,7 @@
require 'v8/init'
describe V8::C::V8 do
it 'can say its version' do
expect(V8::C::V8.GetVersion).to be_a String
end
end