summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/tests/unit/console_test.ts9
-rw-r--r--ext/console/01_console.js12
2 files changed, 12 insertions, 9 deletions
diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts
index 8543541af..7dac7ca77 100644
--- a/cli/tests/unit/console_test.ts
+++ b/cli/tests/unit/console_test.ts
@@ -1152,9 +1152,12 @@ Deno.test(function consoleParseCssColor() {
assertEquals(parseCssColor("darkmagenta"), [139, 0, 139]);
assertEquals(parseCssColor("slateblue"), [106, 90, 205]);
assertEquals(parseCssColor("#ffaa00"), [255, 170, 0]);
- assertEquals(parseCssColor("#ffaa00"), [255, 170, 0]);
- assertEquals(parseCssColor("#18d"), [16, 128, 208]);
- assertEquals(parseCssColor("#18D"), [16, 128, 208]);
+ assertEquals(parseCssColor("#ffAA00"), [255, 170, 0]);
+ assertEquals(parseCssColor("#fa0"), [255, 170, 0]);
+ assertEquals(parseCssColor("#FA0"), [255, 170, 0]);
+ assertEquals(parseCssColor("#18d"), [17, 136, 221]);
+ assertEquals(parseCssColor("#18D"), [17, 136, 221]);
+ assertEquals(parseCssColor("#1188DD"), [17, 136, 221]);
assertEquals(parseCssColor("rgb(100, 200, 50)"), [100, 200, 50]);
assertEquals(parseCssColor("rgb(+100.3, -200, .5)"), [100, 0, 1]);
assertEquals(parseCssColor("hsl(75, 60%, 40%)"), [133, 163, 41]);
diff --git a/ext/console/01_console.js b/ext/console/01_console.js
index d5ed80a63..8d9c56c92 100644
--- a/ext/console/01_console.js
+++ b/ext/console/01_console.js
@@ -2541,7 +2541,7 @@ function replaceEscapeSequences(string) {
ESCAPE_PATTERN,
(c) => ESCAPE_MAP[c],
),
- new SafeRegExp(ESCAPE_PATTERN2),
+ ESCAPE_PATTERN2,
(c) =>
"\\x" +
StringPrototypePadStart(
@@ -2753,9 +2753,9 @@ function parseCssColor(colorString) {
const smallHashMatch = StringPrototypeMatch(colorString, SMALL_HASH_PATTERN);
if (smallHashMatch != null) {
return [
- Number(`0x${smallHashMatch[1]}0`),
- Number(`0x${smallHashMatch[2]}0`),
- Number(`0x${smallHashMatch[3]}0`),
+ Number(`0x${smallHashMatch[1]}${smallHashMatch[1]}`),
+ Number(`0x${smallHashMatch[2]}${smallHashMatch[2]}`),
+ Number(`0x${smallHashMatch[3]}${smallHashMatch[3]}`),
];
}
// deno-fmt-ignore
@@ -3329,7 +3329,7 @@ class Console {
if (properties !== undefined && !ArrayIsArray(properties)) {
throw new Error(
"The 'properties' argument must be of type Array. " +
- "Received type string",
+ "Received type " + typeof properties,
);
}
@@ -3436,7 +3436,7 @@ class Console {
label = String(label);
if (!MapPrototypeHas(timerMap, label)) {
- this.warn(`Timer '${label}' does not exists`);
+ this.warn(`Timer '${label}' does not exist`);
return;
}