Remove unnecessary code about handling KotlinNullPointerException
This part of code was necessary because jvm threw KotlinNullPointerException, but js expected NullPointerException.
This commit is contained in:
+1
-10
@@ -128,16 +128,7 @@ class IrInterpreter(irModule: IrModuleFragment) {
|
||||
// catch exception from JVM such as: ArithmeticException, StackOverflowError and others
|
||||
val exceptionName = e::class.java.simpleName
|
||||
val irExceptionClass = irExceptions.firstOrNull { it.name.asString() == exceptionName } ?: irBuiltIns.throwableClass.owner
|
||||
|
||||
val exceptionState = when {
|
||||
// this block is used to replace jvm null pointer exception with common one
|
||||
// TODO figure something better
|
||||
irExceptionClass == irBuiltIns.throwableClass.owner && exceptionName == "KotlinNullPointerException" ->
|
||||
ExceptionState(e, irExceptions.first { it.name.asString() == "NullPointerException" }, stackTrace)
|
||||
else -> ExceptionState(e, irExceptionClass, stackTrace)
|
||||
}
|
||||
|
||||
data.pushReturnValue(exceptionState)
|
||||
data.pushReturnValue(ExceptionState(e, irExceptionClass, stackTrace))
|
||||
return Exception
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user