JavaScript-1.5 Reference

JS_ValueToFunction Function

Summary

Converts a JS value to a JS function.

Syntax

JSFunction * JS_ValueToFunction(JSContext *cx, jsval v);
NameTypeDescription
cxJSContext *Pointer to a JS context from which to derive runtime information.
vjsvalThe 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

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JS_ConvertArguments | JS_ConvertValue | JS_GetTypeName | JS_TypeOfValue | JS_ValueToBoolean | JS_ValueToInt32 | JS_ValueToNumber | JS_ValueToObject | JS_ValueToString ]

This page was generated by APIDOC