summaryrefslogtreecommitdiff
path: root/ext/console/01_console.js
diff options
context:
space:
mode:
authorhaturau <135221985+haturatu@users.noreply.github.com>2024-11-20 01:20:47 +0900
committerGitHub <noreply@github.com>2024-11-20 01:20:47 +0900
commit85719a67e59c7aa45bead26e4942d7df8b1b42d4 (patch)
treeface0aecaac53e93ce2f23b53c48859bcf1a36ec /ext/console/01_console.js
parent67697bc2e4a62a9670699fd18ad0dd8efc5bd955 (diff)
parent186b52731c6bb326c4d32905c5e732d082e83465 (diff)
Merge branch 'denoland:main' into main
Diffstat (limited to 'ext/console/01_console.js')
-rw-r--r--ext/console/01_console.js18
1 files changed, 9 insertions, 9 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,
});