| 173 | } |
| 174 | |
| 175 | static 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 |
| 194 | static bool array_iterator_func(JSContext *cx, unsigned argc, JS::Value *vp, int itemKind) { |
no outgoing calls
no test coverage detected