uglifier 3.2.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d2722575407efccc0c2cfb1f160b6306a6a8452
4
- data.tar.gz: 67ac05657beeea49bdeca3a7acf59037ad9a0ee8
3
+ metadata.gz: d161a455919cc87b9ac6f7d7b95244d8f39c2cf7
4
+ data.tar.gz: cc5a06ebea3dd02c15b65808b6739d8ee5a90da5
5
5
  SHA512:
6
- metadata.gz: a8e246165b8e7a6753b43fe5868e2a4dcf7f204098946cfbc6eee4bb50b1be92d5b220124423388166e0852b09afe8f77bcbd6e9079cc16a256e07f0d00e5822
7
- data.tar.gz: 604fc25e6ab69d9af0846f0bb2fe8bbb7e243e683d7341b808deb6378275575394152aaa60c4103a4d2e378b97d6fd843aeacc66a23f109b4d65bc73a3270e67
6
+ metadata.gz: bcc621675abbb456cc1e9e2177294af3e5ed73460452baf5b278293ef516bfe4d160b40c16f486ecf7eafaf2e7f4acbbb9d38e53b0ad8321f6f7165dbc112ddf
7
+ data.tar.gz: 5e62e7214959feed02b9e44b2c51c43ed57021ee075bb567bb6eca83ec1cdcb3c8c68ba798a86813b5d95d72fdfec81d3dda23933827cb540951e432502426ce
@@ -1,4 +1,5 @@
1
1
  AllCops:
2
+ DisplayCopNames: true
2
3
  Exclude:
3
4
  - uglifier.gemspec
4
5
  - lib/uglifier/version.rb
@@ -19,6 +20,9 @@ Metrics/LineLength:
19
20
  Metrics/MethodLength:
20
21
  Max: 20
21
22
 
23
+ Style/Encoding:
24
+ Enabled: false
25
+
22
26
  Style/HashSyntax:
23
27
  EnforcedStyle: hash_rockets
24
28
 
@@ -5,27 +5,29 @@ rvm:
5
5
  - 1.9.3
6
6
  - 2.0.0
7
7
  - 2.1.10
8
- - 2.2.6
9
- - 2.3.3
10
- - 2.4.1
8
+ - 2.2.8
9
+ - 2.3.5
10
+ - 2.4.2
11
11
  - ruby-head
12
12
  - jruby-19mode
13
- - jruby-9.1.8.0
13
+ - jruby-9.1.13.0
14
+ before_install:
15
+ - gem install bundler -v 1.15.4
14
16
  git:
15
17
  submodules: false
16
18
  gemfile:
17
19
  - Gemfile
18
20
  matrix:
19
21
  include:
20
- - rvm: 2.4.1
22
+ - rvm: 2.4.2
21
23
  gemfile: gemfiles/rubyracer
22
- - rvm: jruby-9.1.8.0
24
+ - rvm: jruby-9.1.13.0
23
25
  gemfile: gemfiles/rubyrhino
24
- - rvm: 2.4.1
26
+ - rvm: 2.4.2
25
27
  gemfile: gemfiles/alaska
26
28
  env: ALASKA=1
27
29
  allow_failures:
28
- - rvm: 2.4.1
30
+ - rvm: 2.4.2
29
31
  gemfile: gemfiles/alaska
30
32
  env: ALASKA=1
31
33
  - rvm: ruby-head
@@ -1,3 +1,26 @@
1
+ ## 4.0.0 (2 December 2017)
2
+
3
+ - update UglifyJS to 3.2.0
4
+ - remove Angular ngInject processing
5
+ - add unsafe_math compress option
6
+ - add reduce_funcs compress option
7
+ - add parse options
8
+ - add shebang output option
9
+ - add keep_infinity compress option
10
+ - add quote_style output option
11
+ - add side_effects compress option
12
+ - add switches compress option
13
+ - more helpful error Message in Harmony mode
14
+
15
+ Dropped options:
16
+
17
+ - output: angular
18
+ - mangle: except => reserved
19
+ - mangle_properties: ignore_quoted => keep_quoted
20
+ - enclose
21
+ - squeeze, copyright and screw_ie8 options
22
+
23
+
1
24
  ## 3.2.0 (9 April 2017)
