Sha256: 12ad132bb0dedd40838a606af9425ef24beefae88d1657be6e43dfe092d58f8f

Contents?: true

Size: 735 Bytes

Versions: 37

Compression:

Stored size: 735 Bytes

Contents

#include "rr.h"

namespace rr {

void Handles::Init() {
  VALUE v8 = rb_define_module("V8");
  VALUE c = rb_define_module_under(v8, "C");
  rb_define_singleton_method(c, "HandleScope", (VALUE (*)(...))&HandleScope, -1);
}

VALUE Handles::HandleScope(int argc, VALUE* argv, VALUE self) {
  if (!rb_block_given_p()) {
    return Qnil;
  }
  int state = 0;
  VALUE code;
  rb_scan_args(argc,argv,"00&", &code);
  VALUE result = SetupAndCall(&state, code);
  if (state != 0) {
    rb_jump_tag(state);
  }
  return result;
}

VALUE Handles::SetupAndCall(int* state, VALUE code) {
  v8::HandleScope scope;
  return rb_protect(&DoCall, code, state);
}

VALUE Handles::DoCall(VALUE code) {
  return rb_funcall(code, rb_intern("call"), 0);
}

}

Version data entries

37 entries across 37 versions & 8 rubygems

Version Path
arcabouco-0.2.13 vendor/bundle/gems/therubyracer-0.12.2/ext/v8/handles.cc
therubyracer-0.12.3 ext/v8/handles.cc
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/therubyracer-0.11.4/ext/v8/handles.cc
therubyracer-xcode-0.12.3 ext/v8/handles.cc
therubyracer-xcode-0.12.2 ext/v8/handles.cc
therubyracer-tmpfork-0.12.2 ext/v8/handles.cc
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/therubyracer-0.12.2/ext/v8/handles.cc
therubyracer-0.12.2 ext/v8/handles.cc
therubyracer-0.12.1 ext/v8/handles.cc
therubyracer-discourse-0.12.0 ext/v8/handles.cc
therubyracer-0.12.0 ext/v8/handles.cc
therubyracer-0.11.4 ext/v8/handles.cc
therubyracer-0.11.3 ext/v8/handles.cc
therubyracer-0.11.2 ext/v8/handles.cc
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/therubyracer-0.11.0/ext/v8/handles.cc
therubyracer-0.11.1 ext/v8/handles.cc
therubyracer-0.11.1beta1 ext/v8/handles.cc
therubyracer-0.11.0 ext/v8/handles.cc
therubyracer-0.11.0beta8-x86-freebsd-9 ext/v8/handles.cc
therubyracer-0.11.0beta8-x86_64-linux ext/v8/handles.cc