Sha256: 3a3d31c757422bf007c8a8c0d3b9510e62124b5f5e6cfb2eea9192bebb68a6be

Contents?: true

Size: 1022 Bytes

Versions: 37

Compression:

Stored size: 1022 Bytes

Contents

#include "rr.h"

namespace rr {
  VALUE Constants::_Undefined;
  VALUE Constants::_Null;
  VALUE Constants::_True;
  VALUE Constants::_False;
  void Constants::Init() {
    ModuleBuilder("V8::C").
      defineSingletonMethod("Undefined", &Undefined).
      defineSingletonMethod("Null", &Null).
      defineSingletonMethod("True", &True).
      defineSingletonMethod("False", &False);

    _Undefined = _Null = _True = _False = Qnil;
    rb_gc_register_address(&_Undefined);
    rb_gc_register_address(&_Null);
    rb_gc_register_address(&_True);
    rb_gc_register_address(&_False);
  }

  VALUE Constants::Undefined(VALUE self) {
    return cached<Primitive, v8::Primitive>(&_Undefined, v8::Undefined());
  }
  VALUE Constants::Null(VALUE self) {
    return cached<Primitive, v8::Primitive>(&_Null, v8::Null());
  }
  VALUE Constants::True(VALUE self) {
    return cached<Bool, v8::Boolean>(&_True, v8::True());
  }
  VALUE Constants::False(VALUE self) {
    return cached<Bool, v8::Boolean>(&_False, v8::False());
  }
}

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/constants.cc
therubyracer-0.12.3 ext/v8/constants.cc
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/therubyracer-0.11.4/ext/v8/constants.cc
therubyracer-xcode-0.12.3 ext/v8/constants.cc
therubyracer-xcode-0.12.2 ext/v8/constants.cc
therubyracer-tmpfork-0.12.2 ext/v8/constants.cc
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/therubyracer-0.12.2/ext/v8/constants.cc
therubyracer-0.12.2 ext/v8/constants.cc
therubyracer-0.12.1 ext/v8/constants.cc
therubyracer-discourse-0.12.0 ext/v8/constants.cc
therubyracer-0.12.0 ext/v8/constants.cc
therubyracer-0.11.4 ext/v8/constants.cc
therubyracer-0.11.3 ext/v8/constants.cc
therubyracer-0.11.2 ext/v8/constants.cc
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/therubyracer-0.11.0/ext/v8/constants.cc
therubyracer-0.11.1 ext/v8/constants.cc
therubyracer-0.11.1beta1 ext/v8/constants.cc
therubyracer-0.11.0 ext/v8/constants.cc
therubyracer-0.11.0beta8-x86-freebsd-9 ext/v8/constants.cc
therubyracer-0.11.0beta8-x86_64-linux ext/v8/constants.cc