2
25
 
3
26
  - experimental ES6/Harmony mode based on UglifyJS2 Harmony branch
data/Gemfile CHANGED
@@ -2,4 +2,4 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'rubocop', '~> 0.48.0', :group => [:development] if RUBY_VERSION >= '2.0'
5
+ gem 'rubocop', '~> 0.51.0', :group => [:development] if RUBY_VERSION >= '2.1'
data/README.md CHANGED
@@ -66,10 +66,12 @@ Available options and their defaults are
66
66
  :beautify => false, # Beautify output
67
67
  :indent_level => 4, # Indent level in spaces
68
68
  :indent_start => 0, # Starting indent level
69
- :space_colon => false, # Insert space before colons (only with beautifier)
70
69
  :width => 80, # Specify line width when beautifier is used (only with beautifier)
71
70
  :preamble => nil, # Preamble for the generated JS file. Can be used to insert any code or comment.
72
71
  :wrap_iife => false # Wrap IIFEs in parenthesis. Note: this disables the negate_iife compression option.
72
+ :shebang => true # Preserve shebang (#!) in preamble (shell scripts)
73
+ :quote_style => 0, # Quote style, possible values :auto (default), :single, :double, :original
74
+ :keep_quoted_props => false # Keep quotes property names
73
75
  },
74
76
  :mangle => {
75
77
  :eval => false, # Mangle names when eval of when is used in scope
@@ -91,6 +93,7 @@ Available options and their defaults are
91
93
  :drop_debugger => true, # Remove debugger; statements
92
94
  :unsafe => false, # Apply "unsafe" transformations
93
95
  :unsafe_comps => false, # Reverse < and <= to > and >= to allow improved compression. This might be unsafe when an at least one of two operands is an object with computed values due the use of methods like get, or valueOf. This could cause change in execution order after operands in the comparison are switching. Compression only works if both comparisons and unsafe_comps are both set to true.
96
+ :unsafe_math => false, # Optimize numerical expressions like 2 * x * 3 into 6 * x, which may give imprecise floating point results.
94
97
  :unsafe_proto => false, # Optimize expressions like Array.prototype.slice.call(a) into [].slice.call(a)
95
98
  :conditionals => true, # Optimize for if-s and conditional expressions
96
99
  :comparisons => true, # Apply binary node optimizations for comparisons
@@ -106,16 +109,26 @@ Available options and their defaults are
106
109
  :join_vars => true, # Join consecutive var statements
107
110
  :cascade => true, # Cascade sequences
108
111
  :collapse_vars => false, # Collapse single-use var and const definitions when possible.
112
+ :reduce_funcs => false, # Inline single-use functions as function expressions. Depends on reduce_vars.
109
113
  :reduce_vars => false, # Collapse variables assigned with and used as constant values.
110
114
  :negate_iife => true, # Negate immediately invoked function expressions to avoid extra parens
111
115
  :pure_getters => false, # Assume that object property access does not have any side-effects
112
116
  :pure_funcs => nil, # List of functions without side-effects. Can safely discard function calls when the result value is not used
113
117
  :drop_console => false, # Drop calls to console.* functions
114
- :angular => false, # Process @ngInject annotations
115
118
  :keep_fargs => false, # Preserve unused function arguments
116
- :keep_fnames => false # Do not drop names in function definitions
117
- :passes => 1 # Number of times to run compress. Raising the number of passes will increase compress time, but can produce slightly smaller code.
119
+ :keep_fnames => false, # Do not drop names in function definitions
120
+ :passes => 1, # Number of times to run compress. Raising the number of passes will increase compress time, but can produce slightly smaller code.
121
+ :keep_infinity => false, # Prevent compression of Infinity to 1/0
122
+ :side_effects => true, # Pass false to disable potentially dropping functions marked as "pure" using pure comment annotation. See UglifyJS documentation for details.
123
+ :switches => true, # de-duplicate and remove unreachable switch branches
118
124
  }, # Apply transformations to code, set to false to skip
