JS backend: implemented PrimitiveHashMap#putAll.
This commit is contained in:
@@ -472,7 +472,13 @@ Kotlin.ComplexHashMap = Kotlin.HashMap;
|
|||||||
this.map = {};
|
this.map = {};
|
||||||
},
|
},
|
||||||
putAll: function (fromMap) {
|
putAll: function (fromMap) {
|
||||||
throw Kotlin.$new(Kotlin.UnsupportedOperationException)();
|
var map = fromMap.map;
|
||||||
|
for (var key in map) {
|
||||||
|
if (map.hasOwnProperty(key)) {
|
||||||
|
this.map[key] = map[key];
|
||||||
|
this.$size++;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
keySet: function () {
|
keySet: function () {
|
||||||
var result = Kotlin.$new(Kotlin.PrimitiveHashSet)();
|
var result = Kotlin.$new(Kotlin.PrimitiveHashSet)();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import kotlin.test.*
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
import org.junit.Test as test
|
import org.junit.Test as test
|
||||||
|
|
||||||
|
// TODO: Write test generator for testing `Map` implementations.
|
||||||
class MapJsTest {
|
class MapJsTest {
|
||||||
//TODO: replace `array(...).toList()` to `listOf(...)`
|
//TODO: replace `array(...).toList()` to `listOf(...)`
|
||||||
val KEYS = array("zero", "one", "two", "three").toList()
|
val KEYS = array("zero", "one", "two", "three").toList()
|
||||||
|
|||||||
Reference in New Issue
Block a user