lib/uglifier.rb in uglifier-4.1.2 vs lib/uglifier.rb in uglifier-4.1.3
- old
+ new
@@ -186,13 +186,11 @@
suffix = ''
if @options[:source_map][:map_url]
suffix += "\n//# sourceMappingURL=" + @options[:source_map][:map_url]
end
- if @options[:source_map][:url]
- suffix += "\n//# sourceURL=" + @options[:source_map][:url]
- end
+ suffix += "\n//# sourceURL=" + @options[:source_map][:url] if @options[:source_map][:url]
suffix
end
def source_with(path)
[ES5FallbackPath, SplitFallbackPath, SourceMapPath, path,
@@ -447,12 +445,10 @@
def input_source_map(source, generate_map)
return nil unless generate_map
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
+ Base64.strict_decode64(url.split(",", 2)[-1]) if url && url.start_with?("data:")
end)
rescue ArgumentError, JSON::ParserError
nil
end
end