Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 402598f40e3b9fc9ed5b8caad9855ea85f7d2d27..1c349b561bf844608da4f2b61da5a12dd56b2b0e 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -3488,6 +3488,27 @@ bool Object::SetDeclaredAccessor(Local<String> name, |
} |
+void Object::SetAccessorProperty(Local<String> name, |
+ Local<Function> getter, |
+ Handle<Function> setter, |
+ PropertyAttribute attribute, |
+ AccessControl settings) { |
+ i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
+ ON_BAILOUT(isolate, "v8::Object::SetAccessorProperty()", return); |
+ ENTER_V8(isolate); |
+ i::HandleScope scope(isolate); |
+ i::Handle<i::Object> getter_i = v8::Utils::OpenHandle(*getter); |
+ i::Handle<i::Object> setter_i = v8::Utils::OpenHandle(*setter, true); |
+ if (setter_i.is_null()) setter_i = isolate->factory()->null_value(); |
+ i::JSObject::DefineAccessor(v8::Utils::OpenHandle(this), |
+ v8::Utils::OpenHandle(*name), |
+ getter_i, |
+ setter_i, |
+ static_cast<PropertyAttributes>(attribute), |
+ settings); |
+} |
+ |
+ |
bool v8::Object::HasOwnProperty(Handle<String> key) { |
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
ON_BAILOUT(isolate, "v8::Object::HasOwnProperty()", |