Index: node_modules/vulcanize/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js |
diff --git a/node_modules/karma/node_modules/source-map/lib/source-map/source-node.js b/node_modules/vulcanize/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js |
similarity index 95% |
copy from node_modules/karma/node_modules/source-map/lib/source-map/source-node.js |
copy to node_modules/vulcanize/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js |
index baa5f40928eeafa68d2611eb454ecb8ea9e51b13..66a2ebc559a82c1c055f6ea6ac8bc426cd15c0d2 100644 |
--- a/node_modules/karma/node_modules/source-map/lib/source-map/source-node.js |
+++ b/node_modules/vulcanize/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js |
@@ -14,7 +14,7 @@ define(function (require, exports, module) { |
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other |
// operating systems these days (capturing the result). |
- var REGEX_NEWLINE = /(\r?\n)/; |
+ var REGEX_NEWLINE = /(\r?\n)/g; |
// Matches a Windows-style newline, or any character. |
var REGEX_CHARACTER = /\r\n|[\s\S]/g; |
@@ -34,10 +34,10 @@ define(function (require, exports, module) { |
function SourceNode(aLine, aColumn, aSource, aChunks, aName) { |
this.children = []; |
this.sourceContents = {}; |
- this.line = aLine == null ? null : aLine; |
- this.column = aColumn == null ? null : aColumn; |
- this.source = aSource == null ? null : aSource; |
- this.name = aName == null ? null : aName; |
+ this.line = aLine === undefined ? null : aLine; |
+ this.column = aColumn === undefined ? null : aColumn; |
+ this.source = aSource === undefined ? null : aSource; |
+ this.name = aName === undefined ? null : aName; |
if (aChunks != null) this.add(aChunks); |
} |
@@ -46,11 +46,9 @@ define(function (require, exports, module) { |
* |
* @param aGeneratedCode The generated code |
* @param aSourceMapConsumer The SourceMap for the generated code |
- * @param aRelativePath Optional. The path that relative sources in the |
- * SourceMapConsumer should be relative to. |
*/ |
SourceNode.fromStringWithSourceMap = |
- function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { |
+ function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) { |
// The SourceNode we want to fill with the generated code |
// and the SourceMap |
var node = new SourceNode(); |
@@ -130,10 +128,7 @@ define(function (require, exports, module) { |
// Copy sourcesContent into SourceNode |
aSourceMapConsumer.sources.forEach(function (sourceFile) { |
var content = aSourceMapConsumer.sourceContentFor(sourceFile); |
- if (content != null) { |
- if (aRelativePath != null) { |
- sourceFile = util.join(aRelativePath, sourceFile); |
- } |
+ if (content) { |
node.setSourceContent(sourceFile, content); |
} |
}); |
@@ -144,12 +139,9 @@ define(function (require, exports, module) { |
if (mapping === null || mapping.source === undefined) { |
node.add(code); |
} else { |
- var source = aRelativePath |
- ? util.join(aRelativePath, mapping.source) |
- : mapping.source; |
node.add(new SourceNode(mapping.originalLine, |
mapping.originalColumn, |
- source, |
+ mapping.source, |
code, |
mapping.name)); |
} |