mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
add AccessControl Enum
This commit is contained in:
parent
3d4d4cc38c
commit
dd12601032
2 changed files with 7 additions and 1 deletions
|
@ -17,6 +17,11 @@ void Object::Init() {
|
||||||
defineEnumConst("ReadOnly", v8::ReadOnly).
|
defineEnumConst("ReadOnly", v8::ReadOnly).
|
||||||
defineEnumConst("DontEnum", v8::DontEnum).
|
defineEnumConst("DontEnum", v8::DontEnum).
|
||||||
defineEnumConst("DontDelete", v8::DontDelete);
|
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) {
|
VALUE Object::New(VALUE self) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
this->value = value;
|
this->value = value;
|
||||||
}
|
}
|
||||||
inline operator T() {
|
inline operator T() {
|
||||||
return NUM2INT(value);
|
return NIL_P(value) ? 0 : NUM2INT(value);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
VALUE value;
|
VALUE value;
|
||||||
|
@ -148,6 +148,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
class PropertyAttribute: public Enum<v8::PropertyAttribute> {};
|
class PropertyAttribute: public Enum<v8::PropertyAttribute> {};
|
||||||
|
class AccessControl: public Enum<v8::AccessControl> {};
|
||||||
|
|
||||||
class Object : public Ref<v8::Object> {
|
class Object : public Ref<v8::Object> {
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Add table
Reference in a new issue