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

Unified Diff: include/v8.h

Issue 2286323002: [api] Add documentation for PropertyQueryCallback. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@DocPropertyAttribute
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | test/cctest/test-api-interceptors.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 8fc9149671a9795d3a797e543d8f8ae4f29c3ba6..e65a374966f6fa6ef5ed3b3d594fe97512e5a312 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -4543,11 +4543,25 @@ typedef void (*GenericNamedPropertySetterCallback)(
Local<Name> property, Local<Value> value,
const PropertyCallbackInfo<Value>& info);
-
/**
- * Returns a non-empty handle if the interceptor intercepts the request.
- * The result is an integer encoding property attributes (like v8::None,
- * v8::DontEnum, etc.)
+ * Intercepts all requests that query the attributes of the
+ * property, e.g., getOwnPropertyDescriptor(), propertyIsEnumerable(), and
+ * defineProperty().
+ *
+ * Use `info.GetReturnValue().Set(value)` to set the property attributes. The
+ * value is an interger encoding a `v8::PropertyAttribute`.
+ *
+ * \param property The name of the property for which the request was
+ * intercepted.
+ * \param info Information about the intercepted request, such as
+ * isolate, receiver, return value, or whether running in `'use strict'` mode.
+ * See `PropertyCallbackInfo`.
+ *
+ * \note hasOwnProperty() can trigger this interceptor, but for optimization
+ * reasons it is not guaranteed to.
jochen (gone - plz use gerrit) 2016/08/29 12:52:35 wut? :-/
Franzi 2016/08/31 11:18:36 Is this version better or should we leave out the
jochen (gone - plz use gerrit) 2016/08/31 14:37:49 ah, so you mean that hasOwnProperty might or might
+ *
+ * See also
+ * `ObjectTemplate::SetNamedPropertyHandler.`
*/
typedef void (*GenericNamedPropertyQueryCallback)(
Local<Name> property, const PropertyCallbackInfo<Integer>& info);
« no previous file with comments | « no previous file | test/cctest/test-api-interceptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698