[JS FIR] Implement JSCODE_ARGUMENT_NON_CONST_EXPRESSION FIR checker

The meaning of this check is the same as K1
JSCODE_ARGUMENT_SHOULD_BE_CONSTANT and JSCODE_ARGUMENT_NON_CONST_EXPRESSION
diagnostics.

The main difference is that K2 JSCODE_ARGUMENT_NON_CONST_EXPRESSION
diagnostic checks the js() argument in the same way as
const val initializers or annotation arguments are checked.

This means that, the K2 diagnostic is stricter than original
K1 JSCODE_ARGUMENT_SHOULD_BE_CONSTANT diagnostic,
which allows the use of non-constant vals.

^KT-59435 Fixed
This commit is contained in:
Alexander Korepanov
2023-10-17 14:58:10 +02:00
committed by Space Team
parent 2d934f6357
commit 71eaf651e8
6 changed files with 69 additions and 3 deletions
@@ -58,6 +58,9 @@ object JsStandardClassIds {
}
object Callables {
@JvmField
val JsCode = "js".callableId(BASE_JS_PACKAGE)
@JvmField
val JsDefinedExternally = "definedExternally".callableId(BASE_JS_PACKAGE)