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

Unified Diff: include/v8.h

Issue 2263303003: [api] Add documentation for PropertyCallbackInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@DocSetHandler
Patch Set: Address review comments. 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 | no next file » | 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 c93ee238585f5a86527532eb6e927ac7906a9ccb..fcd1baf5840376519a7816a180b6b211b6578828 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -3236,12 +3236,50 @@ class FunctionCallbackInfo {
template<typename T>
class PropertyCallbackInfo {
public:
+ /**
+ * \return The isolate of the property access.
+ */
V8_INLINE Isolate* GetIsolate() const;
+
+ /**
+ * \return The data set in the configuration, i.e., in
+ * `NamedPropertyHandlerConfiguration` or
+ * `IndexedPropertyHandlerConfiguration.`
+ */
V8_INLINE Local<Value> Data() const;
+
V8_INLINE Local<Object> This() const;
+
+ /**
+ * \return The object in the prototype chain of the receiver that has the
+ * interceptor. Suppose you have `x` and its prototype is `y`, and `y`
+ * has an interceptor. Then `info.This()` is `x` and `info.Holder()` is `y`.
+ * The Holder() could be a hidden object (the global object, rather
+ * than the global proxy).
+ *
+ * \note For security reasons, do not pass the object back into the runtime.
+ */
V8_INLINE Local<Object> Holder() const;
+
+ /**
+ * \return The return value of the callback.
+ * Can be changed by calling Set().
+ * \code
+ * info.GetReturnValue().Set(...)
+ * \endcode
+ *
+ */
V8_INLINE ReturnValue<T> GetReturnValue() const;
+
+ /**
+ * \return True if the intercepted function should throw if an error occurs.
+ * Usually, `true` corresponds to `'use strict'`.
+ *
+ * \note Always `false` when intercepting `Reflect.Set()`
+ * independent of the language mode.
+ */
V8_INLINE bool ShouldThrowOnError() const;
+
// This shouldn't be public, but the arm compiler needs it.
static const int kArgsLength = 7;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698