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

allow passing a hint to IdleNotification()

This commit is contained in:
Charles Lowell 2012-06-08 02:29:16 -05:00
parent f1a1571370
commit b54dc3e3c4
2 changed files with 9 additions and 3 deletions

View file

@ -678,7 +678,7 @@ public:
class V8 {
public:
static void Init();
static VALUE IdleNotification(VALUE self);
static VALUE IdleNotification(int argc, VALUE argv[], VALUE self);
static VALUE SetCaptureStackTraceForUncaughtExceptions(int argc, VALUE argv[], VALUE self);
};

View file

@ -8,8 +8,14 @@ void V8::Init() {
defineSingletonMethod("SetCaptureStackTraceForUncaughtExceptions", &SetCaptureStackTraceForUncaughtExceptions);
}
VALUE V8::IdleNotification(VALUE self) {
return Bool(v8::V8::IdleNotification());
VALUE V8::IdleNotification(int argc, VALUE argv[], VALUE self) {
VALUE hint;
rb_scan_args(argc, argv, "01", &hint);
if (RTEST(hint)) {
return Bool(v8::V8::IdleNotification(NUM2INT(hint)));
} else {
return Bool(v8::V8::IdleNotification());
}
}
VALUE V8::SetCaptureStackTraceForUncaughtExceptions(int argc, VALUE argv[], VALUE self) {