summaryrefslogtreecommitdiff
path: root/ext/console/01_console.js
diff options
context:
space:
mode:
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,
});