Firefox, prior to version 26 implemented another iterator protocol that is similar to the standard ES2015 Iterator protocol.
The legacy generator function statement declares legacy generator functions with the specified parameters.
The Iterator function returns an object which implements legacy iterator protocol and iterates over enumerable properties of an object.
The function keyword can be used to define a legacy generator function inside an expression. To make the function a legacy generator, the function body should contain at least one yield expression.
The StopIteration object is used to tell the end of the iteration in the legacy iterator protocol.