Sha256: 756d3b0f8005ca4fafc35902190072c72629a43a659f6e4cbe41616e9294b1d1

Contents?: true

Size: 1.19 KB

Versions: 37

Compression:

Stored size: 1.19 KB

Contents

#include "rr.h"

namespace rr {
  void Exception::Init() {
    ModuleBuilder("V8::C").
      defineSingletonMethod("ThrowException", &ThrowException);
    ClassBuilder("Exception").
      defineSingletonMethod("RangeError", &RangeError).
      defineSingletonMethod("ReferenceError", &ReferenceError).
      defineSingletonMethod("SyntaxError", &SyntaxError).
      defineSingletonMethod("TypeError", &TypeError).
      defineSingletonMethod("Error", &Error);
  }

  VALUE Exception::ThrowException(VALUE self, VALUE exception) {
    return Value(v8::ThrowException(Value(exception)));
  }

  VALUE Exception::RangeError(VALUE self, VALUE message) {
    return Value(v8::Exception::RangeError(String(message)));
  }

  VALUE Exception::ReferenceError(VALUE self, VALUE message) {
    return Value(v8::Exception::ReferenceError(String(message)));
  }

  VALUE Exception::SyntaxError(VALUE self, VALUE message) {
    return Value(v8::Exception::SyntaxError(String(message)));
  }

  VALUE Exception::TypeError(VALUE self, VALUE message) {
    return Value(v8::Exception::TypeError(String(message)));
  }

  VALUE Exception::Error(VALUE self, VALUE message) {
    return Value(v8::Exception::Error(String(message)));
  }
}

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