Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

JS_GetFunctionFlags

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.

Syntax

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

Description

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.

JSFUN_GENERIC_NATIVE

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

JSFUN_HEAVYWEIGHT

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

JSFUN_LAMBDA

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

JSFUN_CONSTRUCTOR

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,