JSClass.hasInstance

Obsolete since JavaScript 1.8.5
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.

The JSClass.hasInstance callback implements JS_HasInstance and the JavaScript instanceof keyword. (Right?)

Syntax

typedef JSBool (*JSHasInstanceOp)(JSContext *cx, JSObject *obj, jsval v,
    JSBool *bp);
Name Type Description
cx JSContext * The JS context in which the type check is occurring.
obj JSObject * The "type" in the type check.
v jsval The value whose type is being checked.
bp JSBool * Out parameter. On success, the callback stores the result of the type check in *bp.

Description

Check whether v is an instance of obj. Return JS_FALSE on error or exception, JS_TRUE on success with JS_TRUE in *bp if v is an instance of obj, JS_FALSE in *bp otherwise.

Document Tags and Contributors

Contributors to this page: tschneidereit, Jorend
Last updated by: tschneidereit,