mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
Bug 1225392 part 1. Expose JSAPI for getting %IteratorPrototype%. r=efaust
This commit is contained in:
parent
ebd689a328
commit
c0a3244687
@ -1220,6 +1220,14 @@ JS_GetErrorPrototype(JSContext* cx)
|
||||
return GlobalObject::getOrCreateCustomErrorPrototype(cx, global, JSEXN_ERR);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSObject*)
|
||||
JS_GetIteratorPrototype(JSContext* cx)
|
||||
{
|
||||
CHECK_REQUEST(cx);
|
||||
Rooted<GlobalObject*> global(cx, cx->global());
|
||||
return GlobalObject::getOrCreateIteratorPrototype(cx, global);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSObject*)
|
||||
JS_GetGlobalForObject(JSContext* cx, JSObject* obj)
|
||||
{
|
||||
|
@ -1503,6 +1503,13 @@ JS_GetArrayPrototype(JSContext* cx, JS::HandleObject forObj);
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
JS_GetErrorPrototype(JSContext* cx);
|
||||
|
||||
/**
|
||||
* Returns the %IteratorPrototype% object that all built-in iterator prototype
|
||||
* chains go through for the global object of the current compartment of cx.
|
||||
*/
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
JS_GetIteratorPrototype(JSContext* cx);
|
||||
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
JS_GetGlobalForObject(JSContext* cx, JSObject* obj);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user