mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
expose V8 version string.
This commit is contained in:
parent
e5aef04dfc
commit
a20ade811c
3 changed files with 10 additions and 1 deletions
|
@ -790,6 +790,7 @@ public:
|
|||
static VALUE IdleNotification(int argc, VALUE argv[], VALUE self);
|
||||
static VALUE SetCaptureStackTraceForUncaughtExceptions(int argc, VALUE argv[], VALUE self);
|
||||
static VALUE GetHeapStatistics(VALUE self, VALUE statistics_ptr);
|
||||
static VALUE GetVersion(VALUE self);
|
||||
};
|
||||
|
||||
class ClassBuilder {
|
||||
|
|
|
@ -6,7 +6,8 @@ void V8::Init() {
|
|||
ClassBuilder("V8").
|
||||
defineSingletonMethod("IdleNotification", &IdleNotification).
|
||||
defineSingletonMethod("SetCaptureStackTraceForUncaughtExceptions", &SetCaptureStackTraceForUncaughtExceptions).
|
||||
defineSingletonMethod("GetHeapStatistics", &GetHeapStatistics);
|
||||
defineSingletonMethod("GetHeapStatistics", &GetHeapStatistics).
|
||||
defineSingletonMethod("GetVersion", &GetVersion);
|
||||
}
|
||||
|
||||
VALUE V8::IdleNotification(int argc, VALUE argv[], VALUE self) {
|
||||
|
@ -30,4 +31,7 @@ VALUE V8::GetHeapStatistics(VALUE self, VALUE statistics_ptr) {
|
|||
Void(v8::V8::GetHeapStatistics(HeapStatistics(statistics_ptr)));
|
||||
}
|
||||
|
||||
VALUE V8::GetVersion(VALUE self) {
|
||||
return rb_str_new2(v8::V8::GetVersion());
|
||||
}
|
||||
}
|
|
@ -13,4 +13,8 @@ describe V8::C do
|
|||
V8::C::Value::Empty.should_not be_nil
|
||||
V8::C::Value::Empty.should be V8::C::Value::Empty
|
||||
end
|
||||
|
||||
it "can access the V8 version" do
|
||||
V8::C::V8::GetVersion().should match /^3\.10/
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue