fun box()

in compiler/testData/codegen/boxWasmJsInterop/jsException.kt [1694:1865]


fun box(): String {
    // Finally only
    if (!jsPrimitiveWithFinally()) return "Issue with try with finally on a JS primitive thrown"
    if (!jsNumberWithFinally()) return "Issue with try with finally on a JS number thrown"
    if (!jsNullWithFinally()) return "Issue with try with finally on a JS null thrown"
    if (!jsExceptionWithFinally()) return "Issue with try with finally on a JS Error thrown"
    if (!kotlinExceptionWithFinally()) return "Issue with try with finally on a Kotlin Exception thrown"

    // Catch Throwable only
    if (!jsPrimitiveWithCatchThrowable()) return "Issue with try with catch Throwable only on a JS primitive thrown"
    if (!jsNumberWithCatchThrowable()) return "Issue with try with catch Throwable only on a JS number thrown"
    if (!jsNullWithCatchThrowable()) return "Issue with try with catch Throwable only on a JS null thrown"
    if (!jsExceptionWithCatchThrowable()) return "Issue with try with catch Throwable only on a JS Error thrown"
    if (!kotlinExceptionWithCatchThrowable()) return "Issue with try with catch Throwable only on a Kotlin Exception thrown"

    // Catch JsException only
    if (!jsPrimitiveWithCatchJsException()) return "Issue with try with catch JsException only on a JS primitive thrown"
    if (!jsNumberWithCatchJsException()) return "Issue with try with catch JsException only on a JS number thrown"
    if (!jsNullWithCatchJsException()) return "Issue with try with catch JsException only on a JS null thrown"
    if (!jsExceptionWithCatchJsException()) return "Issue with try with catch JsException only on a JS Error thrown"
    if (!wasThrown<IllegalStateException> {  kotlinExceptionWithCatchJsException() }) return "Issue with try with catch JsException only on a Kotlin Exception thrown"

    // Catch IllegalStateException only
    if (!wasThrown<JsException> { jsPrimitiveWithCatchIllegalStateException() }) return "Issue with try with catch IllegalStateException only on a JS primitive thrown"
    if (!wasThrown<JsException> { jsNumberWithCatchIllegalStateException() }) return "Issue with try with catch IllegalStateException only on a JS number thrown"
    if (!wasThrown<JsException> { jsNullWithCatchIllegalStateException() }) return "Issue with try with catch IllegalStateException only on a JS null thrown"
    if (!wasThrown<JsException> { jsExceptionWithCatchIllegalStateException() }) return "Issue with try with catch IllegalStateException only on a JS Error thrown"
    if (!kotlinExceptionWithCatchIllegalStateException()) return "Issue with try with catch IllegalStateException only on a Kotlin Exception thrown"

    // Catch Throwable and finally
    if (!jsPrimitiveWithCatchThrowableAndFinally()) return "Issue with try with catch Throwable and finally on a JS primitive thrown"
    if (!jsNumberWithCatchThrowableAndFinally()) return "Issue with try with catch Throwable and finally on a JS number thrown"
    if (!jsNullWithCatchThrowableAndFinally()) return "Issue with try with catch Throwable and finally on a JS null thrown"
    if (!jsExceptionWithCatchThrowableAndFinally()) return "Issue with try with catch Throwable and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchThrowableAndFinally()) return "Issue with try with catch Throwable and finally on a Kotlin Exception thrown"

    // Catch JsException and finally
    if (!jsPrimitiveWithCatchJsExceptionAndFinally()) return "Issue with try with catch JsException and finally on a JS primitive thrown"
    if (!jsNumberWithCatchJsExceptionAndFinally()) return "Issue with try with catch JsException and finally on a JS number thrown"
    if (!jsNullWithCatchJsExceptionAndFinally()) return "Issue with try with catch JsException and finally on a JS null thrown"
    if (!jsExceptionWithCatchJsExceptionAndFinally()) return "Issue with try with catch JsException and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchJsExceptionAndFinally()) return "Issue with try with catch JsException only on a Kotlin Exception thrown"

    // Catch IllegalStateException and finally
    if (!jsPrimitiveWithCatchIllegalStateExceptionAndFinally()) return "Issue with try with catch IllegalStateException and finally on a JS primitive thrown"
    if (!jsNumberWithCatchIllegalStateExceptionAndFinally()) return "Issue with try with catch IllegalStateException and finally on a JS number thrown"
    if (!jsNullWithCatchIllegalStateExceptionAndFinally()) return "Issue with try with catch IllegalStateException and finally on a JS null thrown"
    if (!jsExceptionWithCatchIllegalStateExceptionAndFinally()) return "Issue with try with catch IllegalStateException and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchIllegalStateExceptionAndFinally()) return "Issue with try with catch IllegalStateException and finally on a Kotlin Exception thrown"

    // Catch JsException and Throwable
    if (!jsPrimitiveWithCatchJsExceptionAndThrowable()) return "Issue with try with catch JsException and Throwable on a JS primitive thrown"
    if (!jsExceptionWithCatchJsExceptionAndThrowable()) return "Issue with try with catch JsException and Throwable on a JS Error thrown"
    if (!kotlinExceptionWithCatchJsExceptionAndThrowable()) return "Issue with try with catch JsException and Throwable on a Kotlin Exception thrown"

    // Catch IllegalStateException and Throwable
    if (!jsPrimitiveWithCatchIllegalStateExceptionAndThrowable()) return "Issue with try with catch IllegalStateException and Throwable on a JS primitive thrown"
    if (!jsExceptionWithCatchIllegalStateExceptionAndThrowable()) return "Issue with try with catch IllegalStateException and Throwable on a JS Error thrown"
    if (!kotlinExceptionWithCatchIllegalStateExceptionAndThrowable()) return "Issue with try with catch IllegalStateException and Throwable on a Kotlin Exception thrown"

    // Catch Throwable and JsException
    if (!jsPrimitiveWithCatchThrowableAndJsException()) return "Issue with try with catch Throwable and JsException on a JS primitive thrown"
    if (!jsExceptionWithCatchThrowableAndJsException()) return "Issue with try with catch Throwable and JsException on a JS Error thrown"
    if (!kotlinExceptionWithCatchThrowableAndJsException()) return "Issue with try with catch Throwable and JsException on a Kotlin Exception thrown"

    // Catch IllegalStateException and JsException
    if (!jsPrimitiveWithCatchIllegalStateExceptionAndJsException()) return "Issue with try with catch IllegalStateException and JsException on a JS primitive thrown"
    if (!jsExceptionWithCatchIllegalStateExceptionAndJsException()) return "Issue with try with catch IllegalStateException and JsException on a JS Error thrown"
    if (!kotlinExceptionWithCatchIllegalStateExceptionAndJsException()) return "Issue with try with catch IllegalStateException and JsException on a Kotlin Exception thrown"

    // Catch Throwable and IllegalStateException
    if (!jsPrimitiveWithCatchThrowableAndIllegalStateException()) return "Issue with try with catch Throwable and IllegalStateException on a JS primitive thrown"
    if (!jsExceptionWithCatchThrowableAndIllegalStateException()) return "Issue with try with catch Throwable and IllegalStateException on a JS Error thrown"
    if (!kotlinExceptionWithCatchThrowableAndIllegalStateException()) return "Issue with try with catch Throwable and IllegalStateException on a Kotlin Exception thrown"

    // Catch JsException and IllegalStateException
    if (!jsPrimitiveWithCatchJsExceptionAndIllegalStateException()) return "Issue with try with catch JsException and IllegalStateException on a JS primitive thrown"
    if (!jsExceptionWithCatchJsExceptionAndIllegalStateException()) return "Issue with try with catch JsException and IllegalStateException on a JS Error thrown"
    if (!kotlinExceptionWithCatchJsExceptionAndIllegalStateException()) return "Issue with try with catch JsException and IllegalStateException on a Kotlin Exception thrown"

    // Catch JsException and Throwable and finally
    if (!jsPrimitiveWithCatchJsExceptionAndThrowableAndFinally()) return "Issue with try with catch JsException and Throwable and finally on a JS primitive thrown"
    if (!jsExceptionWithCatchJsExceptionAndThrowableAndFinally()) return "Issue with try with catch JsException and Throwable and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchJsExceptionAndThrowableAndFinally()) return "Issue with try with catch JsException and Throwable and finally on a Kotlin Exception thrown"

    // Catch IllegalStateException and Throwable and finally
    if (!jsPrimitiveWithCatchIllegalStateExceptionAndThrowableAndFinally()) return "Issue with try with catch IllegalStateException and Throwable and finally on a JS primitive thrown"
    if (!jsExceptionWithCatchIllegalStateExceptionAndThrowableAndFinally()) return "Issue with try with catch IllegalStateException and Throwable and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchIllegalStateExceptionAndThrowableAndFinally()) return "Issue with try with catch IllegalStateException and Throwable and finally on a Kotlin Exception thrown"

    // Catch Throwable and JsException and finally
    if (!jsPrimitiveWithCatchThrowableAndJsExceptionAndFinally()) return "Issue with try with catch Throwable and JsException and finally on a JS primitive thrown"
    if (!jsExceptionWithCatchThrowableAndJsExceptionAndFinally()) return "Issue with try with catch Throwable and JsException and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchThrowableAndJsExceptionAndFinally()) return "Issue with try with catch Throwable and JsException and finally on a Kotlin Exception thrown"

    // Catch IllegalStateException and JsException and finally
    if (!jsPrimitiveWithCatchIllegalStateExceptionAndJsExceptionAndFinally()) return "Issue with try with catch IllegalStateException and JsException and finally on a JS primitive thrown"
    if (!jsExceptionWithCatchIllegalStateExceptionAndJsExceptionAndFinally()) return "Issue with try with catch IllegalStateException and JsException and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchIllegalStateExceptionAndJsExceptionAndFinally()) return "Issue with try with catch IllegalStateException and JsException and finally on a Kotlin Exception thrown"

    // Catch Throwable and IllegalStateException and finally
    if (!jsPrimitiveWithCatchThrowableAndIllegalStateExceptionAndFinally()) return "Issue with try with catch Throwable and IllegalStateException and finally on a JS primitive thrown"
    if (!jsExceptionWithCatchThrowableAndIllegalStateExceptionAndFinally()) return "Issue with try with catch Throwable and IllegalStateException and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchThrowableAndIllegalStateExceptionAndFinally()) return "Issue with try with catch Throwable and IllegalStateException and finally on a Kotlin Exception thrown"

    // Catch JsException and IllegalStateException and finally
    if (!jsPrimitiveWithCatchJsExceptionAndIllegalStateExceptionAndFinally()) return "Issue with try with catch JsException and IllegalStateException and finally on a JS primitive thrown"
    if (!jsExceptionWithCatchJsExceptionAndIllegalStateExceptionAndFinally()) return "Issue with try with catch JsException and IllegalStateException and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchJsExceptionAndIllegalStateExceptionAndFinally()) return "Issue with try with catch JsException and IllegalStateException and finally on a Kotlin Exception thrown"

    // Catch JsException and Throwable and IllegalStateException
    if (!jsPrimitiveWithCatchJsExceptionAndThrowableAndIllegalStateException()) return "Issue with try with catch JsException and Throwable and IllegalStateException on a JS primitive thrown"
    if (!jsExceptionWithCatchJsExceptionAndThrowableAndIllegalStateException()) return "Issue with try with catch JsException and Throwable and IllegalStateException on a JS Error thrown"
    if (!kotlinExceptionWithCatchJsExceptionAndThrowableAndIllegalStateException()) return "Issue with try with catch JsException and Throwable and IllegalStateException on a Kotlin Exception thrown"

    // Catch IllegalStateException and Throwable and JsException
    if (!jsPrimitiveWithCatchIllegalStateExceptionAndThrowableAndJsException()) return "Issue with try with catch IllegalStateException and Throwable and JsException on a JS primitive thrown"
    if (!jsExceptionWithCatchIllegalStateExceptionAndThrowableAndJsException()) return "Issue with try with catch IllegalStateException and Throwable and JsException on a JS Error thrown"
    if (!kotlinExceptionWithCatchIllegalStateExceptionAndThrowableAndJsException()) return "Issue with try with catch IllegalStateException and Throwable and JsException on a Kotlin Exception thrown"

    // Catch Throwable and JsException and IllegalStateException
    if (!jsPrimitiveWithCatchThrowableAndJsExceptionAndIllegalStateException()) return "Issue with try with catch Throwable and JsException and IllegalStateException on a JS primitive thrown"
    if (!jsExceptionWithCatchThrowableAndJsExceptionAndIllegalStateException()) return "Issue with try with catch Throwable and JsException and IllegalStateException on a JS Error thrown"
    if (!kotlinExceptionWithCatchThrowableAndJsExceptionAndIllegalStateException()) return "Issue with try with catch Throwable and JsException and IllegalStateException on a Kotlin Exception thrown"

    // Catch IllegalStateException and JsException and Throwable
    if (!jsPrimitiveWithCatchIllegalStateExceptionAndJsExceptionAndThrowable()) return "Issue with try with catch IllegalStateException and JsException and Throwable on a JS primitive thrown"
    if (!jsExceptionWithCatchIllegalStateExceptionAndJsExceptionAndThrowable()) return "Issue with try with catch IllegalStateException and JsException and Throwable on a JS Error thrown"
    if (! kotlinExceptionWithCatchIllegalStateExceptionAndJsExceptionAndThrowable()) return "Issue with try with catch IllegalStateException and JsException and Throwable on a Kotlin Exception thrown"

    // Catch Throwable and IllegalStateException and JsException
    if (!jsPrimitiveWithCatchThrowableAndIllegalStateExceptionAndJsException()) return "Issue with try with catch Throwable and IllegalStateException and JsException on a JS primitive thrown"
    if (!jsExceptionWithCatchThrowableAndIllegalStateExceptionAndJsException()) return "Issue with try with catch Throwable and IllegalStateException and JsException on a JS Error thrown"
    if (!kotlinExceptionWithCatchThrowableAndIllegalStateExceptionAndJsException()) return "Issue with try with catch Throwable and IllegalStateException and JsException on a Kotlin Exception thrown"

    // Catch JsException and IllegalStateException and Throwable
    if (!jsPrimitiveWithCatchJsExceptionAndIllegalStateExceptionAndThrowable()) return "Issue with try with catch JsException and IllegalStateException and Throwable on a JS primitive thrown"
    if (!jsExceptionWithCatchJsExceptionAndIllegalStateExceptionAndThrowable()) return "Issue with try with catch JsException and IllegalStateException and Throwable on a JS Error thrown"
    if (!kotlinExceptionWithCatchJsExceptionAndIllegalStateExceptionAndThrowable()) return "Issue with try with catch JsException and IllegalStateException and Throwable on a Kotlin Exception thrown"

    // Catch JsException and Throwable and IllegalStateException and finally
    if (!jsPrimitiveWithCatchJsExceptionAndThrowableAndIllegalStateExceptionAndFinally()) return "Issue with try with catch JsException and Throwable and IllegalStateException and finally on a JS primitive thrown"
    if (!jsExceptionWithCatchJsExceptionAndThrowableAndIllegalStateExceptionAndFinally()) return "Issue with try with catch JsException and Throwable and IllegalStateException and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchJsExceptionAndThrowableAndIllegalStateExceptionAndFinally()) return "Issue with try with catch JsException and Throwable and IllegalStateException and finally on a Kotlin Exception thrown"

    // Catch IllegalStateException and Throwable and JsException and finally
    if (!jsPrimitiveWithCatchIllegalStateExceptionAndThrowableAndJsExceptionAndFinally()) return "Issue with try with catch IllegalStateException and Throwable and JsException and finally on a JS primitive thrown"
    if (!jsExceptionWithCatchIllegalStateExceptionAndThrowableAndJsExceptionAndFinally()) return "Issue with try with catch IllegalStateException and Throwable and JsException and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchIllegalStateExceptionAndThrowableAndJsExceptionAndFinally()) return "Issue with try with catch IllegalStateException and Throwable and JsException and finally on a JS Error thrown"

    // Catch Throwable and JsException and IllegalStateException and finally
    if (!jsPrimitiveWithCatchThrowableAndJsExceptionAndIllegalStateExceptionAndFinally()) return "Issue with try with catch Throwable and JsException and IllegalStateException and finally on a JS primitive thrown"
    if (!jsExceptionWithCatchThrowableAndJsExceptionAndIllegalStateExceptionAndFinally()) return "Issue with try with catch Throwable and JsException and IllegalStateException and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchThrowableAndJsExceptionAndIllegalStateExceptionAndFinally()) return "Issue with try with catch Throwable and JsException and IllegalStateException and finally on a Kotlin Exception thrown"

    // Catch IllegalStateException and JsException and Throwable and finally
    if (!jsPrimitiveWithCatchIllegalStateExceptionAndJsExceptionAndThrowableAndFinally()) return "Issue with try with catch IllegalStateException and JsException and Throwable and finally on a JS primitive thrown"
    if (!jsExceptionWithCatchIllegalStateExceptionAndJsExceptionAndThrowableAndFinally()) return "Issue with try with catch IllegalStateException and JsException and Throwable and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchIllegalStateExceptionAndJsExceptionAndThrowableAndFinally()) return "Issue with try with catch IllegalStateException and JsException and Throwable and finally on a JS Error thrown"

    // Catch Throwable and IllegalStateException and JsException and finally
    if (!jsPrimitiveWithCatchThrowableAndIllegalStateExceptionAndJsExceptionAndFinally()) return "Issue with try with catch Throwable and IllegalStateException and JsException and finally on a JS primitive thrown"
    if (!jsExceptionWithCatchThrowableAndIllegalStateExceptionAndJsExceptionAndFinally()) return "Issue with try with catch Throwable and IllegalStateException and JsException and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchThrowableAndIllegalStateExceptionAndJsExceptionAndFinally()) return "Issue with try with catch Throwable and IllegalStateException and JsException and finally on a Kotlin Exception thrown"

    // Catch JsException and IllegalStateException and Throwable and finally
    if (!jsPrimitiveWithCatchJsExceptionAndIllegalStateExceptionAndThrowableAndFinally()) return "Issue with try with catch JsException and IllegalStateException and Throwable and finally on a JS primitive thrown"
    if (!jsExceptionWithCatchJsExceptionAndIllegalStateExceptionAndThrowableAndFinally()) return "Issue with try with catch JsException and IllegalStateException and Throwable and finally on a JS Error thrown"
    if (!kotlinExceptionWithCatchJsExceptionAndIllegalStateExceptionAndThrowableAndFinally()) return "Issue with try with catch JsException and IllegalStateException and Throwable and finally on a Kotlin Exception thrown"

    return "OK"
}