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

Function DefineBytesIterator

src/PyBytesProxyHandler.cc:175–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175static bool DefineBytesIterator(JSContext *cx, JS::HandleObject global) {
176 JS::RootedObject iteratorPrototype(cx);
177 if (!JS_GetClassPrototype(cx, JSProto_Iterator, &iteratorPrototype)) {
178 return false;
179 }
180
181 JS::RootedObject protoObj(cx,
182 JS_InitClass(cx, global,
183 nullptr, iteratorPrototype,
184 "BytesIterator",
185 BytesIteratorConstructor, 0,
186 nullptr, bytes_iterator_methods,
187 nullptr, nullptr)
188 );
189
190 return protoObj; // != nullptr
191}
192
193/// private util
194static bool array_iterator_func(JSContext *cx, unsigned argc, JS::Value *vp, int itemKind) {

Callers 1

array_iterator_funcFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected