[JS IR] Add test with member with JsName and default argument
^KT-44796 fixed
This commit is contained in:
committed by
TeamCityServer
parent
a7f8f0d903
commit
30a024d05d
@@ -7,6 +7,7 @@ module.exports = function() {
|
|||||||
var transform = api.transform;
|
var transform = api.transform;
|
||||||
var Ping = api.Ping;
|
var Ping = api.Ping;
|
||||||
var Pong = api.Pong;
|
var Pong = api.Pong;
|
||||||
|
var Foo = api.Foo;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"ping00": ping(),
|
"ping00": ping(),
|
||||||
@@ -26,7 +27,8 @@ module.exports = function() {
|
|||||||
"Ping_ping00b": new Ping(10).ping(),
|
"Ping_ping00b": new Ping(10).ping(),
|
||||||
"Ping_ping11": new Ping().ping(-4, function(it) { return it * it * it }),
|
"Ping_ping11": new Ping().ping(-4, function(it) { return it * it * it }),
|
||||||
|
|
||||||
"Pong_ping00": new Pong().ping()
|
"Pong_ping00": new Pong().ping(),
|
||||||
|
"Foo": new Foo().foo()
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,12 @@ fun bing(a: String = "A", b: Int = 1): String {
|
|||||||
return "$b::$a"
|
return "$b::$a"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsExport
|
||||||
|
class Foo {
|
||||||
|
@JsName("foo")
|
||||||
|
fun value(value: Long = 5L) = if (value == 5L) "C" else "fail"
|
||||||
|
}
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
fun transform(i: Int = 10, t: (Int) -> Int = {it * it}): Int {
|
fun transform(i: Int = 10, t: (Int) -> Int = {it * it}): Int {
|
||||||
return t(i)
|
return t(i)
|
||||||
@@ -49,6 +55,8 @@ external interface JsResult {
|
|||||||
val Ping_ping11: Int
|
val Ping_ping11: Int
|
||||||
|
|
||||||
val Pong_ping00: Int
|
val Pong_ping00: Int
|
||||||
|
|
||||||
|
val Foo: String
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsModule("lib")
|
@JsModule("lib")
|
||||||
@@ -102,5 +110,9 @@ fun box(): String {
|
|||||||
return "fail13: ${res.Pong_ping00}"
|
return "fail13: ${res.Pong_ping00}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (res.Foo != "C") {
|
||||||
|
return "fail14: ${res.Foo}"
|
||||||
|
}
|
||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user