use of com.github.anba.es6draft.repl.functions.StopExecutionException in project es6draft by anba.
the class Repl method loop.
/**
* REPL: Loop
*/
private void loop() throws InterruptedException {
Realm realm = newRealm();
World world = realm.getWorld();
JobSource jobSource = createJobSource(realm);
for (; ; ) {
try {
world.runEventLoop(jobSource);
return;
} catch (StopExecutionException e) {
if (e.getReason() == Reason.Quit) {
System.exit(0);
}
} catch (ParserExceptionWithSource e) {
handleException(e);
} catch (ScriptException e) {
handleException(realm.defaultContext(), e);
} catch (UnhandledRejectionException e) {
handleException(realm.defaultContext(), e);
} catch (StackOverflowError e) {
handleException(realm.defaultContext(), e);
} catch (OutOfMemoryError e) {
handleException(realm.defaultContext(), e);
} catch (InternalException e) {
handleException(e);
} catch (BootstrapMethodError e) {
handleException(e.getCause());
} catch (UncheckedIOException e) {
handleException(e.getCause());
}
}
}
Aggregations