Deprecated since JavaScript 1.8.5
This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Retrieve the given name for a specified function. Use JS_GetFunctionId instead.

Syntax

const char *
JS_GetFunctionName(JSFunction *fun);
Name Type Description
fun JSFunction * A pointer to a JavaScript function.

Description

JS_GetFunctionName retrieves the function name associated with a function pointer, fun. The return value is either the name of a function, or the string "anonymous", which indicates that the function was not assigned a name when created.

The pointer returned by this function is valid only as long as the specified function, fun, exists.

See Also