Merge remote-tracking branch 'origin/master'

This commit is contained in:
Pavel V. Talanov
2012-07-04 20:59:26 +04:00
@@ -5,11 +5,12 @@ import java.util.NoSuchElementException
// TODO should not need this - its here for the JS stuff
import java.lang.UnsupportedOperationException
public enum class State {
Ready
NotReady
Done
Failed
// not using an enum for now as JS generation doesn't support it
public object State {
val Ready = 0
val NotReady = 1
val Done = 2
val Failed = 3
}
/**
@@ -17,7 +18,7 @@ public enum class State {
* to implement the iterator, calling [[done()]] when the iteration is complete.
*/
public abstract class AbstractIterator<T>: java.util.Iterator<T> {
private var state: State = State.NotReady
private var state = State.NotReady
private var next: T? = null
override fun hasNext(): Boolean {
@@ -111,7 +112,7 @@ class CompositeIterator<T>(vararg iterators: java.util.Iterator<T>): AbstractIte
val iter = currentIter
if (iter != null) {
if (iter.hasNext()) {
setNext(iter.next())
setNext(iter.next()!!)
return
} else {
currentIter = null