Entry: JS_ValueToFunction (Function)
Summary: Converts a JS value to a JS function.
Syntax:
JSFunction * JS_ValueToFunction(JSContext *cx, jsval v);
Argument Type Description
cx JSContext * Pointer to a JS context from which to derive runtime information.
v jsval The JS value to convert.
Description:
JS_ValueToFunction converts a specified JS value, v, to a JS function. The actual conversion is performed by the object's convert operation. JS_ValueToFunction returns a pointer to the converted function.
Converting a JS value to a function succeeds if the value is an object for which a function class has been defined, or if the JS value is already a function. If conversion fails, JS_ValueToFunction returns NULL.
See also:
|
|
|