Update Range and Progression built-in implementations in js library.

No need to define special method mapping for js ranges/progressions.
Support progression companion objects' function fromClosedRange as intrinsic
This commit is contained in:
Ilya Gorbunov
2015-11-06 22:32:27 +03:00
parent 55d4d17dc3
commit af9020a010
9 changed files with 296 additions and 128 deletions
@@ -20,14 +20,6 @@ fun box(): String {
n++
assertEquals(4, n)
// http://youtrack.jetbrains.com/issue/KT-4381
// JS: fails to iterate over Double range
var nd = 0.0
for (i in 0.0 .. 10.0) {
nd += i
}
assertEquals(55.0, nd)
// Evaluation order
for (i in up("A", 0)..up("B", 5)) {
}
@@ -53,10 +45,6 @@ fun box(): String {
sLong += i
assertEquals(55L, sLong)
var sDouble = 0.0
for(i in 0L..10.0)
sDouble += i
assertEquals(55.0, sDouble)
return "OK"
}
@@ -18,11 +18,5 @@ fun box(): String {
sLong += i
assertEquals(55L, sLong)
var sDouble = 0.0
var rDouble = 0L..10.0
for(i in rDouble)
sDouble += i
assertEquals(55.0, sDouble)
return "OK"
}