mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 15:06:54 -05:00
Fix REPL formatting (#1744)
This commit is contained in:
parent
a4dec944bc
commit
1e5e091cb0
1 changed files with 3 additions and 6 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue