Obsolete since JSAPI 19
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

Retrieve the function flags of a given JavaScript function.


unsigned int
JS_GetFunctionFlags(JSFunction *fun);
Name Type Description
fun JSFunction * The function to examine.


JS_GetFunctionFlags retrieves the function flags of a given JavaScript function, fun. These flags are for the JavaScript engine’s internal use. Most applications can’t do anything useful with them.

Function flags are a value of type unsigned int, the bitwise OR of zero or more of the JSFUN flags described below. Once a function is created, its flags cannot be modified.


The function is an Array generic, such as Array.map.


The function uses language features such as closures, with, or eval that require extra work on the part of the interpreter.


The function is a JavaScript function written as a FunctionExpression rather than a FunctionDeclaration, a syntactic distinction. See ECMA 262-3 §13.


The function is native can be used as a constructor with the new keyword. (The meaning of this flag may change.)

See Also

Document Tags and Contributors

 Contributors to this page: teoli, arai, fscholz, Jorend, Jimb
 Last updated by: teoli,