summaryrefslogtreecommitdiff
path: root/runtime/js/99_main.js
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/js/99_main.js')
-rw-r--r--runtime/js/99_main.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index 2ea122e34..fcec6b91a 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -8,7 +8,8 @@ import { core, internals, primordials } from "ext:core/mod.js";
const ops = core.ops;
import {
op_bootstrap_args,
- op_bootstrap_is_tty,
+ op_bootstrap_is_stderr_tty,
+ op_bootstrap_is_stdout_tty,
op_bootstrap_no_color,
op_bootstrap_pid,
op_main_module,
@@ -62,10 +63,10 @@ import * as timers from "ext:deno_web/02_timers.js";
import {
customInspect,
getDefaultInspectOptions,
- getNoColor,
+ getStderrNoColor,
inspectArgs,
quoteString,
- setNoColorFn,
+ setNoColorFns,
} from "ext:deno_console/01_console.js";
import * as performance from "ext:deno_web/15_performance.js";
import * as url from "ext:deno_url/00_url.js";
@@ -379,7 +380,10 @@ function importScripts(...urls) {
const opArgs = memoizeLazy(() => op_bootstrap_args());
const opPid = memoizeLazy(() => op_bootstrap_pid());
-setNoColorFn(() => op_bootstrap_no_color() || !op_bootstrap_is_tty());
+setNoColorFns(
+ () => op_bootstrap_no_color() || !op_bootstrap_is_stdout_tty(),
+ () => op_bootstrap_no_color() || !op_bootstrap_is_stderr_tty(),
+);
function formatException(error) {
if (
@@ -390,11 +394,11 @@ function formatException(error) {
} else if (typeof error == "string") {
return `Uncaught ${
inspectArgs([quoteString(error, getDefaultInspectOptions())], {
- colors: !getNoColor(),
+ colors: !getStderrNoColor(),
})
}`;
} else {
- return `Uncaught ${inspectArgs([error], { colors: !getNoColor() })}`;
+ return `Uncaught ${inspectArgs([error], { colors: !getStderrNoColor() })}`;
}
}