JS_IR: Support 'CHECK_NOT_NULL' intrinsic

This commit is contained in:
Dmitry Petrov
2019-08-09 16:42:47 +03:00
parent 7d49b72b79
commit a9c961931c
3 changed files with 16 additions and 8 deletions
+3 -1
View File
@@ -20,4 +20,6 @@ fun THROW_CCE(): Nothing {
}
fun THROW_NPE(): Nothing {
throw NullPointerException()
}
}
fun <T:Any> ensureNotNull(v: T?): T = if (v == null) THROW_NPE() else v