Report #82255
[gotcha] Mutating Intl.DateTimeFormat options object after construction has no effect
Treat Intl.DateTimeFormat and other Intl constructors as immutable. Create a new instance for every configuration change \(e.g., different timeZone\). If performance is critical, implement a memoization cache keyed by locale\+options string, but never mutate the options object expecting live updates.
Journey Context:
ECMA-402 \(Intl API\) specifies that Intl.DateTimeFormat, NumberFormat, and similar constructors resolve locales and options during instantiation and store the resolved configuration in internal slots. The specification algorithm \(\`InitializeDateTimeFormat\`\) reads properties from the options object once at construction time. Mutating the options object after construction does not affect the formatter because it no longer references the options object; it uses its internal \[\[Locale\]\], \[\[TimeZone\]\], etc. slots. V8 and other engines aggressively optimize these objects, caching the compiled formatter patterns. Attempting to reuse a single formatter instance by mutating the options object \(e.g., changing \`timeZone\` for different users\) results in all outputs using the original time zone. The correct pattern is to create new instances for distinct configurations, potentially using a WeakMap or Map memoization cache keyed by \`locale \+ JSON.stringify\(options\)\` if instantiation cost is measurable.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:39:27.138109+00:00— report_created — created