JS_ObjectIsFunction 编辑
Test whether a given object is a Function
.
Syntax
bool
JS_ObjectIsFunction(JSContext *cx, JSObject *obj);
Name | Type | Description |
---|---|---|
cx | JSContext * | A context. |
obj | JSObject * | The object to test. This must not be NULL . |
Description
JS_ObjectIsFunction
tests whether obj
is a function object (faster than comparing obj's class name to Function
, but equivalent unless someone has overwritten the Function
identifier with a different constructor and then created instances using that constructor that might be passed in as obj
).
JS_ObjectIsFunction
returns true
if obj
is a Function
and false
otherwise.
If JS_ObjectIsFunction
returns true
, JS_ValueToFunction
will always return non-null. JS_ObjectIsFunction
always succeeds. Note that the result may be false
even for some callable objects, such as regular expression objects or proxy objects
See Also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论