Fix Android React Native environment shims which crash on normalizing Korean test (#1298).
This commit is contained in:
parent
b65508995c
commit
eb1ec2f231
@ -12,9 +12,19 @@
|
|||||||
var forms = ["NFD", "NFC", "NFKD", "NFKC"];
|
var forms = ["NFD", "NFC", "NFKD", "NFKC"];
|
||||||
for (var i = 0; i < forms.length; i++) {
|
for (var i = 0; i < forms.length; i++) {
|
||||||
try {
|
try {
|
||||||
|
// Simple test that catches invalid normalization
|
||||||
if ("test".normalize(forms[i]) !== "test") {
|
if ("test".normalize(forms[i]) !== "test") {
|
||||||
throw new Error("failed to normalize");
|
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) {
|
} catch(error) {
|
||||||
missing.push(forms[i]);
|
missing.push(forms[i]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user