Resolve a standard class in an object.
bool JS_ResolveStandardClass(JSContext *cx, JS::HandleObject obj, JS::HandleId id, bool *resolved);
||Pointer to the executable script context for which to initialize JS function and object classes. Requires request. In a
||An object to resolve id to a standard class.|
||An id of a standard class name, which must contain either a string or an int.|
||Out parameter. If the id is resolved,
id, which must contain either a string or an int, to a standard class name in
obj if possible, defining the class's constructor and/or prototype and storing
id does not name a standard class or a top-level property induced by initializing a standard class, store
*resolved and just return
false on error, as usual for bool result-typed API entry points.
This API can be called directly from a global object class's resolve op, to define standard classes lazily. The class's enumerate op should call
, to define eagerly during
for...in loops any classes not yet resolved lazily.