Add *Range.isEmpty(), *Progression.isEmpty()

This commit is contained in:
Alexander Udalov
2014-06-16 18:50:16 +04:00
parent 07378a74d3
commit 751f062f23
8 changed files with 90 additions and 0 deletions
+6
View File
@@ -543,6 +543,9 @@
},
iterator: function () {
return new Kotlin.RangeIterator(this.start, this.end, this.increment);
},
isEmpty: function () {
return this.start > this.end;
}
});
@@ -554,6 +557,9 @@
}, {
iterator: function () {
return new Kotlin.RangeIterator(this.start, this.end, this.increment);
},
isEmpty: function() {
return this.increment > 0 ? this.start > this.end : this.start < this.end;
}
});