Armon
12/13/2023, 4:31 PMpackage kotlinjs.validators
private val NAME_REGEX = Regex("[a-zA-Z0-9-.' ]{1,26}")
fun validateName(name: String): Boolean =
NAME_REGEX.matches(name)
Using legacy compiler works fine:
$ kotlinc-js -Xuse-deprecated-legacy-compiler -output validators.js Validators.kt
Using IR compiler:
$ kotlinc-js -verbose -Xir-produce-js -Xgenerate-dts -output validators.js Validators.kt
ERROR: Exception while analyzing expression in (3,29) in /Users/armon/src/github.com/kotlin-js/Validators.kt
Attachments:
causeThrowable
java.lang.AssertionError: Built-in class kotlin.String is not found
Any pointers would be appreciated 🙂Artem Kobzar
12/13/2023, 4:57 PMkotlinc
without Gradle, you should provide all the used libraries manually.
There are a few links, that could help you:
https://github.com/compiler-explorer/compiler-explorer/issues/4551
https://youtrack.jetbrains.com/issue/KT-49894Armon
12/13/2023, 5:24 PM