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

Unified Diff: include/v8.h

Issue 2263363002: [api] Add documentation for SetHandler(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@DocMove
Patch Set: Fix linebreak. 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 84316763bfdb61c91d7521d6488d9fd8ed0aef39..8339e2531d76724c43dd43a96d188b476a34b395 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -4784,6 +4784,18 @@ class V8_EXPORT ObjectTemplate : public Template {
NamedPropertyDeleterCallback deleter = 0,
NamedPropertyEnumeratorCallback enumerator = 0,
Local<Value> data = Local<Value>());
+
+ /**
+ * Sets a named property handler on the object template.
+ *
+ * Whenever a property whose name is a string or a symbol is accessed on
+ * objects created from this object template, the provided callback is
+ * invoked instead of accessing the property directly on the JavaScript
+ * object.
+ *
+ * @param configuration The NamedPropertyHandlerConfiguration that defines the
+ * callbacks to invoke when accessing a property.
+ */
void SetHandler(const NamedPropertyHandlerConfiguration& configuration);
/**
@@ -4813,6 +4825,17 @@ class V8_EXPORT ObjectTemplate : public Template {
SetHandler(IndexedPropertyHandlerConfiguration(getter, setter, query,
deleter, enumerator, data));
}
+
+ /**
+ * Sets an indexed property handler on the object template.
+ *
+ * Whenever an indexed property is accessed on objects created from
+ * this object template, the provided callback is invoked instead of
+ * accessing the property directly on the JavaScript object.
+ *
+ * @param configuration The IndexedPropertyHandlerConfiguration that defines
+ * the callbacks to invoke when accessing a property.
+ */
void SetHandler(const IndexedPropertyHandlerConfiguration& configuration);
/**
« 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