From 93a9b4941b460c495fb078267c65523cc11bde5f Mon Sep 17 00:00:00 2001 From: b-fuse Date: Sat, 31 Mar 2018 00:55:32 -0400 Subject: [PATCH] remove redundant global variable --- bin/uglifyjs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/bin/uglifyjs b/bin/uglifyjs index f4f299d3..c27dde27 100755 --- a/bin/uglifyjs +++ b/bin/uglifyjs @@ -12,9 +12,6 @@ var program = require("commander"); var UglifyJS = require("../tools/node"); var skip_keys = [ "cname", "inlined", "parent_scope", "scope", "uses_eval", "uses_with" ]; -var source_map_stub = { - path: null, -}; var files = {}; var options = { compress: false, @@ -176,8 +173,8 @@ function convert_ast(fn) { } function run() { - if (program.sourceMap && program.sourceMap.content === source_map_stub) { - program.sourceMap.content = read_file(source_map_stub.path, source_map_stub.path); + if (program.sourceMap && program.sourceMap.content) { + program.sourceMap.content = read_file(program.sourceMap.content, program.sourceMap.content); } UglifyJS.AST_Node.warn_function = function(msg) { @@ -391,8 +388,6 @@ function parse_source_map() { var settings = parse(value, options); if (!hasContent && settings.content && settings.content != "inline") { print_error("INFO: Using input source map: " + settings.content); - source_map_stub.path = settings.content; - settings.content = source_map_stub; } return settings; }