source-map
Advanced tools
Comparing version 0.1.25 to 0.1.26
# Change Log | ||
## 0.1.26 | ||
* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70. | ||
## 0.1.25 | ||
@@ -4,0 +8,0 @@ |
@@ -128,3 +128,3 @@ /* -*- Mode: js; js-indent-level: 2; -*- */ | ||
function addMappingWithCode(mapping, code) { | ||
if (mapping.source === undefined) { | ||
if (mapping === null || mapping.source === undefined) { | ||
node.add(code); | ||
@@ -131,0 +131,0 @@ } else { |
{ | ||
"name": "source-map", | ||
"description": "Generates and consumes source maps", | ||
"version": "0.1.25", | ||
"version": "0.1.26", | ||
"homepage": "https://github.com/mozilla/source-map", | ||
@@ -19,3 +19,4 @@ "author": "Nick Fitzgerald <nfitzgerald@mozilla.com>", | ||
"Conrad Irwin <conrad.irwin@gmail.com>", | ||
"usrbincc <usrbincc@yahoo.com>" | ||
"usrbincc <usrbincc@yahoo.com>", | ||
"David Glasser <glasser@davidglasser.net>" | ||
], | ||
@@ -22,0 +23,0 @@ "repository": { |
@@ -41,3 +41,3 @@ # Source Map | ||
$ node Makefile.dryice.js` | ||
$ node Makefile.dryice.js | ||
@@ -44,0 +44,0 @@ This should create the following files: |
@@ -210,2 +210,21 @@ /* -*- Mode: js; js-indent-level: 2; -*- */ | ||
exports['test .fromStringWithSourceMap() empty map'] = function (assert, util) { | ||
var node = SourceNode.fromStringWithSourceMap( | ||
util.testGeneratedCode, | ||
new SourceMapConsumer(util.emptyMap)); | ||
var result = node.toStringWithSourceMap({ | ||
file: 'min.js' | ||
}); | ||
var map = result.map; | ||
var code = result.code; | ||
assert.equal(code, util.testGeneratedCode); | ||
assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator'); | ||
map = map.toJSON(); | ||
assert.equal(map.version, util.emptyMap.version); | ||
assert.equal(map.file, util.emptyMap.file); | ||
assert.equal(map.mappings.length, util.emptyMap.mappings.length); | ||
assert.equal(map.mappings, util.emptyMap.mappings); | ||
}; | ||
exports['test .fromStringWithSourceMap() complex version'] = function (assert, util) { | ||
@@ -212,0 +231,0 @@ var input = new SourceNode(null, null, null, [ |
@@ -59,3 +59,11 @@ /* -*- Mode: js; js-indent-level: 2; -*- */ | ||
}; | ||
exports.emptyMap = { | ||
version: 3, | ||
file: 'min.js', | ||
names: [], | ||
sources: [], | ||
mappings: '' | ||
}; | ||
function assertMapping(generatedLine, generatedColumn, originalSource, | ||
@@ -62,0 +70,0 @@ originalLine, originalColumn, name, map, assert, |
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
133991
3179