[JS IR BE] Fix Throwable ancestor transformation

Make sure that `message` and `cause` are properly configured

 - synchronize IR BE and Legacy behaviour
 - fix corresponding IR lowering
 - fix JS IR core runtime
 - add test
 - fix KT-39964
This commit is contained in:
Roman Artemev
2020-10-06 16:06:57 +03:00
parent 383146f836
commit ff093d363a
6 changed files with 46 additions and 6 deletions
@@ -0,0 +1,10 @@
// EXPECTED_REACHABLE_NODES: 1237
// KT-39964
fun box(): String {
val e = Throwable(null, IllegalStateException("fail"))
if (e.message != null) return "FAIL"
return "OK"
}