125
+ :parse => {
126
+ :bare_returns => false, # Allow top-level return statements.
127
+ :expression => false, # Parse a single expression, rather than a program (for parsing JSON).
128
+ :html5_comments => true, # Ignore HTML5 comments in input
129
+ :shebang => true, # support #!command as the first line
130
+ :strict => false
131
+ },
119
132
  :define => {}, # Define values for symbol replacement
120
133
  :enclose => false, # Enclose in output function wrapper, define replacements as key-value pairs
121
134
  :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.
@@ -17,14 +17,6 @@ function comments(option) {
17
17
  }
18
18
  }
19
19
 
20
- function readNameCache(key) {
21
- return UglifyJS.readNameCache(null, key);
22
- }
23
-
24
- function writeNameCache(key, cache) {
25
- return UglifyJS.writeNameCache(null, key, cache);
26
- }
27
-
28
20
  function regexOption(options) {
29
21
  if (typeof options === 'object' && options.regex) {
30
22
  return new RegExp(options.regex[0], options.regex[1]);
@@ -33,88 +25,25 @@ function regexOption(options) {
33
25
  }
34
26
  }
35
27
 
36
- function parse(source, options) {
37
- UglifyJS.base54.reset();
38
- var ast = UglifyJS.parse(source, options.parse_options);
39
-
40
- if (options.compress) {
41
- var compress = { warnings: false };
42
- UglifyJS.merge(compress, options.compress);
43
- ast.figure_out_scope(options.mangle);
44
- var compressor = UglifyJS.Compressor(compress);
45
- ast = compressor.compress(ast);
46
- ast.figure_out_scope();
47
- }
48
-
49
- if (options.mangle) {
50
- ast.figure_out_scope(options.mangle);
51
- ast.compute_char_frequency();
52
- ast.mangle_names(options.mangle);
53
- }
54
-
55
- if (options.mangle_properties) {
56
- var regex = regexOption(options.mangle_properties);
57
- UglifyJS.mangle_properties(ast, {
58
- reserved: [],
59
- only_cache: false,
60
- regex: regex,
61
- debug: options.mangle_properties.debug,
62
- ignore_quoted: options.mangle_properties.ignore_quoted
63
- });
64
- }
65
-
66
- if (options.enclose) {
67
- ast = ast.wrap_enclose(options.enclose);
68
- }
69
- return ast;
70
- }
71
-
72
- function copySourcesContent(sourceMap, options) {
73
- sourceMap.get().setSourceContent(options.parse_options.filename, options.source);
74
-
75
- var original = options.source_map_options.orig;
76
-
77
- if (original && original.sources && original.sourcesContent) {
78
- for(var i = 0; i < original.sources.length; i++) {
79
- sourceMap.get().setSourceContent(original.sources[i], original.sourcesContent[i]);
80
- }
81
- }
82
- }
83
-
84
28
  function uglifier(options) {
85
29
  var source = options.source;
86
- var ast = parse(source, options);
87
- var source_map;
88
-
89
- var gen_code_options = options.output;
90
- gen_code_options.comments = comments(options.output.comments);
30
+ options.output.comments = comments(options.output.comments);
91
31
 
92
- if (options.generate_map) {
93
- source_map = UglifyJS.SourceMap(options.source_map_options);
94
- gen_code_options.source_map = source_map;
95
-
96
- if (options.source_map_options.sources_content) {
97
- copySourcesContent(source_map, options);
32
+ if (options.mangle) {
33
+ if (options.mangle.properties) {
34
+ options.mangle.properties.regex = regexOption(options.mangle.properties);
98
35
  }
99
36
  }
37
+ delete options.source;
100
38
 
101
- var stream = UglifyJS.OutputStream(gen_code_options);
102
- ast.print(stream);
103
-
104
- if (options.source_map_options.map_url) {
105
- stream += "\n//# sourceMappingURL=" + options.source_map_options.map_url;
106
- }
107
39
 
108
- if (options.source_map_options.url) {
109
- stream += "\n//# sourceURL=" + options.source_map_options.url;
40
+ var inputFilename = '0'
41
+ if (options.sourceMap) {
42
+ inputFilename = options.sourceMap.input;
43
+ delete options.sourceMap.input;
110
44
  }
111
45
 
112
- if (options.generate_map) {
113
- if (options.source_map_options.sources_content) {
114
- source_map.get().setSourceContent(options.parse_options.filename, options.source);
115
- }
116
- return [stream.toString(), source_map.toString()];
117
- } else {
118
- return stream.toString();
119
- }
46
+ var inputs = {};
47
+ inputs[inputFilename] = source;
48
+ return UglifyJS.minify(inputs, options);
120
49
  }
@@ -8,7 +8,7 @@ require "uglifier/version"
8
8
  # A wrapper around the UglifyJS interface
9
9
  class Uglifier
10
10
  # Error class for compilation errors.
11
- Error = ExecJS::Error
11
+ class Error < StandardError; end
12
12
 
13
13
  # UglifyJS source path
14
14
  SourcePath = File.expand_path("../uglify.js", __FILE__)
@@ -38,20 +38,19 @@ class Uglifier
38
38
  :beautify => false, # Beautify output
39
39
  :indent_level => 4, # Indent level in spaces
40
40
  :indent_start => 0, # Starting indent level
41
- :space_colon => false, # Insert space before colons (only with beautifier)
42
41
  :width => 80, # Specify line width when beautifier is used (only with beautifier)
43
42
  :preamble => nil, # Preamble for the generated JS file. Can be used to insert any code or comment.
44
- :wrap_iife => false # Wrap IIFEs in parenthesis. Note: this disables the negate_iife compression option.
43
+ :wrap_iife => false, # Wrap IIFEs in parenthesis. Note: this disables the negate_iife compression option.
44
+ :shebang => true, # Preserve shebang (#!) in preamble (shell scripts)
45
+ :quote_style => 0, # Quote style, possible values :auto (default), :single, :double, :original
46
+ :keep_quoted_props => false # Keep quotes property names
45
47
  },
46
48
  :mangle => {
47
49
  :eval => false, # Mangle names when eval of when is used in scope
48
- :except => ["$super"], # Argument names to be excluded from mangling
49
- :sort => false, # Assign shorter names to most frequently used variables. Often results in bigger output after gzip.
50
- :toplevel => false, # Mangle names declared in the toplevel scope
50
+ :reserved => ["$super"], # Argument names to be excluded from mangling
51
51
  :properties => false, # Mangle property names
52
- :keep_fnames => false # Do not modify function names
52
+ :toplevel => false, # Mangle names declared in the toplevel scope
53
53
  }, # Mangle variable and function names, set to false to skip mangling
54
- :mangle_properties => false, # Mangle property names
55
54
  :compress => {
56
55
  :sequences => true, # Allow statements to be joined by commas
57
56
  :properties => true, # Rewrite property access using the dot notation
@@ -59,6 +58,7 @@ class Uglifier
59
58
  :drop_debugger => true, # Remove debugger; statements
60
59
  :unsafe => false, # Apply "unsafe" transformations
61
60
  :unsafe_comps => false, # Reverse < and <= to > and >= to allow improved compression. This might be unsafe when an at least one of two operands is an object with computed values due the use of methods like get, or valueOf. This could cause change in execution order after operands in the comparison are switching. Compression only works if both comparisons and unsafe_comps are both set to true.
61
+ :unsafe_math => false, # Optimize numerical expressions like 2 * x * 3 into 6 * x, which may give imprecise floating point results.
62
62
  :unsafe_proto => false, # Optimize expressions like Array.prototype.slice.call(a) into [].slice.call(a)
63
63
  :conditionals => true, # Optimize for if-s and conditional expressions
64
64
  :comparisons => true, # Apply binary node optimizations for comparisons
@@ -74,30 +74,42 @@ class Uglifier
74
74
  :join_vars => true, # Join consecutive var statements
75
75
  :cascade => true, # Cascade sequences
76
76
  :collapse_vars => true, # Collapse single-use var and const definitions when possible.
77
+ :reduce_funcs => false, # Inline single-use functions as function expressions. Depends on reduce_vars.
77
78
  :reduce_vars => false, # Collapse variables assigned with and used as constant values.
78
79
  :negate_iife => true, # Negate immediately invoked function expressions to avoid extra parens
79
80
  :pure_getters => false, # Assume that object property access does not have any side-effects
80
81
  :pure_funcs => nil, # List of functions without side-effects. Can safely discard function calls when the result value is not used
81
82
  :drop_console => false, # Drop calls to console.* functions
82
- :angular => false, # Process @ngInject annotations
83
83
  :keep_fargs => false, # Preserve unused function arguments
84
84
  :keep_fnames => false, # Do not drop names in function definitions
85
- :passes => 1 # Number of times to run compress. Raising the number of passes will increase compress time, but can produce slightly smaller code.
85
+ :passes => 1, # Number of times to run compress. Raising the number of passes will increase compress time, but can produce slightly smaller code.
86
+ :keep_infinity => false, # Prevent compression of Infinity to 1/0
87
+ :side_effects => true, # Pass false to disable potentially dropping functions marked as "pure" using pure comment annotation. See UglifyJS documentation for details.
88
+ :switches => true, # de-duplicate and remove unreachable switch branches
86
89
  }, # Apply transformations to code, set to false to skip
90
+ :parse => {
91
+ :bare_returns => false, # Allow top-level return statements.
92
+ :expression => false, # Parse a single expression, rather than a program (for parsing JSON).
93
+ :html5_comments => true, # Ignore HTML5 comments in input
94
+ :shebang => true, # support #!command as the first line
95
+ :strict => false
96
+ },
87
97
  :define => {}, # Define values for symbol replacement
88
- :enclose => false, # Enclose in output function wrapper, define replacements as key-value pairs
89
98
  :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.
90
- :screw_ie8 => false, # Don't bother to generate safe code for IE8
99
+ :toplevel => false,
100
+ :ie8 => true, # Generate safe code for IE8
91
101
  :source_map => false, # Generate source map
92
102
  :harmony => false # Enable ES6/Harmony mode (experimental). Disabling mangling and compressing is recommended with Harmony mode.
93
103
  }
94
104
 
95
- LEGACY_OPTIONS = [:comments, :squeeze, :copyright, :mangle]
105
+ EXTRA_OPTIONS = [:comments, :mangle_properties]
96
106
 
97
107
  MANGLE_PROPERTIES_DEFAULTS = {
108
+ :debug => false, # Add debug prefix and suffix to mangled properties
98
109
  :regex => nil, # A regular expression to filter property names to be mangled
99
- :ignore_quoted => false, # Only mangle unquoted property names
100
- :debug => false # Mangle names with the original name still present
110
+ :keep_quoted => false, # Keep quoted property names
111
+ :reserved => [], # List of properties that should not be mangled
112
+ :builtins => false, # Mangle properties that overlap with standard JS globals
101
113
  }
102
114
 
103
115
  SOURCE_MAP_DEFAULTS = {
@@ -134,12 +146,12 @@ class Uglifier
134
146
  #
135
147
  # @param options [Hash] optional overrides to +Uglifier::DEFAULTS+
136
148
  def initialize(options = {})
137
- (options.keys - DEFAULTS.keys - LEGACY_OPTIONS)[0..1].each do |missing|
149
+ (options.keys - DEFAULTS.keys - EXTRA_OPTIONS)[0..1].each do |missing|
138
150
  raise ArgumentError, "Invalid option: #{missing}"
139
151
  end
140
152
  @options = options
141
153
 
142
- source = @options[:harmony] ? source_with(HarmonySourcePath) : source_with(SourcePath)
154
+ source = harmony? ? source_with(HarmonySourcePath) : source_with(SourcePath)
143
155
  @context = ExecJS.compile(source)
144
156
  end
145
157
 
@@ -169,6 +181,20 @@ class Uglifier
169
181
 
170
182
  private
171
183
 
184
+ def source_map_comments
185
+ return '' unless @options[:source_map].respond_to?(:[])
186
+
187
+ suffix = ''
188
+ if @options[:source_map][:map_url]
189
+ suffix += "\n//# sourceMappingURL=" + @options[:source_map][:map_url]
190
+ end
191
+
192
+ if @options[:source_map][:url]
193
+ suffix += "\n//# sourceURL=" + @options[:source_map][:url]
194
+ end
195
+ suffix
196
+ end
197
+
172
198
  def source_with(path)
173
199
  [ES5FallbackPath, SplitFallbackPath, SourceMapPath, path,
174
200
  UglifyJSWrapperPath].map do |file|
@@ -185,14 +211,36 @@ class Uglifier
185
211
  :output => output_options,
186
212
  :compress => compressor_options,
187
213
  :mangle => mangle_options,
188
- :mangle_properties => mangle_properties_options,
189
- :parse_options => parse_options,
190
- :source_map_options => source_map_options(input_map),
191
- :generate_map => generate_map,
192
- :enclose => enclose_options
214
+ :parse => parse_options,
215
+ :sourceMap => source_map_options(input_map),
216
+ :ie8 => ie8?
193
217
  }
194
218
 
195
- @context.call("uglifier", options)
219
+ parse_result(@context.call("uglifier", options), generate_map)
220
+ end
221
+
222
+ def harmony?
223
+ @options[:harmony]
224
+ end
225
+
226
+ def error_message(result)
227
+ result['error']['message'] +
228
+ if result['error']['message'].start_with?("Unexpected token:") && !harmony?
229
+ ". To use ES6 syntax, harmony mode must be enabled with " \
230
+ "Uglifier.new(:harmony => true)."
231
+ else
232
+ ""
233
+ end
234
+ end
235
+
236
+ def parse_result(result, generate_map)
237
+ raise Error, error_message(result) if result.has_key?('error')
238
+
239
+ if generate_map
240
+ [result['code'] + source_map_comments, result['map']]
241
+ else
242
+ result['code'] + source_map_comments
243
+ end
196
244
  end
197
245
 
198
246
  def read_source(source)
@@ -210,15 +258,24 @@ class Uglifier
210
258
  )
211
259
 
212
260
  conditional_option(
213
- @options.fetch(:mangle, DEFAULTS[:mangle]),
261
+ @options[:mangle],
214
262
  defaults,
215
- :keep_fnames => keep_fnames?(:mangle)
263
+ :properties => mangle_properties_options
216
264
  )
217
265
  end
218
266
 
219
267
  def mangle_properties_options
220
- mangle_options = @options.fetch(:mangle_properties, DEFAULTS[:mangle_properties])
221
- options = conditional_option(mangle_options, MANGLE_PROPERTIES_DEFAULTS)
268
+ mangle_options = conditional_option(@options[:mangle], DEFAULTS[:mangle])
269
+
270
+ mangle_properties_options =
271
+ if @options.has_key?(:mangle_properties)
272
+ @options[:mangle_properties]
273
+ else
274
+ mangle_options && mangle_options[:properties]
275
+ end
276
+
277
+ options = conditional_option(mangle_properties_options, MANGLE_PROPERTIES_DEFAULTS)
278
+
222
279
  if options && options[:regex]
223
280
  options.merge(:regex => encode_regexp(options[:regex]))
224
281
  else
@@ -229,12 +286,11 @@ class Uglifier
229
286
  def compressor_options
230
287
  defaults = conditional_option(
231
288
  DEFAULTS[:compress],
232
- :global_defs => @options[:define] || {},
233
- :screw_ie8 => screw_ie8?
289
+ :global_defs => @options[:define] || {}
234
290
  )
235
291
 
236
292
  conditional_option(
237
- @options[:compress] || @options[:squeeze],
293
+ @options[:compress],
238
294
  defaults,
239
295
  { :keep_fnames => keep_fnames?(:compress) }.merge(negate_iife_block)
240
296
  )
@@ -264,13 +320,27 @@ class Uglifier
264
320
  end
265
321
  end
266
322
 
323
+ def quote_style
324
+ option = conditional_option(@options[:output], DEFAULTS[:output])[:quote_style]
325
+ case option
326
+ when :single
327
+ 1
328
+ when :double
329
+ 2
330
+ when :original
331
+ 3
332
+ when Numeric
333
+ option
334
+ else # auto
335
+ 0
336
+ end
337
+ end
338
+
267
339
  def comment_setting
268
340
  if @options.has_key?(:output) && @options[:output].has_key?(:comments)
269
341
  @options[:output][:comments]
270
342
  elsif @options.has_key?(:comments)
271
343
  @options[:comments]
272
- elsif @options[:copyright] == false
273
- :none
274
344
  else
275
345
  DEFAULTS[:output][:comments]
276
346
  end
@@ -279,16 +349,12 @@ class Uglifier
279
349
  def output_options
280
350
  DEFAULTS[:output].merge(@options[:output] || {}).merge(
281
351
  :comments => comment_options,
282
- :screw_ie8 => screw_ie8?
283
- ).reject { |key, _| key == :ie_proof }
352
+ :quote_style => quote_style
353
+ )
284
354
  end
