BigInt.prototype.toLocaleString() called with no arguments does not apply the default locale's digit grouping.
const b = 12345678901234567890n;
console.log(b.toLocaleString()); // perry: 12345678901234567890
// node: 12,345,678,901,234,567,890
console.log(b.toLocaleString('de-DE')); // both: 12.345.678.901.234.567.890
console.log((9876543n).toLocaleString('en-US')); // both: 9,876,543
Passing an explicit locale works correctly, so the formatter itself is fine — the no-argument path is not resolving to the default locale before formatting. Number.prototype.toLocaleString is unaffected ((1234567.891).toLocaleString() prints 1,234,567.891, matching Node), because it routes through the hand-rolled grouper in date.rs rather than intl::bigint_to_locale_string.
Reproduced on a pristine build of bd7cbb7da in a separate worktree, so this predates the current main.
Found while gating the thunk for binary size in #7427; that PR does not change this path (the ECMA-402 branch there is byte-for-byte unchanged).
BigInt.prototype.toLocaleString()called with no arguments does not apply the default locale's digit grouping.Passing an explicit locale works correctly, so the formatter itself is fine — the no-argument path is not resolving to the default locale before formatting.
Number.prototype.toLocaleStringis unaffected ((1234567.891).toLocaleString()prints1,234,567.891, matching Node), because it routes through the hand-rolled grouper indate.rsrather thanintl::bigint_to_locale_string.Reproduced on a pristine build of
bd7cbb7dain a separate worktree, so this predates the currentmain.Found while gating the thunk for binary size in #7427; that PR does not change this path (the ECMA-402 branch there is byte-for-byte unchanged).