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

add stub for v8::Object

This commit is contained in:
Charles Lowell 2012-05-04 00:23:41 -05:00
parent d2663ba161
commit a39c147f44
3 changed files with 24 additions and 1 deletions

View file

@ -11,7 +11,9 @@ extern "C" {
GC::Init();
V8::Init();
Context::Init();
Value::Init();
String::Init();
Object::Init();
Script::Init();
}
}

14
ext/v8/object.cc Normal file
View file

@ -0,0 +1,14 @@
#include "rr.h"
namespace rr {
void Object::Init() {
ClassBuilder("Object", "Value").
defineSingletonMethod("New", &New);
}
VALUE Object::New(VALUE self) {
return Object::create(v8::Object::New(), self);
}
}

View file

@ -128,10 +128,17 @@ public:
inline String(VALUE value) : Ref<v8::String>(value) {}
private:
static VALUE Class;
};
class Object : public Ref<v8::Object> {
public:
static void Init();
static VALUE New(VALUE self);
inline Object(VALUE value) : Ref<v8::Object>(value) {}
};
class V8 {
public:
static void Init();