lib/uglifier.rb in uglifier-3.1.2 vs lib/uglifier.rb in uglifier-3.1.3.harmony1
- old
+ new
@@ -78,11 +78,11 @@
:pure_funcs => nil, # List of functions without side-effects. Can safely discard function calls when the result value is not used
:drop_console => false, # Drop calls to console.* functions
:angular => false, # Process @ngInject annotations
:keep_fargs => false, # Preserve unused function arguments
:keep_fnames => false, # Do not drop names in function definitions
- :passes => 2
+ :passes => 1 # Number of times to run compress. Raising the number of passes will increase compress time, but can produce slightly smaller code.
}, # Apply transformations to code, set to false to skip
:define => {}, # Define values for symbol replacement
:enclose => false, # Enclose in output function wrapper, define replacements as key-value pairs
:keep_fnames => false, # Generate code safe for the poor souls relying on Function.prototype.name at run-time. Sets both compress and mangle keep_fanems to true.
:screw_ie8 => false, # Don't bother to generate safe code for IE8
@@ -368,10 +368,11 @@
match && match[1]
end
def input_source_map(source, generate_map)
return nil unless generate_map
- sanitize_map_root(@options.fetch(:source_map, {}).fetch(:input_source_map) do
+ source_map_options = @options[:source_map].is_a?(Hash) ? @options[:source_map] : {}
+ sanitize_map_root(source_map_options.fetch(:input_source_map) do
url = extract_source_mapping_url(source)
if url && url.start_with?("data:")
Base64.strict_decode64(url.split(",", 2)[-1])
end
end)