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:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user