JavaScript-1.5 Reference

JS_CallFunctionName Function

Summary

Calls a function-valued property belonging to an object.

Syntax

JSBool JS_CallFunctionName(JSContext *cx, JSObject *obj,
    const char *name, uintN argc, jsval *argv, jsval *rval);
NameTypeDescription
cxJSContext *Pointer to a JS context from which to derive runtime information.
objJSObject *The object containing the method to execute.
nameconst char *The name of the function to execute.
argcuintNNumber of arguments you are passing to the function.
argvjsval *Pointer to the array of argument values to pass to the function.
rvaljsval *Pointer to a variable to hold the return value from the function call.

Description

JS_CallFunctionName executes a function-valued property, name, belonging to a specified JS object, obj.

In argc, indicate the number of arguments passed to the function. In argv, pass a pointer to the actual argument values to use. There should be one value for each argument you pass to the function; the number of arguments you pass may be different from the number of arguments defined for the function.by the function.

rval is a pointer to a variable that will hold the function's return value, if any, on successful function execution.

If the called function executes successfully, JS_CallFunctionName returns JS_TRUE. Otherwise it returns JS_FALSE, and rval is undefined.

Notes

To call a function stored in a jsval, use JS_CallFunctionValue.

See Also

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JS_CallFunction | JS_CallFunctionValue | JS_CompileFunction | JS_DecompileFunction | JS_DecompileFunctionBody | JS_DefineFunction | JS_DefineFunctions | JS_GetFunctionObject | JS_NewFunction | JS_SetBranchCallback | JS_ValueToFunction ]

This page was generated by APIDOC