diff --git a/src/me/topchetoeu/jscript/Main.java b/src/me/topchetoeu/jscript/Main.java index 8922290..e34ddcf 100644 --- a/src/me/topchetoeu/jscript/Main.java +++ b/src/me/topchetoeu/jscript/Main.java @@ -53,6 +53,11 @@ public class Main { public void error(RuntimeException err) { Values.printError(err, null); } + + @Override + public void finish() { + task.interrupt(); + } }; public static void main(String args[]) { @@ -96,7 +101,7 @@ public class Main { catch (EngineException e) { Values.printError(e, ""); } } } - catch (InterruptException e) { return; } + catch (IOException e) { return; } catch (SyntaxException ex) { if (exited[0]) return; System.out.println("Syntax error:" + ex.msg); diff --git a/src/me/topchetoeu/jscript/engine/Engine.java b/src/me/topchetoeu/jscript/engine/Engine.java index 6504b82..9176f7a 100644 --- a/src/me/topchetoeu/jscript/engine/Engine.java +++ b/src/me/topchetoeu/jscript/engine/Engine.java @@ -7,7 +7,6 @@ import me.topchetoeu.jscript.compilation.Instruction; import me.topchetoeu.jscript.engine.values.FunctionValue; import me.topchetoeu.jscript.events.Awaitable; import me.topchetoeu.jscript.events.DataNotifier; -import me.topchetoeu.jscript.exceptions.EngineException; import me.topchetoeu.jscript.exceptions.InterruptException; public class Engine { @@ -58,12 +57,8 @@ public class Engine { try { task.notifier.next(task.func.call(task.ctx, task.thisArg, task.args)); } - catch (EngineException e) { - task.notifier.error(e); - } catch (RuntimeException e) { task.notifier.error(e); - e.printStackTrace(); } } private void run() {