MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / ListIteratorConstructor

Function ListIteratorConstructor

src/PyListProxyHandler.cc:1871–1886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1869};
1870
1871static bool ListIteratorConstructor(JSContext *cx, unsigned argc, JS::Value *vp) {
1872 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
1873
1874 if (!args.isConstructing()) {
1875 JS_ReportErrorASCII(cx, "You must call this constructor with 'new'");
1876 return false;
1877 }
1878
1879 JS::RootedObject thisObj(cx, JS_NewObjectForConstructor(cx, &listIteratorClass, args));
1880 if (!thisObj) {
1881 return false;
1882 }
1883
1884 args.rval().setObject(*thisObj);
1885 return true;
1886}
1887
1888static bool DefineListIterator(JSContext *cx, JS::HandleObject global) {
1889 JS::RootedObject iteratorPrototype(cx);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected