ext/v8/v8_obj.cpp in therubyracer-0.7.5 vs ext/v8/v8_obj.cpp in therubyracer-0.8.0.pre

- old
+ new

@@ -62,19 +62,31 @@ } VALUE GetHiddenValue(VALUE self, VALUE key) { HandleScope scope; return rr_v82rb(unwrap(self)->GetHiddenValue(rr_rb2v8(key)->ToString())); } + VALUE GetPrototype(VALUE self) { + HandleScope scope; + return rr_v82rb(unwrap(self)->GetPrototype()); + } + VALUE SetPrototype(VALUE self, VALUE prototype) { + HandleScope scope; + Handle<Value> proto = rr_rb2v8(prototype); + Local<Object> me = unwrap(self); + return rr_v82rb(unwrap(self)->SetPrototype(rr_rb2v8(prototype))); + } } void rr_init_obj() { rr_cV8_C_Object = rr_define_class("Object", rr_cV8_C_Value); rr_define_singleton_method(rr_cV8_C_Object, "New", New, 0); rr_define_method(rr_cV8_C_Object, "Get", Get, 1); rr_define_method(rr_cV8_C_Object, "Set", Set, 2); rr_define_method(rr_cV8_C_Object, "GetPropertyNames", GetPropertyNames, 0); rr_define_method(rr_cV8_C_Object, "GetHiddenValue", GetHiddenValue, 1); rr_define_method(rr_cV8_C_Object, "SetHiddenValue", SetHiddenValue, 2); + rr_define_method(rr_cV8_C_Object, "GetPrototype", GetPrototype, 0); + rr_define_method(rr_cV8_C_Object, "SetPrototype", SetPrototype, 1); } VALUE rr_reflect_v8_object(Handle<Value> value) { Local<Object> object(Object::Cast(*value)); Local<Value> peer = object->GetHiddenValue(String::NewSymbol("TheRubyRacer::RubyObject"));