feat(Escaped Identifiers): add ability to use any symbol wrapped in back ticks.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// IGNORE_BACKEND: JS
|
||||
// RUN_PLAIN_BOX_FUNCTION
|
||||
// INFER_MAIN_MODULE
|
||||
// !LANGUAGE: +JsAllowInvalidCharsIdentifiersEscaping
|
||||
|
||||
// MODULE: export_invalid_name_function
|
||||
// FILE: lib.kt
|
||||
|
||||
@JsExport
|
||||
fun `@do something like-this`(): Int = 42
|
||||
|
||||
// FILE: test.js
|
||||
function box() {
|
||||
var value = this["export_invalid_name_function"]["@do something like-this"]()
|
||||
|
||||
if (value !== 42)
|
||||
return "false: expect exproted function '@do something like-this' to return 42 but it equals " + value
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user