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

Function DefineIterableIterator

src/PyIterableProxyHandler.cc:156–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156static bool DefineIterableIterator(JSContext *cx, JS::HandleObject global) {
157 JS::RootedObject iteratorPrototype(cx);
158 if (!JS_GetClassPrototype(cx, JSProto_Iterator, &iteratorPrototype)) {
159 return false;
160 }
161
162 JS::RootedObject protoObj(cx,
163 JS_InitClass(cx, global,
164 nullptr, iteratorPrototype,
165 "IterableIterator",
166 IterableIteratorConstructor, 0,
167 nullptr, iterable_iterator_methods,
168 nullptr, nullptr)
169 );
170
171 return protoObj; // != nullptr
172}
173
174static bool iterable_values(JSContext *cx, unsigned argc, JS::Value *vp) {
175 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);

Callers 1

iterable_valuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected