public Object next() {
   if (!iterator.hasNext()) {
     // Out of values. Throw StopIteration.
     throw new JavaScriptException(NativeIterator.getStopIterationObject(scope), null, 0);
   }
   return iterator.next();
 }
 private Object next(Context cx, Scriptable scope) {
   Boolean b = ScriptRuntime.enumNext(this.objectIterator);
   if (!b.booleanValue()) {
     // Out of values. Throw StopIteration.
     throw new JavaScriptException(NativeIterator.getStopIterationObject(scope), null, 0);
   }
   return ScriptRuntime.enumId(this.objectIterator, cx);
 }