Fix js RangeIterator and NumberProgression.

This commit is contained in:
Ilya Ryzhenkov
2014-03-21 22:32:56 +04:00
committed by Andrey Breslav
parent df310ac362
commit 962a738f1e
+6 -3
View File
@@ -481,7 +481,10 @@
return value;
},
hasNext: function () {
return this.i <= this.end;
if (this.increment > 0)
return this.i <= this.end;
else
return this.i >= this.end;
}
});
@@ -495,11 +498,11 @@
return this.start <= number && number <= this.end;
},
iterator: function () {
return new Kotlin.RangeIterator(this.start, this.end);
return new Kotlin.RangeIterator(this.start, this.end, this.increment);
}
});
Kotlin.Progression = Kotlin.createClassNow(null,
Kotlin.NumberProgression = Kotlin.createClassNow(null,
function (start, end, increment) {
this.start = start;
this.end = end;