JS IR: hide runtime helpers from users
This commit is contained in:
@@ -15,18 +15,20 @@ internal fun throwKotlinNothingValueException(): Nothing =
|
||||
|
||||
internal fun noWhenBranchMatchedException(): Nothing = throw NoWhenBranchMatchedException()
|
||||
|
||||
|
||||
fun THROW_ISE(): Nothing {
|
||||
internal fun THROW_ISE(): Nothing {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
fun THROW_CCE(): Nothing {
|
||||
|
||||
internal fun THROW_CCE(): Nothing {
|
||||
throw ClassCastException()
|
||||
}
|
||||
fun THROW_NPE(): Nothing {
|
||||
|
||||
internal fun THROW_NPE(): Nothing {
|
||||
throw NullPointerException()
|
||||
}
|
||||
fun THROW_IAE(msg: String): Nothing {
|
||||
|
||||
internal fun THROW_IAE(msg: String): Nothing {
|
||||
throw IllegalArgumentException(msg)
|
||||
}
|
||||
|
||||
fun <T:Any> ensureNotNull(v: T?): T = if (v == null) THROW_NPE() else v
|
||||
internal fun <T:Any> ensureNotNull(v: T?): T = if (v == null) THROW_NPE() else v
|
||||
Reference in New Issue
Block a user