JS_IR: DCE
Could be enabled by toggling `-Xir-dce` Box test output in js/js.translator/testData/out-min
This commit is contained in:
@@ -55,7 +55,7 @@ fun hashCode(obj: dynamic): Int {
|
||||
}
|
||||
}
|
||||
|
||||
private var POW_2_32 = 4294967296
|
||||
private var POW_2_32 = 4294967296.0
|
||||
private var OBJECT_HASH_CODE_PROPERTY_NAME = "kotlinHashCodeValue$"
|
||||
|
||||
fun getObjectHashCode(obj: dynamic): Int {
|
||||
@@ -83,7 +83,9 @@ fun identityHashCode(obj: Any?): Int = getObjectHashCode(obj)
|
||||
|
||||
internal fun captureStack(instance: Throwable) {
|
||||
if (js("Error").captureStackTrace != null) {
|
||||
js("Error").captureStackTrace(instance, instance::class.js)
|
||||
// TODO Why we generated get kclass for throwable in original code?
|
||||
js("Error").captureStackTrace(instance, instance.asDynamic().constructor)
|
||||
// js("Error").captureStackTrace(instance, instance::class.js)
|
||||
} else {
|
||||
instance.asDynamic().stack = js("new Error()").stack
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ internal open class BufferedOutput : BaseOutput() {
|
||||
internal class BufferedOutputToConsoleLog : BufferedOutput() {
|
||||
override fun print(message: Any?) {
|
||||
var s = String(message)
|
||||
val i = s.lastIndexOf('\n')
|
||||
val i = s.nativeLastIndexOf("\n", 0)
|
||||
if (i >= 0) {
|
||||
buffer += s.substring(0, i)
|
||||
flush()
|
||||
|
||||
Reference in New Issue
Block a user