diff --git a/ext/v8/object.cc b/ext/v8/object.cc index a890462..09af5dc 100644 --- a/ext/v8/object.cc +++ b/ext/v8/object.cc @@ -17,6 +17,11 @@ void Object::Init() { defineEnumConst("ReadOnly", v8::ReadOnly). defineEnumConst("DontEnum", v8::DontEnum). defineEnumConst("DontDelete", v8::DontDelete); + ClassBuilder("AccessControl"). + defineEnumConst("DEFAULT", v8::DEFAULT). + defineEnumConst("ALL_CAN_READ", v8::ALL_CAN_READ). + defineEnumConst("ALL_CAN_WRITE", v8::ALL_CAN_WRITE). + defineEnumConst("PROHIBITS_OVERWRITING", v8::PROHIBITS_OVERWRITING); } VALUE Object::New(VALUE self) { diff --git a/ext/v8/rr.h b/ext/v8/rr.h index e6238a4..6263c9a 100644 --- a/ext/v8/rr.h +++ b/ext/v8/rr.h @@ -41,7 +41,7 @@ public: this->value = value; } inline operator T() { - return NUM2INT(value); + return NIL_P(value) ? 0 : NUM2INT(value); } private: VALUE value; @@ -148,6 +148,7 @@ private: }; class PropertyAttribute: public Enum {}; +class AccessControl: public Enum {}; class Object : public Ref { public: