feat: add WARNING on usage top-level exportable declarations with non-consumable identifiers.

This commit is contained in:
Artem Kobzar
2022-05-04 11:22:57 +00:00
committed by Space
parent 0ea9c1fbce
commit a2b40acc98
9 changed files with 170 additions and 22 deletions
@@ -0,0 +1,42 @@
// !OPT_IN: kotlin.js.ExperimentalJsExport
// !RENDER_DIAGNOSTICS_MESSAGES
package foo
@JsExport
fun <!NON_CONSUMABLE_EXPORTED_IDENTIFIER!>delete<!>() {}
@JsExport
val <!NON_CONSUMABLE_EXPORTED_IDENTIFIER!>instanceof<!> = 4
@JsExport
class <!NON_CONSUMABLE_EXPORTED_IDENTIFIER!>eval<!>
@JsExport
@JsName(<!NON_CONSUMABLE_EXPORTED_IDENTIFIER!>"await"<!>)
fun foo() {}
@JsExport
@JsName(<!NON_CONSUMABLE_EXPORTED_IDENTIFIER!>"this"<!>)
val bar = 4
@JsExport
@JsName(<!NON_CONSUMABLE_EXPORTED_IDENTIFIER!>"super"<!>)
class Baz
@JsExport
class Test {
fun instanceof() {}
@JsName("eval")
fun test() {}
}
@JsExport
object NaN
@JsExport
enum class Nums {
Infinity,
undefined
}