From 8dbe77dd29a3791db58fda392dea45d8249b6bc9 Mon Sep 17 00:00:00 2001 From: Mohammad Sulaiman Date: Tue, 15 Oct 2024 01:04:18 +0300 Subject: fix(console/ext/repl): support using parseFloat() (#25900) Fixes #21428 Co-authored-by: tannal --- ext/console/01_console.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'ext/console/01_console.js') diff --git a/ext/console/01_console.js b/ext/console/01_console.js index d9acc958a..a977a2719 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, @@ -3010,20 +3011,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. -- cgit v1.2.3 From 3065dadea3792539f050346c534afc0a7821c2b6 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Tue, 15 Oct 2024 14:36:45 -0700 Subject: fix(ext/console): apply coloring for console.table (#26280) Fixes #26159 --- ext/console/01_console.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/console/01_console.js') diff --git a/ext/console/01_console.js b/ext/console/01_console.js index a977a2719..3c07cf64a 100644 --- a/ext/console/01_console.js +++ b/ext/console/01_console.js @@ -3256,7 +3256,7 @@ class Console { const stringifyValue = (value) => inspectValueWithQuotes(value, { - ...getDefaultInspectOptions(), + ...getConsoleInspectOptions(noColorStdout()), depth: 1, compact: true, }); -- cgit v1.2.3 From 9696e0b3780ede9bb59ab3cf3bf4f2df179d0b32 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Tue, 22 Oct 2024 01:57:58 -0700 Subject: fix(ext/console): ignore casing for named colors in css parsing (#26466) --- ext/console/01_console.js | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/console/01_console.js') diff --git a/ext/console/01_console.js b/ext/console/01_console.js index 3c07cf64a..3803492b9 100644 --- a/ext/console/01_console.js +++ b/ext/console/01_console.js @@ -2653,6 +2653,7 @@ const HSL_PATTERN = new SafeRegExp( ); function parseCssColor(colorString) { + colorString = StringPrototypeToLowerCase(colorString); if (colorKeywords.has(colorString)) { colorString = colorKeywords.get(colorString); } -- cgit v1.2.3