Details of a call to a bound function: the context, this, and the raw arguments.
Add a CallInfo parameter to a bound function to receive it, either first or after the other parameters. It isn't a JavaScript argument, so the other parameters still convert from the page's arguments as usual:
return (double)info.arg_count();
};
Details of a call to a bound function: the context, this, and the raw arguments.
Definition CallInfo.h:41
Declare only one. With a trailing js::Resolver the order is (arguments..., CallInfo, Resolver).
- Note
- A CallInfo and the js::Arg values it gives you are valid only during the call (in a js::Task, until the Task finishes). Use Arg::ToValue() to keep an argument. You can keep the Context that context() returns.
- Note
- A function that takes a CallInfo receives every argument the page passes, so Strict diagnostics don't reject extra arguments for it (see js::Diagnostics).