Fix handling non-ES5 identifiers in JS

When a Kotlin identifiers contains non-ES5 chars, JS BE
either reports error (for published declarations) or mangles name
(for non-published ones). The old approach relied on wrong
assuption that Java identifier = ES identifier.
However, that's not true. This commit introduces functions that
check identifiers according to ES5.1 spec rather than
using Character.isIdentifierStart[Part]

See KT-17476
This commit is contained in:
Alexey Andreev
2017-05-25 14:35:49 +03:00
committed by Alexey Andreev
parent 24c0a1e7ce
commit a0ddbf0e9b
2 changed files with 26 additions and 6 deletions
@@ -23,9 +23,9 @@ fun test3(): String {
}
fun test4(): String {
val `()` = "OK"
fun `[]`() = `()`
return `[]`()
val `1(¢)` = "OK"
fun `[£]`() = `1(¢)`
return `[£]`()
}
fun box(): String {