Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: src/api.cc

Issue 364923006: add GetOwnPropertyDescriptor to api (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« include/v8.h ('K') | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 7c484de53ee1e537a8abeefdce1e0cab69e4952e..e5ed581aaeece9936220d7b740d969cfa89e68f7 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3205,6 +3205,26 @@ PropertyAttribute v8::Object::GetPropertyAttributes(v8::Handle<Value> key) {
}
+Local<Value> v8::Object::GetOwnPropertyDescriptor(Local<String> key) {
+ i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
+ ON_BAILOUT(isolate, "v8::Object::GetOwnPropertyDescriptor()",
+ return Local<Value>());
+ ENTER_V8(isolate);
+ i::Handle<i::JSObject> obj = Utils::OpenHandle(this);
+ i::Handle<i::Name> key_name = Utils::OpenHandle(*key);
+ i::Handle<i::Object> args[] = { obj, key_name };
+ EXCEPTION_PREAMBLE(isolate);
+ i::Handle<i::Object> result;
+ has_pending_exception = !CallV8HeapFunction(
+ "ObjectGetOwnPropertyDescriptor",
+ isolate->factory()->undefined_value(),
+ ARRAY_SIZE(args),
+ args).ToHandle(&result);
+ EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>());
+ return Utils::ToLocal(result);
+}
+
+
Local<Value> v8::Object::GetPrototype() {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
ON_BAILOUT(isolate, "v8::Object::GetPrototype()", return Local<v8::Value>());
« include/v8.h ('K') | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698