fix(util): Make string comparisons match Flash's, everywhere
This commit is contained in:
1 file changed
+7
-1
+7
-1
@@ -118,7 +118,13 @@ class Cast {
|
||||
// Scratch compares strings as case insensitive.
|
||||
const s1 = String(v1).toLowerCase();
|
||||
const s2 = String(v2).toLowerCase();
|
||||
return s1.localeCompare(s2);
|
||||
if(s1 < s2) {
|
||||
return -1
|
||||
} else if (s1 > s2) {
|
||||
return 1
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
// Compare as numbers.
|
||||
return n1 - n2;
|
||||
|
||||
Reference in new issue
Block a user