From 8a810e2a5e6f0d1ee1a398b9b7d5455fd50a9944 Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Wed, 8 Jul 2020 20:41:20 +0300 Subject: [PATCH] [JS IR] Add runtime API to throw ISE in case of compiled code with errors --- libraries/stdlib/js-ir/runtime/coreRuntime.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/stdlib/js-ir/runtime/coreRuntime.kt b/libraries/stdlib/js-ir/runtime/coreRuntime.kt index ff6c3db9c48..a65bef3d1f9 100644 --- a/libraries/stdlib/js-ir/runtime/coreRuntime.kt +++ b/libraries/stdlib/js-ir/runtime/coreRuntime.kt @@ -117,5 +117,10 @@ internal external class JsObject { } } +// Note: once some error-compilation design happened consider to distinguish a special exception for error-code. +internal fun errorCode(description: String): Nothing { + throw IllegalStateException(description) +} + internal fun boxIntrinsic(@Suppress("UNUSED_PARAMETER") x: T): R = error("Should be lowered") internal fun unboxIntrinsic(@Suppress("UNUSED_PARAMETER") x: T): R = error("Should be lowered")