Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

JSIteratorOp

This article needs a technical review. How you can help.

Obsolete since JSAPI 26
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

This article covers features introduced in SpiderMonkey 1.8

Callback for creating iterators.

Syntax

typedef JSObject *
(*JSIteratorOp)(JSContext *cx, JSObject *obj, JSBool keysonly);
Name Type Description
cx JSContext * Pointer to the JS context in which the iterator creation should take place.
obj JSObject * Pointer to the object to iterate over.
keysonly JSBool If true, the iterator should yield keys only, not [key, value] pairs.

Description

The JavaScript engine calls the JSExtendedClass.iteratorObject callback to create an iterator object for a given object. The callback should return an iterator object or NULL if an error or exception occurred on cx.

See Also

Document Tags and Contributors

 Contributors to this page: kscarfone, arai
 Last updated by: kscarfone,