source-map
Advanced tools
Comparing version 0.4.1 to 0.4.2
# Change Log | ||
## 0.4.2 | ||
* Add an `.npmignore` file so that the benchmarks aren't pulled down by | ||
dependent projects. Issue #169. | ||
* Add an optional `column` argument to | ||
`SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines | ||
with no mappings. Issues #172 and #173. | ||
## 0.4.1 | ||
@@ -4,0 +13,0 @@ |
@@ -166,8 +166,12 @@ /* -*- Mode: js; js-indent-level: 2; -*- */ | ||
/** | ||
* Returns all generated line and column information for the original source | ||
* and line provided. The only argument is an object with the following | ||
* properties: | ||
* Returns all generated line and column information for the original source, | ||
* line, and column provided. If no column is provided, returns all mappings | ||
* corresponding to a single line. Otherwise, returns all mappings | ||
* corresponding to a single line and column. | ||
* | ||
* The only argument is an object with the following properties: | ||
* | ||
* - source: The filename of the original source. | ||
* - line: The line number in the original source. | ||
* - column: Optional. the column number in the original source. | ||
* | ||
@@ -183,8 +187,8 @@ * and an array of objects is returned, each with the following properties: | ||
// returns the index of the closest mapping less than the needle. By | ||
// setting needle.originalColumn to Infinity, we thus find the last | ||
// mapping for the given line, provided such a mapping exists. | ||
// setting needle.originalColumn to 0, we thus find the last mapping for | ||
// the given line, provided such a mapping exists. | ||
var needle = { | ||
source: util.getArg(aArgs, 'source'), | ||
originalLine: util.getArg(aArgs, 'line'), | ||
originalColumn: 0 | ||
originalColumn: util.getArg(aArgs, 'column', 0) | ||
}; | ||
@@ -206,2 +210,4 @@ | ||
var mapping = this._originalMappings[index]; | ||
var originalLine = mapping.originalLine; | ||
var originalColumn = mapping.originalColumn; | ||
@@ -211,3 +217,5 @@ // Iterate until either we run out of mappings, or we run into | ||
// guaranteed to find all mappings for the line we are searching for. | ||
while (mapping && mapping.originalLine === needle.originalLine) { | ||
while (mapping && mapping.originalLine === originalLine && | ||
(aArgs.column === undefined || | ||
mapping.originalColumn === originalColumn)) { | ||
mappings.push({ | ||
@@ -648,7 +656,9 @@ line: util.getArg(mapping, 'generatedLine', null), | ||
return { | ||
line: util.getArg(mapping, 'generatedLine', null), | ||
column: util.getArg(mapping, 'generatedColumn', null), | ||
lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) | ||
}; | ||
if (mapping.source === needle.source) { | ||
return { | ||
line: util.getArg(mapping, 'generatedLine', null), | ||
column: util.getArg(mapping, 'generatedColumn', null), | ||
lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) | ||
}; | ||
} | ||
} | ||
@@ -655,0 +665,0 @@ |
{ | ||
"name": "source-map", | ||
"description": "Generates and consumes source maps", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"homepage": "https://github.com/mozilla/source-map", | ||
@@ -38,3 +38,4 @@ "author": "Nick Fitzgerald <nfitzgerald@mozilla.com>", | ||
"Jamie Wong <jamie.lf.wong@gmail.com>", | ||
"Eddy Bruël <ejpbruel@mozilla.com>" | ||
"Eddy Bruël <ejpbruel@mozilla.com>", | ||
"Hawken Rives <hawkrives@gmail.com>" | ||
], | ||
@@ -41,0 +42,0 @@ "repository": { |
@@ -240,6 +240,9 @@ # Source Map | ||
Returns all generated line and column information for the original source | ||
and line provided. The only argument is an object with the following | ||
properties: | ||
Returns all generated line and column information for the original source, | ||
line, and column provided. If no column is provided, returns all mappings | ||
corresponding to a single line. Otherwise, returns all mappings corresponding to | ||
a single line and column. | ||
The only argument is an object with the following properties: | ||
* `source`: The filename of the original source. | ||
@@ -249,2 +252,4 @@ | ||
* `column`: Optional. The column number in the original source. | ||
and an array of objects is returned, each with the following properties: | ||
@@ -251,0 +256,0 @@ |
Sorry, the diff of this file is not supported yet
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
7760
501
1
461435
41
2
1