Skip to content

Commit

Permalink
Fix Android React Native environment shims which crash on normalizing…
Browse files Browse the repository at this point in the history
… Korean test (#1298).
  • Loading branch information
ricmoo committed Apr 17, 2021
1 parent b655089 commit eb1ec2f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/shims/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,19 @@
var forms = ["NFD", "NFC", "NFKD", "NFKC"];
for (var i = 0; i < forms.length; i++) {
try {
// Simple test that catches invalid normalization
if ("test".normalize(forms[i]) !== "test") {
throw new Error("failed to normalize");
}

// Some platforms seem to only fail when normalizing
// specific code planes, so add those here as they
// come up.
// "hangul"
const checks = [ "\ud55c\uae00" ];
for (var j = 0; j < checks.length; j++) {
checks[j].normalize(forms[i]);
}
} catch(error) {
missing.push(forms[i]);
}
Expand Down

0 comments on commit eb1ec2f

Please sign in to comment.