You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dedupe NumberFormatUtils try/catch and sanitize remaining Intl callers
- Extract createFormatter helper in NumberFormatUtils/index.ts so format
and formatToParts share a single try/catch + USD fallback path
(addresses the CONSISTENCY-3 bot review on discussion_r3274381328).
- Apply sanitizeCurrencyCode to the two remaining direct callers that
bypassed layer-1 validation: the convertToDisplayString and
convertToDisplayStringWithoutCurrency closures in
CurrencyListContextProvider, and the formatToParts call in
SearchChartView. These previously only had the anonymous layer-2 catch
as a safety net and missed normalization (e.g. 'eur' rendering as USD).
- Add resetInvalidCurrencyWarningsForTesting in CurrencyUtils.ts so
Log.warn-asserting tests can clear the module-level throttle Set in
beforeEach instead of relying on globally-unique fixture strings.
- Add a cross-helper throttle test asserting the shared Set deduplicates
warnings across convertToDisplayString, getLocalizedCurrencySymbol,
and convertToShortDisplayString for the same malformed code.
- Add malformed-currency test matrix for
convertToDisplayStringWithExplicitCurrency, including the falsy
branch that delegates to convertToDisplayStringWithoutCurrency.
Co-authored-by: Cursor <cursoragent@cursor.com>
0 commit comments