JS backend: don't use octal numbers when render non-latin symbols, because of it prohibited in strict mode

#KT-7921 Fixed
This commit is contained in:
Zalim Bashorov
2015-06-08 14:09:44 +03:00
parent 69ae976be3
commit 65adc3ac02
3 changed files with 37 additions and 32 deletions
@@ -0,0 +1,20 @@
package foo
fun box(): String {
val chars = mapOf('\u0000' to 0x0000,
'\u0001' to 0x0001,
'\u0010' to 0x0010,
'\u001F' to 0x001F,
'\u0064' to 0x0064,
'\u00A0' to 0x00A0,
'\u00FF' to 0x00FF,
'\u0100' to 0x0100,
'\uF01F' to 0xF01F)
for ((char, code) in chars) {
assertEquals(code, char.toInt())
assertEquals(char, code.toChar())
}
return "OK"
}