address: fix isMixedCase.

This commit is contained in:
Christopher Jeffrey 2017-07-25 16:48:30 -07:00
parent 9a2d39c751
commit 8036c301a1
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -887,10 +887,16 @@ function isMixedCase(str) {
for (let i = 0; i < str.length; i++) {
let ch = str.charCodeAt(i);
if (ch & 32)
if (ch >= 0x30 && ch <= 0x39)
continue;
if (ch & 32) {
assert(ch >= 0x61 && ch <= 0x7a);
lower = true;
else
} else {
assert(ch >= 0x41 && ch <= 0x5a);
upper = true;
}
if (lower && upper)
return true;