JSHasInstanceOp 编辑
JSHasInstanceOp
is the type of JSClass.hasInstance
.
Syntax
typedef bool
(* JSHasInstanceOp)(JSContext *cx, JS::HandleObject obj, JS::MutableHandleValue vp,
bool *bp);
Name | Type | Description |
---|---|---|
cx | JSContext * | The JS context in which the type check is occurring. |
obj | JS::HandleObject | The "type" in the type check. |
v | JS::MutableHandleValue | The value whose type is being checked. |
bp | bool * | Out parameter. On success, the callback stores the result of the type check in *bp . |
Description
JSHasInstanceOp
is called to check whether v
is an instance of obj
. Return false
on error or exception, true
on success with true
in *bp
if v
is an instance of obj
, false
in *bp
otherwise.
JSClass hooks
JSClass offers the following hook:
The
JSClass.hasInstance
callback implementsJS_HasInstance
and the JavaScriptinstanceof
keyword.
See Also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论