Skip to content

Commit 02718d0

Browse files
committed
fix bug for Array.sort(null) on FF
1 parent bfeb41f commit 02718d0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "regex-trigram",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "JavaScript port of portions of Google Code Search",
55
"author": "Bright Fulton",
66
"main": "lib/regex.js",

src/regex-query.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,11 @@ var clean = function(s, isSuffix) {
727727
if (s.length === 0) {
728728
return s;
729729
}
730-
s = s.sort(isSuffix ? suffixComparator : null);
730+
if (isSuffix) {
731+
s = s.sort(suffixComparator);
732+
} else {
733+
s = s.sort();
734+
}
731735
var sPrime = [s[0]];
732736
for (var i = 1; i < s.length; i++) {
733737
var val = s[i];

0 commit comments

Comments
 (0)