typedef JSBool (*JSNewResolveOp)(JSContext *cx, JSObject *obj, jsval id, uintN flags, JSObject **objp);
||Pointer to the JS context in which the property access is taking place.|
||Pointer to the object whose properties are being accessed.|
||Name or index of the property being accessed.|
||Flags giving contextual information about the ongoing property access.|
||Out parameter. On success, the resolve hook must set
flags provide contextual information about the property access.
On success, the callback must set the
*objp out parameter to null if
id was not resolved; or non-null, referring to
obj or one of its prototypes, if
id was resolved; and return
JS_TRUE. On failure, it must return
JSCLASS_NEW_RESOLVE_GETS_START further extends this hook by passing in the starting object on the prototype chain via
*objp. Thus a resolve hook implementation may define the property id being resolved in the object in which the id was first sought, rather than in a prototype object whose class led to the resolve hook being called.
JSCLASS_NEW_RESOLVE_GETS_START, the resolve hook must therefore null
*objp to signify "not resolved". With only
JSCLASS_NEW_RESOLVE and no
JSCLASS_NEW_RESOLVE_GETS_START, the hook can assume
*objp is null on entry. This is not good practice, but enough existing hook implementations count on it that we can't break compatibility by passing the starting object in
*objp without a new
flags argument is the logical OR of zero or more of the following flags. The flags describe what kind of property access triggered the
resolve callback. (The same flags are used in
JSRESOLVE_QUALIFIEDObsolete since JSAPI 20
The property access uses the
- The property appears on the left-hand side of an assignment.
JSRESOLVE_DETECTINGObsolete since JSAPI 20
The property is being used in code like "
if (o.p)...", or a similar idiom where the apparent purpose of the property access is to detect whether the property exists. (This flag has been replaced with the
JSRESOLVE_DECLARINGObsolete since JSAPI 15
The property is being declared in a
- class name used when constructing.
The lookup is occurring for a name evaluated inside a