| 1886 | } |
| 1887 | |
| 1888 | static bool DefineListIterator(JSContext *cx, JS::HandleObject global) { |
| 1889 | JS::RootedObject iteratorPrototype(cx); |
| 1890 | if (!JS_GetClassPrototype(cx, JSProto_Iterator, &iteratorPrototype)) { |
| 1891 | return false; |
| 1892 | } |
| 1893 | |
| 1894 | JS::RootedObject protoObj(cx, |
| 1895 | JS_InitClass(cx, global, |
| 1896 | nullptr, iteratorPrototype, |
| 1897 | "ListIterator", |
| 1898 | ListIteratorConstructor, 0, |
| 1899 | nullptr, list_iterator_methods, |
| 1900 | nullptr, nullptr) |
| 1901 | ); |
| 1902 | |
| 1903 | return protoObj; // != nullptr |
| 1904 | } |
| 1905 | |
| 1906 | // private util |
| 1907 | static bool array_iterator_func(JSContext *cx, unsigned argc, JS::Value *vp, int itemKind) { |
no outgoing calls
no test coverage detected