source-map
Advanced tools
Comparing version 0.4.0 to 0.4.1
# Change Log | ||
## 0.4.1 | ||
* Fix accidentally defining a global variable. #170. | ||
## 0.4.0 | ||
@@ -4,0 +8,0 @@ |
@@ -98,6 +98,21 @@ /* -*- Mode: js; js-indent-level: 2; -*- */ | ||
return recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, | ||
aBias || exports.GREATEST_LOWER_BOUND); | ||
var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, | ||
aCompare, aBias || exports.GREATEST_LOWER_BOUND); | ||
if (index < 0) { | ||
return -1; | ||
} | ||
// We have found either the exact element, or the next-closest element than | ||
// the one we are searching for. However, there may be more than one such | ||
// element. Make sure we always return the smallest of these. | ||
while (index - 1 >= 0) { | ||
if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { | ||
break; | ||
} | ||
--index; | ||
} | ||
return index; | ||
}; | ||
}); |
@@ -355,3 +355,3 @@ /* -*- Mode: js; js-indent-level: 2; -*- */ | ||
var temp = {}; | ||
var mapping, str, values, end; | ||
var mapping, str, values, end, value; | ||
@@ -358,0 +358,0 @@ while (index < length) { |
@@ -264,3 +264,3 @@ /* -*- Mode: js; js-indent-level: 2; -*- */ | ||
cmp = strcmp(mappingA.name, mappingB.name); | ||
cmp = mappingA.generatedColumn - mappingB.generatedColumn; | ||
if (cmp) { | ||
@@ -275,3 +275,3 @@ return cmp; | ||
return mappingA.generatedColumn - mappingB.generatedColumn; | ||
return strcmp(mappingA.name, mappingB.name); | ||
}; | ||
@@ -278,0 +278,0 @@ exports.compareByOriginalPositions = compareByOriginalPositions; |
{ | ||
"name": "source-map", | ||
"description": "Generates and consumes source maps", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"homepage": "https://github.com/mozilla/source-map", | ||
@@ -6,0 +6,0 @@ "author": "Nick Fitzgerald <nfitzgerald@mozilla.com>", |
@@ -86,2 +86,18 @@ /* -*- Mode: js; js-indent-level: 2; -*- */ | ||
exports['test multiple matches'] = function (assert, util) { | ||
var needle = 5; | ||
var haystack = [1, 1, 2, 5, 5, 5, 13, 21]; | ||
assert.equal(binarySearch.search(needle, haystack, numberCompare, | ||
binarySearch.LEAST_UPPER_BOUND), 3); | ||
}; | ||
exports['test multiple matches at the beginning'] = function (assert, util) { | ||
var needle = 1; | ||
var haystack = [1, 1, 2, 5, 5, 5, 13, 21]; | ||
assert.equal(binarySearch.search(needle, haystack, numberCompare, | ||
binarySearch.LEAST_UPPER_BOUND), 0); | ||
}; | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
16166701
6564
0