mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
parent
d17b459ecc
commit
1ca635fac6
|
@ -1483,7 +1483,7 @@ public class StatementRenderer implements ExprVisitor, StatementVisitor {
|
||||||
}
|
}
|
||||||
if (!defaultHandlerOccurred) {
|
if (!defaultHandlerOccurred) {
|
||||||
writer.ws().append("else").ws().append("{").indent().softNewLine();
|
writer.ws().append("else").ws().append("{").indent().softNewLine();
|
||||||
writer.append("throw $$je;").softNewLine();
|
writer.append("throw $$e;").softNewLine();
|
||||||
writer.outdent().append("}").softNewLine();
|
writer.outdent().append("}").softNewLine();
|
||||||
} else {
|
} else {
|
||||||
writer.softNewLine();
|
writer.softNewLine();
|
||||||
|
|
|
@ -18,6 +18,7 @@ package org.teavm.vm;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNotSame;
|
import static org.junit.Assert.assertNotSame;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -488,4 +489,21 @@ public class VMTest {
|
||||||
interface ScriptExecutionWrapper {
|
interface ScriptExecutionWrapper {
|
||||||
Object wrap(Supplier<Object> execution);
|
Object wrap(Supplier<Object> execution);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void uncaughtExceptionRethrown() {
|
||||||
|
boolean exceptionCaught = false;
|
||||||
|
try {
|
||||||
|
try {
|
||||||
|
throw new NullPointerException("ok");
|
||||||
|
} catch (IndexOutOfBoundsException e) {
|
||||||
|
fail("Should not get there");
|
||||||
|
}
|
||||||
|
fail("Should not get there");
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
assertEquals("ok", e.getMessage());
|
||||||
|
exceptionCaught = true;
|
||||||
|
}
|
||||||
|
assertTrue("Exception was not caught", exceptionCaught);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user