summaryrefslogtreecommitdiff
path: root/ext/console
diff options
context:
space:
mode:
Diffstat (limited to 'ext/console')
-rw-r--r--ext/console/01_console.js18
-rw-r--r--ext/console/Cargo.toml2
-rw-r--r--ext/console/internal.d.ts3
3 files changed, 13 insertions, 10 deletions
diff --git a/ext/console/01_console.js b/ext/console/01_console.js
index d9acc958a..3803492b9 100644
--- a/ext/console/01_console.js
+++ b/ext/console/01_console.js
@@ -84,6 +84,7 @@ const {
NumberIsInteger,
NumberIsNaN,
NumberParseInt,
+ NumberParseFloat,
NumberPrototypeToFixed,
NumberPrototypeToString,
NumberPrototypeValueOf,
@@ -2652,6 +2653,7 @@ const HSL_PATTERN = new SafeRegExp(
);
function parseCssColor(colorString) {
+ colorString = StringPrototypeToLowerCase(colorString);
if (colorKeywords.has(colorString)) {
colorString = colorKeywords.get(colorString);
}
@@ -3010,20 +3012,18 @@ function inspectArgs(args, inspectOptions = { __proto__: null }) {
} else if (ArrayPrototypeIncludes(["d", "i"], char)) {
// Format as an integer.
const value = args[a++];
- if (typeof value == "bigint") {
- formattedArg = `${value}n`;
- } else if (typeof value == "number") {
- formattedArg = `${NumberParseInt(String(value))}`;
- } else {
+ if (typeof value === "symbol") {
formattedArg = "NaN";
+ } else {
+ formattedArg = `${NumberParseInt(value)}`;
}
} else if (char == "f") {
// Format as a floating point value.
const value = args[a++];
- if (typeof value == "number") {
- formattedArg = `${value}`;
- } else {
+ if (typeof value === "symbol") {
formattedArg = "NaN";
+ } else {
+ formattedArg = `${NumberParseFloat(value)}`;
}
} else if (ArrayPrototypeIncludes(["O", "o"], char)) {
// Format as an object.
@@ -3257,7 +3257,7 @@ class Console {
const stringifyValue = (value) =>
inspectValueWithQuotes(value, {
- ...getDefaultInspectOptions(),
+ ...getConsoleInspectOptions(noColorStdout()),
depth: 1,
compact: true,
});
diff --git a/ext/console/Cargo.toml b/ext/console/Cargo.toml
index 5c143ca18..80f1cca84 100644
--- a/ext/console/Cargo.toml
+++ b/ext/console/Cargo.toml
@@ -2,7 +2,7 @@
[package]
name = "deno_console"
-version = "0.171.0"
+version = "0.177.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
diff --git a/ext/console/internal.d.ts b/ext/console/internal.d.ts
index 45af616d6..5f9627cf5 100644
--- a/ext/console/internal.d.ts
+++ b/ext/console/internal.d.ts
@@ -9,4 +9,7 @@ declare module "ext:deno_console/01_console.js" {
keys: (keyof TObject)[];
evaluate: boolean;
}): Record<string, unknown>;
+
+ class Console {
+ }
}