Revert 'isEmpty' transformation

This commit is contained in:
Denis Zharkov
2015-10-13 20:49:31 +03:00
committed by Mikhail Glukhikh
parent 17c906658d
commit 6322198a11
71 changed files with 127 additions and 156 deletions
+1 -1
View File
@@ -5,5 +5,5 @@ import java.util.ArrayList;
fun box(): Boolean {
val a = ArrayList<Int>();
a.add(3)
return !(a.isEmpty) && (ArrayList<Int>().isEmpty);
return !(a.isEmpty()) && (ArrayList<Int>().isEmpty());
}
+2 -2
View File
@@ -28,7 +28,7 @@ fun box(): Boolean {
return false
}
if (a.isEmpty || !ArrayList<Int>().isEmpty) {
if (a.isEmpty() || !ArrayList<Int>().isEmpty()) {
return false
}
@@ -39,7 +39,7 @@ fun box(): Boolean {
assertEquals(a, b, "a == b")
a.clear()
assertEquals(true, a.isEmpty, "a.isEmpty")
assertEquals(true, a.isEmpty(), "a.isEmpty()")
assertEquals(arrayOf(1, 500, 2, 3), list.toTypedArray(), "list.toTypedArray()")
+3 -5
View File
@@ -398,10 +398,8 @@
}
return true;
},
isEmpty: {
get: function () {
return this.size === 0;
}
isEmpty: function () {
return this.size === 0;
},
iterator: function () {
// TODO: Do not implement mutable iterator() this way, make abstract
@@ -972,7 +970,7 @@
});
Kotlin.collectionsMax = function (c, comp) {
if (c.isEmpty) {
if (c.isEmpty()) {
//TODO: which exception?
throw new Error();
}
+11 -17
View File
@@ -347,11 +347,9 @@
bucketsByHash = {};
};
Object.defineProperty(this, "isEmpty", {
get: function () {
return !buckets.length;
}
});
this.isEmpty = function () {
return !buckets.length;
};
var createBucketAggregator = function (bucketFuncName) {
return function () {
@@ -574,10 +572,8 @@
iterator: function () {
return new Kotlin.PrimitiveHashMapValuesIterator(this.map.map, Object.keys(this.map.map));
},
isEmpty: {
get: function () {
return this.map.isEmpty;
}
isEmpty: function () {
return this.map.isEmpty();
},
size: {
get: function () {
@@ -608,10 +604,8 @@
return this.$size;
}
},
isEmpty: {
get: function () {
return this.$size === 0;
}
isEmpty: function () {
return this.$size === 0;
},
containsKey_za3rmp$: function (key) {
// TODO: should process "__proto__" separately?
@@ -691,7 +685,7 @@
return this.map;
},
toString: function() {
if (this.isEmpty) return "{}";
if (this.isEmpty()) return "{}";
var map = this.map;
var isFirst = true;
var builder = "{";
@@ -1067,9 +1061,9 @@
return hashTable.size;
}});
Object.defineProperty(this, "isEmpty", { get: function () {
return hashTable.isEmpty;
}});
this.isEmpty = function () {
return hashTable.isEmpty();
};
this.clone = function () {
var h = new HashSet(hashingFunction, equalityFunction);
@@ -11,7 +11,7 @@ fun box(): String {
assertTrue((stdlib_emptyListClass() as Any) is List<*>, "stdlib_emptyListClass() is List<*> #2")
assertTrue((stdlib_emptyListClass() as Any) !is ArrayList<*>, "stdlib_emptyListClass() !is ArrayList<*>")
assertTrue(stdlib_emptyListClass().isEmpty, "stdlib_emptyListClass().isEmpty")
assertTrue(stdlib_emptyListClass().isEmpty(), "stdlib_emptyListClass().isEmpty()")
assertTrue(stdlib_emptyListClass().size() == 0, "stdlib_emptyListClass().size() == 0")
return "OK"