// Set source-map.js sourceMap to uglify.js MOZ_SourceMap
MOZ_SourceMap = sourceMap;

function comments(option) {
  if (Object.prototype.toString.call(option) === '[object Array]') {
    return new RegExp(option[0], option[1]);
  } else if (option == "jsdoc") {
    return function(node, comment) {
      if (comment.type == "comment2") {
        return /@preserve|@license|@cc_on/i.test(comment.value);
      } else {
        return false;
      }
    };
  } else {
    return option;
  }
}

function readNameCache(key) {
  return UglifyJS.readNameCache(null, key);
}

function writeNameCache(key, cache) {
  return UglifyJS.writeNameCache(null, key, cache);
}

function regexOption(options) {
  if (typeof options === 'object' && options.regex) {
    return new RegExp(options.regex[0], options.regex[1]);
  } else {
    return null;
  }
}

function parse(source, options) {
  var ast = UglifyJS.parse(source, options.parse_options);

  if (options.compress) {
    var compress = { warnings: false };
    UglifyJS.merge(compress, options.compress);
    ast.figure_out_scope(options.mangle);
    var compressor = UglifyJS.Compressor(compress);
    ast = compressor.compress(ast);
    ast.figure_out_scope();
  }

  if (options.mangle) {
    ast.figure_out_scope(options.mangle);
    ast.compute_char_frequency();
    ast.mangle_names(options.mangle);
  }

  if (options.mangle_properties) {
    var regex = regexOption(options.mangle_properties);
    UglifyJS.mangle_properties(ast, {
      reserved: [],
      only_cache: false,
      regex: regex,
      debug: options.mangle_properties.debug,
      ignore_quoted: options.mangle_properties.ignore_quoted
    });
  }

  if (options.enclose) {
    ast = ast.wrap_enclose(options.enclose);
  }
  return ast;
}

function copySourcesContent(sourceMap, options) {
  sourceMap.get().setSourceContent(options.parse_options.filename, options.source);

  var original = options.source_map_options.orig;

  if (original && original.sources && original.sourcesContent) {
    for(var i = 0; i < original.sources.length; i++) {
      sourceMap.get().setSourceContent(original.sources[i], original.sourcesContent[i]);
    }
  }
}

function uglifier(options) {
  var source = options.source;
  options.output.comments = comments(options.output.comments);

  if (options.mangle) {
    if (options.mangle.properties) {
      options.mangle.properties.regex = regexOption(options.mangle.properties);
    }
  }
  delete options.source;


  var inputFilename = '0'
  if (options.sourceMap) {
    inputFilename = options.sourceMap.input;
    delete options.sourceMap.input;
  }

  var inputs = {};
  inputs[inputFilename] = source;
  return UglifyJS.minify(inputs, options);
  var ast = parse(source, options);
  var source_map;

  var gen_code_options = options.output;
  gen_code_options.comments = comments(options.output.comments);

  if (options.generate_map) {
    source_map = UglifyJS.SourceMap(options.source_map_options);
    gen_code_options.source_map = source_map;

    if (options.source_map_options.sources_content) {
      copySourcesContent(source_map, options);
    }
  }

  var stream = UglifyJS.OutputStream(gen_code_options);
  ast.print(stream);

  if (options.source_map_options.map_url) {
    stream += "\n//# sourceMappingURL=" + options.source_map_options.map_url;
  }

  if (options.source_map_options.url) {
    stream += "\n//# sourceURL=" + options.source_map_options.url;
  }

  if (options.generate_map) {
    if (options.source_map_options.sources_content) {
      source_map.get().setSourceContent(options.parse_options.filename, options.source);
    }
    return [stream.toString(), source_map.toString()];
  } else {
    return stream.toString();
  }
}

@@ -490,178 +490,8 @@
 %0A%7D%0A%0A
-function readNameCache(key) %7B%0A  return UglifyJS.readNameCache(null, key);%0A%7D%0A%0Afunction writeNameCache(key, cache) %7B%0A  return UglifyJS.writeNameCache(null, key, cache);%0A%7D%0A%0A
 func
@@ -679,2873 +679,534 @@
 ion 
