Skip to content

Commit 4fdf9fd

Browse files
jeisingerCommit Bot
authored andcommitted
Add documentation for FunctionCallbackInfo
[email protected],[email protected],[email protected] BUG= Change-Id: I273f5ce305f80b2aa5e9c8c42a6e8e5afc51a0a7 Reviewed-on: https://chromium-review.googlesource.com/484422 Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Toon Verwaest <[email protected]> Commit-Queue: Jochen Eisinger <[email protected]> Cr-Commit-Position: refs/heads/master@{#44927}
1 parent ff2109d commit 4fdf9fd

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

include/v8.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3599,16 +3599,34 @@ class ReturnValue {
35993599
template<typename T>
36003600
class FunctionCallbackInfo {
36013601
public:
3602+
/** The number of available arguments. */
36023603
V8_INLINE int Length() const;
3604+
/** Accessor for the available arguments. */
36033605
V8_INLINE Local<Value> operator[](int i) const;
36043606
V8_INLINE V8_DEPRECATED("Use Data() to explicitly pass Callee instead",
36053607
Local<Function> Callee() const);
3608+
/** Returns the receiver. This corresponds to the "this" value. */
36063609
V8_INLINE Local<Object> This() const;
3610+
/**
3611+
* If the callback was created without a Signature, this is the same
3612+
* value as This(). If there is a signature, and the signature didn't match
3613+
* This() but one of its hidden prototypes, this will be the respective
3614+
* hidden prototype.
3615+
*
3616+
* Note that this is not the prototype of This() on which the accessor
3617+
* referencing this callback was found (which in V8 internally is often
3618+
* referred to as holder [sic]).
3619+
*/
36073620
V8_INLINE Local<Object> Holder() const;
3621+
/** For construct calls, this returns the "new.target" value. */
36083622
V8_INLINE Local<Value> NewTarget() const;
3623+
/** Indicates whether this is a regular call or a construct call. */
36093624
V8_INLINE bool IsConstructCall() const;
3625+
/** The data argument specified when creating the callback. */
36103626
V8_INLINE Local<Value> Data() const;
3627+
/** The current Isolate. */
36113628
V8_INLINE Isolate* GetIsolate() const;
3629+
/** The ReturnValue for the call. */
36123630
V8_INLINE ReturnValue<T> GetReturnValue() const;
36133631
// This shouldn't be public, but the arm compiler needs it.
36143632
static const int kArgsLength = 8;
@@ -5757,9 +5775,13 @@ class V8_EXPORT ObjectTemplate : public Template {
57575775
friend class FunctionTemplate;
57585776
};
57595777

5760-
57615778
/**
57625779
* A Signature specifies which receiver is valid for a function.
5780+
*
5781+
* A receiver matches a given signature if the receiver (or any of its
5782+
* hidden prototypes) was created from the signature's FunctionTemplate, or
5783+
* from a FunctionTemplate that inherits directly or indirectly from the
5784+
* signature's FunctionTemplate.
57635785
*/
57645786
class V8_EXPORT Signature : public Data {
57655787
public:

0 commit comments

Comments
 (0)