[JS IR BE] Set Throwable subtype name in extendThrowable function

This commit is contained in:
Svyatoslav Kuzmich
2019-07-04 19:05:41 +03:00
parent 4379780ff8
commit 675f01ee80
2 changed files with 6 additions and 28 deletions
@@ -97,11 +97,16 @@ internal fun extendThrowable(this_: dynamic, message: String?, cause: Throwable?
js("Error").call(this_)
this_.message = message ?: cause?.toString() ?: undefined
this_.cause = cause
this_.name = JsObject.getPrototypeOf(this_).constructor.name
captureStack(this_)
}
@JsName("Object")
internal external class JsObject
internal external class JsObject {
companion object {
fun getPrototypeOf(obj: Any?): dynamic
}
}
internal fun <T, R> boxIntrinsic(x: T): R = error("Should be lowered")
internal fun <T, R> unboxIntrinsic(x: T): R = error("Should be lowered")