feat(Escaped Identifiers): add ability to use any symbol wrapped in back ticks.

This commit is contained in:
Artem Kobzar
2021-10-29 17:55:59 +00:00
committed by Space
parent ea10b4a781
commit 979e9f94ef
59 changed files with 1260 additions and 159 deletions
+1 -4
View File
@@ -1,8 +1,5 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// IGNORE_BACKEND: JS
// !LANGUAGE: +JsAllowInvalidCharsIdentifiersEscaping
// Exclamation marks are not valid in names in the dex file format.
// Therefore, do not attempt to dex this file as it will fail.
@@ -1,8 +1,5 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// IGNORE_BACKEND: JS
// !LANGUAGE: +JsAllowInvalidCharsIdentifiersEscaping
// Names with spaces are not valid according to the dex specification
// before DEX version 040. Therefore, do not attempt to dex the resulting
+2 -4
View File
@@ -1,8 +1,6 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// !SANITIZE_PARENTHESES
// IGNORE_BACKEND: JS, JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// IGNORE_BACKEND: JS
// !LANGUAGE: +JsAllowInvalidCharsIdentifiersEscaping
// Sanitization is needed here because DxChecker reports ParseException on parentheses in names.
@@ -0,0 +1,29 @@
// SKIP_TXT
// IGNORE_BACKEND: JS
// !LANGUAGE: +JsAllowInvalidCharsIdentifiersEscaping
private fun ` .private `(): String = TODO("")
fun ` .public `(): String = TODO("")
@JsName(" __ ")
fun foo(): String = TODO("")
@JsName(" ___ ")
private fun bar(): String = TODO("")
@JsName("validName")
private fun ` .private with @JsName `(): String = TODO("")
private class ` .private class ` {
val ` .field. ` = ""
}
val x: Int
@JsName(".")
get() = TODO("")
fun box(x: dynamic) {
x.`foo-bar`()
x.`ba-z`
}