1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-26 16:09:27 -05:00

Fix REPL formatting (#1744)

This commit is contained in:
Kevin (Kun) "Kassimo" Qian 2019-02-11 15:06:22 -08:00 committed by Ryan Dahl
parent a4dec944bc
commit 1e5e091cb0

View file

@ -103,8 +103,7 @@ export async function replLoop(): Promise<void> {
if (err.message !== "Interrupted") {
// e.g. this happens when we have deno.close(3).
// We want to display the problem.
const formattedError = formatError(
libdeno.errorToJSON(err));
const formattedError = formatError(libdeno.errorToJSON(err));
console.error(formattedError);
}
// Quit REPL anyways.
@ -126,8 +125,7 @@ export async function replLoop(): Promise<void> {
} else {
// e.g. this happens when we have deno.close(3).
// We want to display the problem.
const formattedError = formatError(
libdeno.errorToJSON(err));
const formattedError = formatError(libdeno.errorToJSON(err));
console.error(formattedError);
quitRepl(1);
}
@ -143,8 +141,7 @@ function evaluate(code: string): boolean {
const [result, errInfo] = libdeno.evalContext(code);
if (!errInfo) {
console.log(result);
} else if (errInfo.isCompileError &&
isRecoverableError(errInfo.thrown)) {
} else if (errInfo.isCompileError && isRecoverableError(errInfo.thrown)) {
// Recoverable compiler error
return false; // don't consume code.
} else {