Minor in JS backend: added regression tests.

#{KT-2219, KT-2470, KT-2507, KT-2222, KT-2995, KT-2221} Obsolete
This commit is contained in:
Zalim Bashorov
2014-03-13 21:40:29 +04:00
parent 604e062f91
commit 7b503bbe6f
15 changed files with 182 additions and 36 deletions
@@ -0,0 +1,24 @@
// KT-2470 another name mangling bug: kotlin.test.failsWith() gets generated to invalid JS
package foo
native val Exception.message: String = noImpl
public fun <T : Throwable> failsWith(block: () -> Any): T {
try {
block()
}
catch (e: T) {
return e
}
throw Exception("Should have failed")
}
fun box(): String {
val a = failsWith<Exception> {
throw Exception("OK")
}
return a.message
}