mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
fix(ext/console): render properties of Intl.Locale (#24827)
Fixes #21271 --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
This commit is contained in:
parent
4eda9e64e9
commit
6db5f1bb6e
2 changed files with 36 additions and 0 deletions
|
@ -790,6 +790,24 @@ function formatRaw(ctx, value, recurseTimes, typedArray, proxyDetails) {
|
||||||
return ctx.stylize(base, "date");
|
return ctx.stylize(base, "date");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} 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 (
|
} else if (
|
||||||
proxyDetails === null &&
|
proxyDetails === null &&
|
||||||
typeof globalThis.Temporal !== "undefined" &&
|
typeof globalThis.Temporal !== "undefined" &&
|
||||||
|
|
|
@ -1066,6 +1066,24 @@ Deno.test(async function consoleTestStringifyPromises() {
|
||||||
assertEquals(strLines[1], " <rejected> Error: Whoops");
|
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() {
|
Deno.test(function consoleTestWithCustomInspector() {
|
||||||
class A {
|
class A {
|
||||||
[customInspect](
|
[customInspect](
|
||||||
|
|
Loading…
Add table
Reference in a new issue