summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/console/01_console.js18
-rw-r--r--tests/unit/console_test.ts18
2 files changed, 36 insertions, 0 deletions
diff --git a/ext/console/01_console.js b/ext/console/01_console.js
index cffa72d8c..6812583e0 100644
--- a/ext/console/01_console.js
+++ b/ext/console/01_console.js
@@ -792,6 +792,24 @@ function formatRaw(ctx, value, recurseTimes, typedArray, proxyDetails) {
}
} else if (
proxyDetails === null &&
+ ObjectPrototypeIsPrototypeOf(globalThis.Intl.Locale.prototype, value)
+ ) {
+ braces[0] = `${getPrefix(constructor, tag, "Intl.Locale")}{`;
+ ArrayPrototypeUnshift(
+ keys,
+ "baseName",
+ "calendar",
+ "caseFirst",
+ "collation",
+ "hourCycle",
+ "language",
+ "numberingSystem",
+ "numeric",
+ "region",
+ "script",
+ );
+ } else if (
+ proxyDetails === null &&
typeof globalThis.Temporal !== "undefined" &&
(
ObjectPrototypeIsPrototypeOf(
diff --git a/tests/unit/console_test.ts b/tests/unit/console_test.ts
index d9ac71dd8..c13362419 100644
--- a/tests/unit/console_test.ts
+++ b/tests/unit/console_test.ts
@@ -1066,6 +1066,24 @@ Deno.test(async function consoleTestStringifyPromises() {
assertEquals(strLines[1], " <rejected> Error: Whoops");
});
+Deno.test(function consoleTestStringifyIntlLocale() {
+ assertEquals(
+ stringify(new Intl.Locale("zh-Hant-TW", { hourCycle: "h12" })),
+ `Locale [Intl.Locale] {
+ baseName: "zh-Hant-TW",
+ calendar: undefined,
+ caseFirst: undefined,
+ collation: undefined,
+ hourCycle: "h12",
+ language: "zh",
+ numberingSystem: undefined,
+ numeric: false,
+ region: "TW",
+ script: "Hant"
+}`,
+ );
+});
+
Deno.test(function consoleTestWithCustomInspector() {
class A {
[customInspect](