JS_BindCallable

This article needs a technical review. How you can help.

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_THREADSAFE build, the caller must be in a request on this JSContext.
callable JS::Handle<JSObject*> Pointer to the function object to bind new this.
newThis JS::Handle<JSObject*> Pointer to the new this value for callable.

Description

JS_BindCallable binds the given callable to use the given object as this.

If callable is not callable, will throw and return nullptr.

See Also

Document Tags and Contributors

 Contributors to this page: kscarfone, arai
 Last updated by: kscarfone,