JS_ObjectIsFunction

Test whether a given object is a Function.

Syntax

JSBool JS_ObjectIsFunction(JSContext *cx, JSObject *obj);
Name Type Description
cx JSContext * A context.
obj JSObject * The object to test. This must not be NULL.

Description

JS_ObjectIsFunction returns JS_TRUE if obj is a Function and JS_FALSE otherwise. If JS_ObjectIsFunction returns JS_TRUE, JS_ValueToFunction will always return non-null. JS_ObjectIsFunction always succeeds. Note that the result may be JS_FALSE even for some callable objects, such as regular expression objects or proxy objects

MXR ID Search for JS_ObjectIsFunction

Document Tags and Contributors

Contributors to this page: Benjamin Smedberg, MMondor, Jorend, Bzbarsky
Last updated by: Benjamin Smedberg,