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
|
// catch exception from JVM such as: ArithmeticException, StackOverflowError and others
|
||||||
val exceptionName = e::class.java.simpleName
|
val exceptionName = e::class.java.simpleName
|
||||||
val irExceptionClass = irExceptions.firstOrNull { it.name.asString() == exceptionName } ?: irBuiltIns.throwableClass.owner
|
val irExceptionClass = irExceptions.firstOrNull { it.name.asString() == exceptionName } ?: irBuiltIns.throwableClass.owner
|
||||||
|
data.pushReturnValue(ExceptionState(e, irExceptionClass, stackTrace))
|
||||||
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)
|
|
||||||
return Exception
|
return Exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user