285
355
 
286
- def screw_ie8?
287
- if (@options[:output] || {}).has_key?(:ie_proof)
288
- !@options[:output][:ie_proof]
289
- else
290
- @options.fetch(:screw_ie8, DEFAULTS[:screw_ie8])
291
- end
356
+ def ie8?
357
+ @options.fetch(:ie8, DEFAULTS[:ie8])
292
358
  end
293
359
 
294
360
  def keep_fnames?(type)
@@ -304,16 +370,22 @@ class Uglifier
304
370
  options = conditional_option(@options[:source_map], SOURCE_MAP_DEFAULTS) || SOURCE_MAP_DEFAULTS
305
371
 
306
372
  {
307
- :file => options[:output_filename],
373
+ :input => options[:filename],
374
+ :filename => options[:output_filename],
308
375
  :root => options.fetch(:root) { input_map ? input_map["sourceRoot"] : nil },
309
- :orig => input_map,
310
- :map_url => options[:map_url],
376
+ :content => input_map,
377
+ #:map_url => options[:map_url],
311
378
  :url => options[:url],
312
- :sources_content => options[:sources_content]
379
+ :includeSources => options[:sources_content]
313
380
  }
314
381
  end
315
382
 
316
383
  def parse_options
384
+ conditional_option(@options[:parse], DEFAULTS[:parse])
385
+ .merge(parse_source_map_options)
386
+ end
387
+
388
+ def parse_source_map_options
317
389
  if @options[:source_map].respond_to?(:[])
318
390
  { :filename => @options[:source_map][:filename] }
319
391
  else