Update IR Runtime
This commit is contained in:
@@ -85,4 +85,27 @@ fun getNumberHashCode(obj: dynamic) = js("""
|
||||
}
|
||||
""").unsafeCast<Int>()
|
||||
|
||||
fun identityHashCode(obj: dynamic): Int = getObjectHashCode(obj)
|
||||
fun identityHashCode(obj: dynamic): Int = getObjectHashCode(obj)
|
||||
|
||||
|
||||
@JsName("captureStack")
|
||||
internal fun captureStack(instance: Throwable) {
|
||||
if (js("Error").captureStackTrace) {
|
||||
js("Error").captureStackTrace(instance, instance::class.js);
|
||||
} else {
|
||||
instance.asDynamic().stack = js("new Error()").stack;
|
||||
}
|
||||
}
|
||||
|
||||
@JsName("newThrowable")
|
||||
internal fun newThrowable(message: String?, cause: Throwable?): Throwable {
|
||||
val throwable = js("new Error()")
|
||||
throwable.message = if (message == null) {
|
||||
if (cause != null) js("cause.toString()") else null
|
||||
} else {
|
||||
message
|
||||
}
|
||||
throwable.cause = cause
|
||||
throwable.name = "Throwable"
|
||||
return throwable
|
||||
}
|
||||
Reference in New Issue
Block a user