This article covers features introduced in SpiderMonkey 17
Bind the given callable to use the given object as this.
Syntax
JSObject*
JS_BindCallable(JSContext *cx, JS::Handle<JSObject*> callable,
                JS::Handle<JSObject*> newThis);
| Name | Type | Description | 
|---|---|---|
| cx | JSContext * | Pointer to a JS context from which to derive runtime information. Requires request. In a JS_THREADSAFEbuild, the caller must be in a request on thisJSContext. | 
| callable | JS::Handle<JSObject*> | Pointer to the function object to bind new this. | 
| newThis | JS::Handle<JSObject*> | Pointer to the new thisvalue forcallable. | 
Description
JS_BindCallable binds the given callable to use the given object as this.
If callable is not callable, will throw and return nullptr.