JS backend: fix KT-6112 jsonFromTuples is broken

#KT-6112 Fixed
This commit is contained in:
Michael Nedzelsky
2014-12-18 15:52:13 +03:00
parent 0abf56c9ac
commit 8074ab27ea
4 changed files with 47 additions and 15 deletions
+7 -5
View File
@@ -5,11 +5,13 @@ native public class Json() {
public fun set(propertyName: String, value: Any?): Unit = noImpl
}
library("jsonFromTuples")
public fun json(vararg pairs: Pair<String, Any?>): Json = noImpl
library("jsonFromTuples")
public fun json2(pairs: Array<Pair<String, Any?>>): Json = noImpl
public fun json(vararg pairs: Pair<String, Any?>): Json {
var res: dynamic = js("({})")
for((name, value) in pairs) {
res[name] = value
}
return res
}
library("jsonAddProperties")
public fun Json.add(other: Json): Json = noImpl