Debugging support #7
@ -53,6 +53,11 @@ public class Main {
|
|||||||
public void error(RuntimeException err) {
|
public void error(RuntimeException err) {
|
||||||
Values.printError(err, null);
|
Values.printError(err, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void finish() {
|
||||||
|
task.interrupt();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
@ -96,7 +101,7 @@ public class Main {
|
|||||||
catch (EngineException e) { Values.printError(e, ""); }
|
catch (EngineException e) { Values.printError(e, ""); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (InterruptException e) { return; }
|
catch (IOException e) { return; }
|
||||||
catch (SyntaxException ex) {
|
catch (SyntaxException ex) {
|
||||||
if (exited[0]) return;
|
if (exited[0]) return;
|
||||||
System.out.println("Syntax error:" + ex.msg);
|
System.out.println("Syntax error:" + ex.msg);
|
||||||
|
@ -7,7 +7,6 @@ import me.topchetoeu.jscript.compilation.Instruction;
|
|||||||
import me.topchetoeu.jscript.engine.values.FunctionValue;
|
import me.topchetoeu.jscript.engine.values.FunctionValue;
|
||||||
import me.topchetoeu.jscript.events.Awaitable;
|
import me.topchetoeu.jscript.events.Awaitable;
|
||||||
import me.topchetoeu.jscript.events.DataNotifier;
|
import me.topchetoeu.jscript.events.DataNotifier;
|
||||||
import me.topchetoeu.jscript.exceptions.EngineException;
|
|
||||||
import me.topchetoeu.jscript.exceptions.InterruptException;
|
import me.topchetoeu.jscript.exceptions.InterruptException;
|
||||||
|
|
||||||
public class Engine {
|
public class Engine {
|
||||||
@ -58,12 +57,8 @@ public class Engine {
|
|||||||
try {
|
try {
|
||||||
task.notifier.next(task.func.call(task.ctx, task.thisArg, task.args));
|
task.notifier.next(task.func.call(task.ctx, task.thisArg, task.args));
|
||||||
}
|
}
|
||||||
catch (EngineException e) {
|
|
||||||
task.notifier.error(e);
|
|
||||||
}
|
|
||||||
catch (RuntimeException e) {
|
catch (RuntimeException e) {
|
||||||
task.notifier.error(e);
|
task.notifier.error(e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void run() {
|
private void run() {
|
||||||
|
Loading…
Reference in New Issue
Block a user