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

move object reflection into v8_obj.*

This commit is contained in:
Charles Lowell 2010-05-13 17:14:54 -05:00
parent b6681f2948
commit 5f2d3e2a61
4 changed files with 7 additions and 4 deletions

View file

@ -1,5 +1,6 @@
#include "rr.h"
#include "v8_value.h"
#include "v8_obj.h"
#include "v8_func.h"
#include "v8_str.h"
@ -24,7 +25,6 @@ VALUE rr_str_to_camel_case(VALUE str) {
}
VALUE rr_reflect_v8_array(Handle<Value> value);
VALUE rr_reflect_v8_object(Handle<Value> value);
VALUE rr_v82rb(Handle<Value> value) {
if (value->IsUndefined() || value->IsNull()) {

View file

@ -81,7 +81,6 @@ VALUE Racer_Error_Message(TryCatch& exception) {
}
VALUE v8_cxt_eval(VALUE self, VALUE source, VALUE filename) {
printf("In cxt eval()\n");
HandleScope handles;
TryCatch exceptions;
Local<Context> cxt = V8_Ref_Get<Context>(self);
@ -96,9 +95,7 @@ VALUE v8_cxt_eval(VALUE self, VALUE source, VALUE filename) {
if (exceptions.HasCaught()) {
return Racer_Error_Message(exceptions);
} else {
printf("about to convert result\n");
return rr_v82rb(result);
// return V82RB(result);
}
}

View file

@ -19,6 +19,11 @@ void rr_init_obj() {
rr_define_method(rr_cV8_C_Object, "context", v8_Object_context, 0);
}
VALUE rr_reflect_v8_object(Handle<Value> value) {
Local<Object> o = Object::Cast(*value);
return V8_Ref_Create(rr_cV8_C_Object, o);
}
namespace {
Local<Object> unwrap(VALUE robj) {
return V8_Ref_Get<Object>(robj);

View file

@ -6,6 +6,7 @@
extern VALUE rr_cV8_C_Object;
void rr_init_obj();
VALUE rr_reflect_v8_object(v8::Handle<v8::Value> value);
VALUE v8_Object_New(VALUE clazz);
VALUE v8_Object_Get(VALUE self, VALUE key);