-parse(source, options) %7B%0A  var ast = UglifyJS.parse(source, options.parse_options);%0A%0A  if (options.compress) %7B%0A    var compress = %7B warnings: false %7D;%0A    UglifyJS.merge(compress, options.compress);%0A    ast.figure_out_scope(options.mangle);%0A    var compressor = UglifyJS.Compressor(compress);%0A    ast = compressor.compress(ast);%0A    ast.figure_out_scope();%0A  %7D%0A%0A  if (options.mangle) %7B%0A    ast.figure_out_scope(options.mangle);%0A    ast.compute_char_frequency();%0A    ast.mangle_names(options.mangle);%0A  %7D%0A%0A  if (options.mangle_properties) %7B%0A    var regex = regexOption(options.mangle_properties);%0A    UglifyJS.mangle_properties(ast, %7B%0A      reserved: %5B%5D,%0A      only_cache: false,%0A      regex: regex,%0A      debug: options.mangle_properties.debug,%0A      ignore_quoted: options.mangle_properties.ignore_quoted%0A    %7D);%0A  %7D%0A%0A  if (options.enclose) %7B%0A    ast = ast.wrap_enclose(options.enclose);%0A  %7D%0A  return ast;%0A%7D%0A%0Afunction copySourcesContent(sourceMap, options) %7B%0A  sourceMap.get().setSourceContent(options.parse_options.filename, options.source);%0A%0A  var original = options.source_map_options.orig;%0A%0A  if (original && original.sources && original.sourcesContent) %7B%0A    for(var i = 0; i %3C original.sources.length; i++) %7B%0A      sourceMap.get().setSourceContent(original.sources%5Bi%5D, original.sourcesContent%5Bi%5D);%0A    %7D%0A  %7D%0A%7D%0A%0Afunction uglifier(options) %7B%0A  var source = options.source;%0A  options.output.comments = comments(options.output.comments);%0A%0A  if (options.mangle) %7B%0A    if (options.mangle.properties) %7B%0A      options.mangle.properties.regex = regexOption(options.mangle.properties);%0A    %7D%0A  %7D%0A  delete options.source;%0A%0A%0A  var inputFilename = '0'%0A  if (options.sourceMap) %7B%0A    inputFilename = options.sourceMap.input;%0A    delete options.sourceMap.input;%0A  %7D%0A%0A  var inputs = %7B%7D;%0A  inputs%5BinputFilename%5D = source;%0A  return UglifyJS.minify(inputs, options);%0A  var ast = parse(source, options);%0A  var source_map;%0A%0A  var gen_code_options = options.output;%0A  gen_code_options.comments = comments(options.output.comments);%0A%0A  if (options.generate_map) %7B%0A    source_map = UglifyJS.SourceMap(options.source_map_options);%0A    gen_code_options.source_map = source_map;%0A%0A    if (options.source_map_options.sources_content) %7B%0A      copySourcesContent(source_map, options);%0A    %7D%0A  %7D%0A%0A  var stream = UglifyJS.OutputStream(gen_code_options);%0A  ast.print(stream);%0A%0A  if (options.source_map_options.map_url) %7B%0A    stream += %22%5Cn//# sourceMappingURL=%22 + options.source_map_options.map_url;%0A  %7D%0A%0A  if (options.source_map_options.url) %7B%0A    stream += %22%5Cn//# sourceURL=%22 + options.source_map_options.url;%0A  %7D%0A%0A  if (options.generate_map) %7B%0A    if (options.source_map_options.sources_content) %7B%0A      source_map.get().setSourceContent(options.parse_options.filename, options.source);%0A    %7D%0A    return %5Bstream.toString(), source_map.toString()%5D;%0A  %7D else %7B%0A    return stream.toString();%0A  %7D
+uglifier(options) %7B%0A  var source = options.source;%0A  options.output.comments = comments(options.output.comments);%0A%0A  if (options.mangle) %7B%0A    if (options.mangle.properties) %7B%0A      options.mangle.properties.regex = regexOption(options.mangle.properties);%0A    %7D%0A  %7D%0A  delete options.source;%0A%0A%0A  var inputFilename = '0'%0A  if (options.sourceMap) %7B%0A    inputFilename = options.sourceMap.input;%0A    delete options.sourceMap.input;%0A  %7D%0A%0A  var inputs = %7B%7D;%0A  inputs%5BinputFilename%5D = source;%0A  return UglifyJS.minify(inputs, options);
 %0A%7D%0A

Clean up uglifier.js