@@ -21,6 +21,28 @@ namespace rr {
2121 defineMethod (" GetPrototype" , &GetPrototype).
2222 defineMethod (" SetPrototype" , &SetPrototype).
2323 defineMethod (" ObjectProtoToString" , &ObjectProtoToString).
24+ defineMethod (" GetConstructorName" , &GetConstructorName).
25+ defineMethod (" InternalFieldCount" , &InternalFieldCount).
26+ defineMethod (" GetInternalField" , &GetInternalField).
27+ defineMethod (" SetInternalField" , &SetInternalField).
28+ defineMethod (" HasOwnProperty" , &HasOwnProperty).
29+ defineMethod (" HasRealNamedProperty" , &HasRealNamedProperty).
30+ defineMethod (" HasRealIndexedProperty" , &HasRealIndexedProperty).
31+ defineMethod (" HasRealNamedCallbackProperty" , &HasRealNamedCallbackProperty).
32+ defineMethod (" GetRealNamedPropertyInPrototypeChain" , &GetRealNamedPropertyInPrototypeChain).
33+ defineMethod (" GetRealNamedProperty" , &GetRealNamedProperty).
34+ defineMethod (" GetRealNamedPropertyAttributes" , &GetRealNamedPropertyAttributes).
35+ defineMethod (" GetRealNamedPropertyAttributesInPrototypeChain" , &GetRealNamedPropertyAttributesInPrototypeChain).
36+ defineMethod (" HasNamedLookupInterceptor" , &HasNamedLookupInterceptor).
37+ defineMethod (" HasIndexedLookupInterceptor" , &HasIndexedLookupInterceptor).
38+ defineMethod (" SetHiddenValue" , &SetHiddenValue).
39+ defineMethod (" GetHiddenValue" , &GetHiddenValue).
40+ defineMethod (" DeleteHiddenValue" , &DeleteHiddenValue).
41+ defineMethod (" Clone" , &Clone).
42+ defineMethod (" CreationContext" , &CreationContext).
43+ defineMethod (" IsCallable" , &IsCallable).
44+ defineMethod (" CallAsFunction" , &CallAsFunction).
45+ defineMethod (" CallAsConstructor" , &CallAsConstructor).
2446
2547 store (&Class);
2648 }
@@ -210,6 +232,192 @@ namespace rr {
210232 return String::Maybe (object.getIsolate (), object->ObjectProtoToString (Context (r_context)));
211233 }
212234
235+ VALUE Object::GetConstructorName (VALUE self) {
236+ Object object (self);
237+ Locker lock (object);
238+
239+ return String (object.getIsolate (), object->GetConstructorName ());
240+ }
241+
242+ VALUE Object::InternalFieldCount (VALUE self) {
243+ Object object (self);
244+ Locker lock (object);
245+
246+ return INT2FIX (object->InternalFieldCount ());
247+ }
248+
249+ VALUE Object::GetInternalField (VALUE self, VALUE index) {
250+ Object object (self);
251+ Locker lock (object);
252+
253+ return Value (object.getIsolate (), object->GetInternalField (NUM2INT (index)));
254+ }
255+
256+ VALUE Object::SetInternalField (VALUE self, VALUE index, VALUE value) {
257+ Object object (self);
258+ Locker lock (object);
259+
260+ object->SetInternalField (NUM2INT (index), *Value (value));
261+
262+ return Qnil;
263+ }
264+
265+ VALUE Object::HasOwnProperty (VALUE self, VALUE r_context, VALUE key) {
266+ Object object (self);
267+ Locker lock (object);
268+
269+ return Bool::Maybe (object->HasOwnProperty (Context (r_context), *Name (key)));
270+ }
271+
272+ VALUE Object::HasRealNamedProperty (VALUE self, VALUE r_context, VALUE key) {
273+ Object object (self);
274+ Locker lock (object);
275+
276+ return Bool::Maybe (object->HasRealNamedProperty (Context (r_context), *Name (key)));
277+ }
278+
279+ VALUE Object::HasRealIndexedProperty (VALUE self, VALUE r_context, VALUE index) {
280+ Object object (self);
281+ Locker lock (object);
282+
283+ return Bool::Maybe (object->HasRealIndexedProperty (Context (r_context), NUM2INT (index)));
284+ }
285+
286+ VALUE Object::HasRealNamedCallbackProperty (VALUE self, VALUE r_context, VALUE key) {
287+ Object object (self);
288+ Locker lock (object);
289+
290+ return Bool::Maybe (object->HasRealNamedCallbackProperty (Context (r_context), *Name (key)));
291+ }
292+
293+ VALUE Object::GetRealNamedPropertyInPrototypeChain (VALUE self, VALUE r_context, VALUE key) {
294+ Object object (self);
295+ Locker lock (object);
296+
297+ return Value::Maybe (object.getIsolate (), object->GetRealNamedPropertyInPrototypeChain (
298+ Context (r_context),
299+ *Name (key)
300+ ));
301+ }
302+
303+ VALUE Object::GetRealNamedProperty (VALUE self, VALUE r_context, VALUE key) {
304+ Object object (self);
305+ Locker lock (object);
306+
307+ return Value::Maybe (object.getIsolate (), object->GetRealNamedProperty (
308+ Context (r_context),
309+ *Name (key)
310+ ));
311+ }
312+
313+ VALUE Object::GetRealNamedPropertyAttributes (VALUE self, VALUE r_context, VALUE key) {
314+ Object object (self);
315+ Locker lock (object);
316+
317+ return Enum<v8::PropertyAttribute>::Maybe (object->GetRealNamedPropertyAttributes (
318+ Context (r_context),
319+ *Name (key)
320+ ));
321+ }
322+
323+ VALUE Object::GetRealNamedPropertyAttributesInPrototypeChain (VALUE self, VALUE r_context, VALUE key) {
324+ Object object (self);
325+ Locker lock (object);
326+
327+ return Enum<v8::PropertyAttribute>::Maybe (object->GetRealNamedPropertyAttributesInPrototypeChain (
328+ Context (r_context),
329+ *Name (key)
330+ ));
331+ }
332+
333+ VALUE Object::HasNamedLookupInterceptor (VALUE self) {
334+ Object object (self);
335+ Locker lock (object);
336+
337+ return Bool (object->HasNamedLookupInterceptor ());
338+ }
339+
340+ VALUE Object::HasIndexedLookupInterceptor (VALUE self) {
341+ Object object (self);
342+ Locker lock (object);
343+
344+ return Bool (object->HasIndexedLookupInterceptor ());
345+ }
346+
347+ VALUE Object::SetHiddenValue (VALUE self, VALUE key, VALUE value) {
348+ Object object (self);
349+ Locker lock (object);
350+
351+ return Bool (object->SetHiddenValue (String (key), Value (value)));
352+ }
353+
354+ VALUE Object::GetHiddenValue (VALUE self, VALUE key) {
355+ Object object (self);
356+ Locker lock (object);
357+
358+ return Value (object.getIsolate (), object->GetHiddenValue (String (key)));
359+ }
360+
361+ VALUE Object::DeleteHiddenValue (VALUE self, VALUE key) {
362+ Object object (self);
363+ Locker lock (object);
364+
365+ return Bool (object->DeleteHiddenValue (String (key)));
366+ }
367+
368+ VALUE Object::Clone (VALUE self) {
369+ Object object (self);
370+ Locker lock (object);
371+
372+ return Object (object.getIsolate (), object->Clone ());
373+ }
374+
375+ VALUE Object::CreationContext (VALUE self) {
376+ Object object (self);
377+ Locker lock (object);
378+
379+ return Context (object->CreationContext ());
380+ }
381+
382+ VALUE Object::IsCallable (VALUE self) {
383+ Object object (self);
384+ Locker lock (object);
385+
386+ return Bool (object->IsCallable ());
387+ }
388+
389+ VALUE Object::CallAsFunction (int argc, VALUE* argv, VALUE self) {
390+ VALUE r_context, recv, r_argv;
391+ rb_scan_args (argc, argv, " 30" , &r_context, &recv, &r_argv);
392+
393+ Object object (self);
394+ v8::Isolate* isolate = object.getIsolate ();
395+ Locker lock (isolate);
396+
397+ std::vector< v8::Handle<v8::Value> > vector (Value::convertRubyArray (isolate, r_argv));
398+
399+ return Value::Maybe (isolate, object->CallAsFunction (
400+ Context (r_context),
401+ Value (recv),
402+ RARRAY_LENINT (r_argv),
403+ &vector[0 ]
404+ ));
405+ }
406+
407+ VALUE Object::CallAsConstructor (VALUE self, VALUE r_context, VALUE argv) {
408+ Object object (self);
409+ v8::Isolate* isolate = object.getIsolate ();
410+ Locker lock (isolate);
411+
412+ std::vector< v8::Handle<v8::Value> > vector (Value::convertRubyArray (isolate, argv));
413+
414+ return Value::Maybe (isolate, object->CallAsConstructor (
415+ Context (r_context),
416+ RARRAY_LENINT (argv),
417+ &vector[0 ]
418+ ));
419+ }
420+
213421 Object::operator VALUE () {
214422 Isolate isolate (getIsolate ());
215423 Locker lock (isolate);
0 commit comments