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);
NameTypeDescription
funJSFunction *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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:88 次

字数:2533

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文