[JS IR BE] Use Char boxing rules of current backend

This commit is contained in:
Svyatoslav Kuzmich
2019-02-14 14:39:04 +03:00
parent de020ed58a
commit 569187a751
12 changed files with 32 additions and 24 deletions
+4 -3
View File
@@ -1,14 +1,15 @@
// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1283
// EXPECTED_REACHABLE_NODES: 1276
class A(val x: Char)
fun typeOf(x: dynamic): String = js("typeof x")
val expectedCharRepresentationInProperty = if (testUtils.isLegacyBackend()) "object" else "number"
fun box(): String {
val a = A('0')
var r = typeOf(a.asDynamic().x)
if (r != "object") return "fail1: $r"
if (r != expectedCharRepresentationInProperty) return "fail1: $r"
r = typeOf(a.x)
if (r != "number") return "fail2: $r"