Dropped get_hasNext (hasNext property) from js library files.

This commit is contained in:
develar
2013-06-21 16:21:28 +04:00
committed by Zalim Bashorov
parent 9d1e319f0f
commit 7f1f2aa641
3 changed files with 10 additions and 19 deletions
+3 -9
View File
@@ -116,9 +116,6 @@ var kotlin = {set:function (receiver, key, value) {
next: function () {
return this.array[this.index++];
},
get_hasNext: function () {
return this.index < this.size;
},
hasNext: function () {
return this.index < this.size;
}
@@ -132,9 +129,6 @@ var kotlin = {set:function (receiver, key, value) {
},
next: function () {
return this.list.get(this.index++);
},
get_hasNext: function () {
return this.index < this.size;
}
});
@@ -379,8 +373,8 @@ var kotlin = {set:function (receiver, key, value) {
this.set_i(this.$i + this.$increment);
return value;
},
get_hasNext: function () {
return this.$increment > 0 ? this.$next <= this.$end : this.$next >= this.$end;
hasNext: function () {
return this.get_count() > 0;
}
});
@@ -449,7 +443,7 @@ var kotlin = {set:function (receiver, key, value) {
throw Kotlin.Exception();
}
var max = it.next();
while (it.get_hasNext()) {
while (it.hasNext()) {
var el = it.next();
if (comp.compare(max, el) < 0) {
max = el;
@@ -175,12 +175,9 @@ var Kotlin = Object.create(null);
initializer = value;
}
else if (name.indexOf("get_") === 0) {
// our std lib contains collision: hasNext property vs hasNext as function, we prefer function (actually, it does work)
var getterName = name.substring(4);
if (!descriptors.hasOwnProperty(getterName)) {
descriptors[getterName] = {get: value};
descriptors[name] = {value: value};
}
descriptors[name.substring(4)] = {get: value};
// std lib code can refers to
descriptors[name] = {value: value};
}
else if (name.indexOf("set_") === 0) {
descriptors[name.substring(4)] = {set: value};
+4 -4
View File
@@ -404,7 +404,7 @@ Kotlin.ComplexHashMap = Kotlin.HashMap;
next: function () {
return this.map[this.keys[this.index++]];
},
get_hasNext: function () {
hasNext: function () {
return this.index < this.size;
}
});
@@ -595,8 +595,8 @@ Kotlin.PrimitiveHashSet = Kotlin.$createClass(Kotlin.AbstractCollection, {
var iter1 = this.iterator();
var iter2 = o.iterator();
while (true) {
var hn1 = iter1.get_hasNext();
var hn2 = iter2.get_hasNext();
var hn1 = iter1.hasNext();
var hn2 = iter2.hasNext();
if (hn1 != hn2) return false;
if (!hn2)
return true;
@@ -614,7 +614,7 @@ Kotlin.PrimitiveHashSet = Kotlin.$createClass(Kotlin.AbstractCollection, {
var builder = "[";
var iter = this.iterator();
var first = true;
while (iter.get_hasNext()) {
while (iter.hasNext()) {
if (first)
first = false;
else