From 368688928317d4496f42064379d3a295f5c82c05 Mon Sep 17 00:00:00 2001 From: David Lane Date: Wed, 26 Feb 2014 12:12:43 -0500 Subject: [PATCH] Assume missing map names means name hasn't changed If the original source map doesn't specify a name for location then assume that the name hasn't changed from the original source. In that case, use the current name detected by UglifyJS' AST. --- lib/sourcemap.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/sourcemap.js b/lib/sourcemap.js index 8e86ebd8..b42c45f8 100644 --- a/lib/sourcemap.js +++ b/lib/sourcemap.js @@ -67,7 +67,9 @@ function SourceMap(options) { source = info.source; orig_line = info.line; orig_col = info.column; - name = info.name; + if (info.name) { + name = info.name; + } } generator.addMapping({ generated : { line: gen_line + options.dest_line_diff, column: gen_col },