Description
JS_ContextIterator enables you to cycle through all the executable script contexts associated with a specified JS run-time environment, rt . Each call to JS_ContextIterator cycles from the current context to the previous context.
The first time you call JS_ContextIterator , iterp can point to a null-valued context pointer, or it can point to a known context pointer associated with the specified runtime. If you point iterp at a null-valued context pointer, the function automatically determines the first executable script context for the runtime, and makes it the "current" context for the function. If you set iterp to a valid context pointer, that context becomes the "current" context. If the "current" context matches the starting address of the runtime environment's context list, then there are no context established, and JS_ContextIterator returns NULL . Otherwise JS_ContextIterator points iterp to the previous context pointer in the context chain, and returns that pointer.
In effect, by making repeated calls to JS_ContextIterator you can cycle through all executable script contexts for a given runtime, and perform common operations on each them.
|