Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit 6b849bd

Browse files
committed
Add documentation for FunctionCallbackInfo [skip ci]
v8/v8@4fdf9fd
1 parent d6d2dbd commit 6b849bd

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

stubs/src/CallbackInfo.php

+13
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,33 @@ public function GetContext(): Context
3232
}
3333

3434
/**
35+
* Returns the receiver. This corresponds to the "this" value.
36+
*
3537
* @return \V8\ObjectValue
3638
*/
3739
public function This(): ObjectValue
3840
{
3941
}
4042

4143
/**
44+
* If the callback was created without a Signature, this is the same
45+
* value as This(). If there is a signature, and the signature didn't match
46+
* This() but one of its hidden prototypes, this will be the respective
47+
* hidden prototype.
48+
*
49+
* Note that this is not the prototype of This() on which the accessor
50+
* referencing this callback was found (which in V8 internally is often
51+
* referred to as holder [sic]).
52+
*
4253
* @return \V8\ObjectValue
4354
*/
4455
public function Holder(): ObjectValue
4556
{
4657
}
4758

4859
/**
60+
* The ReturnValue for the call
61+
*
4962
* @return \V8\ReturnValue
5063
*/
5164
public function GetReturnValue(): ReturnValue

stubs/src/FunctionCallbackInfo.php

+9
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,26 @@ public function Length(): int
3232
}
3333

3434
/**
35+
* Get available arguments
36+
*
3537
* @return Value[] | StringValue[] | SymbolValue[] | NumberValue[] | ObjectValue[] | ArrayObject[] | FunctionObject[] | StringObject[] | SymbolObject[]
3638
*/
3739
public function Arguments(): array
3840
{
3941
}
4042

43+
/**
44+
* For construct calls, this returns the "new.target" value.
45+
*
46+
* @return Value
47+
*/
4148
public function NewTarget(): Value
4249
{
4350
}
4451

4552
/**
53+
* Indicates whether this is a regular call or a construct call.
54+
*
4655
* @return bool
4756
*/
4857
public function IsConstructCall(): bool

0 commit comments

Comments
 (0)