From: Bryce Cronkite-Ratcliff Date: Sat, 24 Jan 2015 08:24:08 +0000 (-0800) Subject: fixes issue #621 SourceMap toString JSON format X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=5c02d65ddb8d315d53a4356c038b461ddb1cb029;p=UglifyJS.git fixes issue #621 SourceMap toString JSON format The correct format of a sourcemap is acquired from a mozilla source map generator by calling toJSON on this object. This patch alters the toString function on mozilla generators to print the format that is to spec instead of the generator's internal representation of itself. --- diff --git a/lib/sourcemap.js b/lib/sourcemap.js index 3998e405..a67011f0 100644 --- a/lib/sourcemap.js +++ b/lib/sourcemap.js @@ -87,6 +87,6 @@ function SourceMap(options) { return { add : add, get : function() { return generator }, - toString : function() { return generator.toString() } + toString : function() { return JSON.stringify(generator.toJSON()); } }; };