summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2023-04-30 11:11:37 +0200
committerGitHub <noreply@github.com>2023-04-30 09:11:37 +0000
commit59825a95b4d3952c955b8b43e174189999e35d15 (patch)
treeb3ff4c24f5596cc70daac40b578805a61d565c2a /runtime
parentbb1f5e4262940a966e6314f57a4267514911d262 (diff)
refactor: remove ext/console/01_colors.js (#18927)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/fmt_errors.rs2
-rw-r--r--runtime/js/90_deno_ns.js2
-rw-r--r--runtime/js/98_global_scope.js2
-rw-r--r--runtime/js/99_main.js11
4 files changed, 9 insertions, 8 deletions
diff --git a/runtime/fmt_errors.rs b/runtime/fmt_errors.rs
index 6852cbcd1..5dcb96ec7 100644
--- a/runtime/fmt_errors.rs
+++ b/runtime/fmt_errors.rs
@@ -12,7 +12,7 @@ use std::fmt::Write as _;
/// Compares all properties of JsError, except for JsError::cause.
/// This function is used to detect that 2 JsError objects in a JsError::cause
/// chain are identical, ie. there is a recursive cause.
-/// 02_console.js, which also detects recursive causes, can use JS object
+/// 01_console.js, which also detects recursive causes, can use JS object
/// comparisons to compare errors. We don't have access to JS object identity in
/// format_js_error().
fn errors_are_equal_without_cause(a: &JsError, b: &JsError) -> bool {
diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js
index bb6ba3b08..3507a98a3 100644
--- a/runtime/js/90_deno_ns.js
+++ b/runtime/js/90_deno_ns.js
@@ -4,7 +4,7 @@ const core = globalThis.Deno.core;
const ops = core.ops;
import * as timers from "ext:deno_web/02_timers.js";
import * as httpClient from "ext:deno_fetch/22_http_client.js";
-import * as console from "ext:deno_console/02_console.js";
+import * as console from "ext:deno_console/01_console.js";
import * as ffi from "ext:deno_ffi/00_ffi.js";
import * as net from "ext:deno_net/01_net.js";
import * as tls from "ext:deno_net/02_tls.js";
diff --git a/runtime/js/98_global_scope.js b/runtime/js/98_global_scope.js
index 911db65cb..1084f5c24 100644
--- a/runtime/js/98_global_scope.js
+++ b/runtime/js/98_global_scope.js
@@ -13,7 +13,7 @@ import * as event from "ext:deno_web/02_event.js";
import * as timers from "ext:deno_web/02_timers.js";
import * as base64 from "ext:deno_web/05_base64.js";
import * as encoding from "ext:deno_web/08_text_encoding.js";
-import * as console from "ext:deno_console/02_console.js";
+import * as console from "ext:deno_console/01_console.js";
import * as caches from "ext:deno_cache/01_cache.js";
import * as compression from "ext:deno_web/14_compression.js";
import * as worker from "ext:runtime/11_workers.js";
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index b6dab121c..0ed692f3c 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -44,13 +44,14 @@ import * as location from "ext:deno_web/12_location.js";
import * as version from "ext:runtime/01_version.ts";
import * as os from "ext:runtime/30_os.js";
import * as timers from "ext:deno_web/02_timers.js";
-import * as colors from "ext:deno_console/01_colors.js";
import {
getDefaultInspectOptions,
+ getNoColor,
inspectArgs,
quoteString,
+ setNoColor,
wrapConsole,
-} from "ext:deno_console/02_console.js";
+} 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";
import * as fetch from "ext:deno_fetch/26_fetch.js";
@@ -220,11 +221,11 @@ function formatException(error) {
} else if (typeof error == "string") {
return `Uncaught ${
inspectArgs([quoteString(error, getDefaultInspectOptions())], {
- colors: !colors.getNoColor(),
+ colors: !getNoColor(),
})
}`;
} else {
- return `Uncaught ${inspectArgs([error], { colors: !colors.getNoColor() })}`;
+ return `Uncaught ${inspectArgs([error], { colors: !getNoColor() })}`;
}
}
@@ -313,7 +314,7 @@ function runtimeStart(
);
core.setBuildInfo(target);
util.setLogDebug(debugFlag, source);
- colors.setNoColor(noColor || !isTty);
+ setNoColor(noColor || !isTty);
// deno-lint-ignore prefer-primordials
Error.prepareStackTrace = core.prepareStackTrace;
}