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

Function BytesIteratorConstructor

src/PyBytesProxyHandler.cc:158–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156};
157
158static bool BytesIteratorConstructor(JSContext *cx, unsigned argc, JS::Value *vp) {
159 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
160
161 if (!args.isConstructing()) {
162 JS_ReportErrorASCII(cx, "You must call this constructor with 'new'");
163 return false;
164 }
165
166 JS::RootedObject thisObj(cx, JS_NewObjectForConstructor(cx, &bytesIteratorClass, args));
167 if (!thisObj) {
168 return false;
169 }
170
171 args.rval().setObject(*thisObj);
172 return true;
173}
174
175static bool DefineBytesIterator(JSContext *cx, JS::HandleObject global) {
176 JS::RootedObject iteratorPrototype(cx);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected