Get rid of unnecessary exceptions in JS translator

Before this commit, an internal error during JS translation resulted in the
actual exception wrapped in TranslationRuntimeException wrapped in
TranslationInternalException wrapped in RuntimeException being thrown. This
change gets rid of the two latter wrappings.

Also delete unthrown MainFunctionNotFoundException and related unused
constructors in TranslationException
This commit is contained in:
Alexander Udalov
2016-05-23 18:04:49 +03:00
parent 9418311bda
commit 2bd3211ba8
6 changed files with 21 additions and 81 deletions
@@ -16,9 +16,7 @@
package org.jetbrains.kotlin.js.test.semantics;
import org.jetbrains.kotlin.js.facade.exceptions.TranslationInternalException;
import org.jetbrains.kotlin.js.test.SingleFileTranslationTest;
import org.junit.Assert;
public final class NumberTest extends SingleFileTranslationTest {
public NumberTest() {
@@ -56,14 +54,7 @@ public final class NumberTest extends SingleFileTranslationTest {
}
public void testHexadecimalConstant() throws Exception {
try {
fooBoxTest();
}
catch (TranslationInternalException e) {
Throwable cause = e.getCause();
Assert.assertTrue(cause instanceof IllegalStateException);
Assert.assertTrue(cause.getMessage().startsWith("Unsupported long constant "));
}
fooBoxTest();
}
public void testNumberCompareTo() throws Exception {