Skip to content

Commit

Permalink
Pre-suppress unsafe string key access errors in www 1/n
Browse files Browse the repository at this point in the history
Reviewed By: alexmckenley

Differential Revision: D56484690

fbshipit-source-id: 5c809c97100d1b6a31cc1cede2efa1b570dfe970
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Apr 23, 2024
1 parent 5159c7b commit 45ebf8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions runtime/shared/IntlPunctuation.js
Expand Up @@ -113,13 +113,15 @@ export function applyPhonologicalRules(text: string): string {
*/
const _normalizedStops = new Map<$FlowFixMe | string, string>();
for (const norm in IntlRedundantStops.equivalencies) {
// $FlowFixMe[invalid-computed-prop]
for (const eq of [norm].concat(IntlRedundantStops.equivalencies[norm])) {
_normalizedStops.set(eq, norm);
}
}

const _redundancies = new Map<?string, Set<?string>>();
for (const prefix in IntlRedundantStops.redundancies) {
// $FlowFixMe[invalid-computed-prop]
_redundancies.set(prefix, new Set(IntlRedundantStops.redundancies[prefix]));
}

Expand Down
1 change: 1 addition & 0 deletions runtime/shared/__tests__/IntlPunctuation-test.js
Expand Up @@ -118,6 +118,7 @@ describe('IntlPunctuation', function () {
],
};
for (const prefix in expected) {
// $FlowFixMe[invalid-computed-prop]
for (const suffix of expected[prefix]) {
const result = dedupeStops(prefix, suffix);
expect({prefix, suffix, result}).toEqual({prefix, suffix, result: ''});
Expand Down

0 comments on commit 45ebf8c

Please sign in to comment.