uglifier 1.3.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d93953baa3d4cf3d30b44e0a0f90dc3b57162aa62283d53213e1647d3de236f3
4
+ data.tar.gz: 647b93d713f352702df61de8a4bcec00dc3a659d81f5a0ff5a6bac6ecfa39895
5
+ SHA512:
6
+ metadata.gz: e5a9c7445f6f385a4ed0117badd20011e75da0aaf2df4ca8102b2d5c33ad9c14651d2d33dc14b7b5bc9be9b4400623a851176ac993fa54663c0edb68a723f0e9
7
+ data.tar.gz: 5762685023380924279b268fab8c6e2de4c91c18ee45a613b344a937b3743e4b50cf73d8f259b73d99aaee71911e2e3be0608aa165e016b5a03061fa9f9ffd00
@@ -0,0 +1,52 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ name: >-
8
+ Test (${{ matrix.ruby }})
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ gemfile: [Gemfile]
14
+ ruby:
15
+ - "2.4"
16
+ - "2.5"
17
+ - "2.6"
18
+ - "2.7"
19
+ - "3.0"
20
+ - "3.1"
21
+ - "3.2"
22
+ - "3.3"
23
+ - jruby
24
+ - truffleruby
25
+ include:
26
+ - ruby: 2.5
27
+ gemfile: gemfiles/rubyracer
28
+ - ruby: jruby
29
+ gemfile: gemfiles/rubyrhino
30
+ - ruby: 2.5
31
+ gemfile: gemfiles/alaska
32
+ alaska: 1
33
+ env:
34
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
35
+ ALASKA: ${{ matrix.alaska}}
36
+ steps:
37
+ - uses: actions/checkout@v2
38
+ - uses: ruby/setup-ruby@v1
39
+ with:
40
+ ruby-version: ${{ matrix.ruby }}
41
+ bundler-cache: true
42
+ - run: bundle exec rake spec
43
+ lint:
44
+ runs-on: ubuntu-latest
45
+
46
+ steps:
47
+ - uses: actions/checkout@v2
48
+ - uses: ruby/setup-ruby@v1
49
+ with:
50
+ ruby-version: "3.0"
51
+ bundler-cache: true
52
+ - run: bundle exec rubocop --format github
data/.gitignore ADDED
@@ -0,0 +1,44 @@
1
+ # rcov generated
2
+ coverage
3
+
4
+ # rdoc generated
5
+ rdoc
6
+
7
+ # yard generated
8
+ doc
9
+ .yardoc
10
+
11
+ # bundler
12
+ .bundle
13
+ Gemfile.lock
14
+ gemfiles/*.lock
15
+
16
+ # jeweler generated
17
+ pkg
18
+
19
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
20
+ #
21
+ # * Create a file at ~/.gitignore
22
+ # * Include files you want ignored
23
+ # * Run: git config --global core.excludesfile ~/.gitignore
24
+ #
25
+ # After doing this, these files will be ignored in all your git projects,
26
+ # saving you from having to 'pollute' every project you touch with them
27
+ #
28
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
29
+ #
30
+ # For MacOS:
31
+ #
32
+ #.DS_Store
33
+ #
34
+ # For TextMate
35
+ #*.tmproj
36
+ #tmtags
37
+ #
38
+ # For emacs:
39
+ #*~
40
+ #\#*
41
+ #.\#*
42
+ #
43
+ # For vim:
44
+ #*.swp
data/.gitmodules CHANGED
@@ -1,3 +1,12 @@
1
1
  [submodule "vendor/uglifyjs"]
2
2
  path = vendor/uglifyjs
3
- url = https://github.com/mishoo/UglifyJS.git
3
+ url = https://github.com/mishoo/UglifyJS2.git
4
+ [submodule "vendor/source-map"]
5
+ path = vendor/source-map
6
+ url = https://github.com/mozilla/source-map.git
7
+ [submodule "vendor/split"]
8
+ path = vendor/split
9
+ url = https://gist.github.com/2048056.git
10
+ [submodule "vendor/uglifyjs-harmony"]
11
+ path = vendor/uglifyjs-harmony
12
+ url = https://github.com/mishoo/UglifyJS2.git
data/.rubocop.yml ADDED
@@ -0,0 +1,63 @@
1
+ AllCops:
2
+ DisplayCopNames: true
3
+ SuggestExtensions: false
4
+ NewCops: disable
5
+ TargetRubyVersion: 2.4
6
+ Exclude:
7
+ - uglifier.gemspec
8
+ - lib/uglifier/version.rb
9
+ - "vendor/**/*"
10
+ - "gemfiles/vendor/**/*"
11
+
12
+ Metrics/AbcSize:
13
+ Max: 20
14
+
15
+ Metrics/BlockLength:
16
+ Enabled: true
17
+ Exclude:
18
+ - "spec/**/*_spec.rb"
19
+
20
+ Metrics/ClassLength:
21
+ Enabled: false
22
+
23
+ Layout/LineLength:
24
+ Max: 100
25
+
26
+ Metrics/MethodLength:
27
+ Max: 20
28
+
29
+ Style/Encoding:
30
+ Enabled: false
31
+
32
+ Style/HashSyntax:
33
+ EnforcedStyle: hash_rockets
34
+
35
+ Style/PercentLiteralDelimiters:
36
+ Enabled: false
37
+
38
+ Style/PreferredHashMethods:
39
+ Enabled: false
40
+
41
+ Style/SignalException:
42
+ Enabled: false
43
+
44
+ Style/StringLiterals:
45
+ Enabled: false
46
+
47
+ Style/SymbolArray:
48
+ Enabled: false
49
+
50
+ Style/Alias:
51
+ Enabled: false
52
+
53
+ Style/MutableConstant:
54
+ Enabled: false
55
+
56
+ Style/ExpandPathArguments:
57
+ Enabled: false
58
+
59
+ Style/FrozenStringLiteralComment:
60
+ Enabled: false
61
+
62
+ Style/StringConcatenation:
63
+ Enabled: false
data/.yardopts ADDED
@@ -0,0 +1,4 @@
1
+ --title "Uglifier"
2
+ -
3
+ CHANGELOG.md
4
+ LICENSE.txt
data/CHANGELOG.md ADDED
@@ -0,0 +1,332 @@
1
+ ## 4.2.1 (22 September 2024)
2
+
3
+ - fix Ruby 3.4 compatiblity, drop Ruby 2.3 and older support (#195)
4
+ - fix typos (#194)
5
+
6
+ ## 4.2.0 (25 September 2019)
7
+
8
+ - show code context for error messages (#167)
9
+ - defer initialisation of ExecJS context to fix #165
10
+
11
+ ## 4.1.20 (17 November 2018)
12
+
13
+ - update UglifyJS to [3.4.8](https://github.com/mishoo/UglifyJS2/compare/v3.4.9...v3.4.8)
14
+
15
+ ## 4.1.19 (11 September 2018)
16
+
17
+ - update UglifyJS to [3.4.9](https://github.com/mishoo/UglifyJS2/compare/v3.4.7...v3.4.9)
18
+
19
+ ## 4.1.18 (09 August 2018)
20
+
21
+ - update UglifyJS to [3.4.7](https://github.com/mishoo/UglifyJS2/compare/v3.4.6...v3.4.7)
22
+
23
+ ## 4.1.17 (29 July 2018)
24
+
25
+ - update UglifyJS to [3.4.6](https://github.com/mishoo/UglifyJS2/compare/v3.4.5...v3.4.6)
26
+
27
+ ## 4.1.16 (22 July 2018)
28
+
29
+ - update UglifyJS to [3.4.5](https://github.com/mishoo/UglifyJS2/compare/v3.4.4...v3.4.5)
30
+
31
+ ## 4.1.15 (13 July 2018)
32
+
33
+ - update UglifyJS to [3.4.4](https://github.com/mishoo/UglifyJS2/compare/v3.4.3...v3.4.4)
34
+
35
+ ## 4.1.14 (02 July 2018)
36
+
37
+ - update UglifyJS to [3.4.3](https://github.com/mishoo/UglifyJS2/compare/v3.4.2...v3.4.3)
38
+
39
+ ## 4.1.13 (30 June 2018)
40
+
41
+ - update UglifyJS to [3.4.2](https://github.com/mishoo/UglifyJS2/compare/v3.4.1...v3.4.2)
42
+
43
+ ## 4.1.12 (20 June 2018)
44
+
45
+ - update UglifyJS to [3.4.1](https://github.com/mishoo/UglifyJS2/compare/v3.4.0...v3.4.1)
46
+
47
+ ## 4.1.11 (02 June 2018)
48
+
49
+ - update UglifyJS to [3.3.28](https://github.com/mishoo/UglifyJS2/compare/v3.3.22...v3.3.28)
50
+
51
+ ## 4.1.10 (21 April 2018)
52
+
53
+ - update UglifyJS to [3.3.22](https://github.com/mishoo/UglifyJS2/compare/v3.3.20...v3.3.22)
54
+
55
+ ## 4.1.9 (11 April 2018)
56
+
57
+ - update UglifyJS to [3.3.20](https://github.com/mishoo/UglifyJS2/compare/v3.3.16...v3.3.20)
58
+
59
+ ## 4.1.8 (14 March 2018)
60
+
61
+ - update UglifyJS to [3.3.15](https://github.com/mishoo/UglifyJS2/compare/v3.3.14...v3.3.15)
62
+
63
+ ## 4.1.7 (11 March 2018)
64
+
65
+ - update UglifyJS to [3.3.14](https://github.com/mishoo/UglifyJS2/compare/v3.3.10...v3.3.14)
66
+
67
+ ## 4.1.6 (08 February 2018)
68
+
69
+ - update UglifyJS to [3.3.10](https://github.com/mishoo/UglifyJS2/compare/v3.3.9...v3.3.10)
70
+ - update uglify-es to [3.3.10](https://github.com/mishoo/UglifyJS2/compare/harmony-v3.3.9...harmony-v3.3.10)
71
+
72
+ ## 4.1.5 (28 January 2018)
73
+
74
+ - update UglifyJS to [3.3.9](https://github.com/mishoo/UglifyJS2/compare/v3.3.8...v3.3.9)
75
+ - update uglify-es to [3.3.9](https://github.com/mishoo/UglifyJS2/compare/harmony-v3.3.8...harmony-v3.3.9)
76
+
77
+ ## 4.1.4 (22 January 2018)
78
+
79
+ - update UglifyJS to [3.3.8](https://github.com/mishoo/UglifyJS2/compare/v3.3.5...v3.3.8)
80
+ - update uglify-es to [3.3.8](https://github.com/mishoo/UglifyJS2/compare/harmony-v3.3.5...harmony-v3.3.8)
81
+
82
+ ## 4.1.3 (7 January 2018)
83
+
84
+ - update UglifyJS to 3.3.5
85
+
86
+ ## 4.1.2 (30 December 2017)
87
+
88
+ - update UglifyJS to 3.3.4
89
+
90
+ ## 4.1.1 (29 December 2017)
91
+
92
+ - update UglifyJS to 3.3.3
93
+
94
+ ## 4.1.0 (28 December 2017)
95
+
96
+ - update UglifyJS to 3.3.2
97
+ - `cascade` compress option is merged into `collapse_vars`
98
+
99
+ ## 4.0.2 (10 December 2017)
100
+
101
+ - update UglifyJS to 3.2.2
102
+ - show harmony suggestion when using for-of loops
103
+
104
+ ## 4.0.1 (3 December 2017)
105
+
106
+ - update UglifyJS to 3.2.1
107
+
108
+ ## 4.0.0 (2 December 2017)
109
+
110
+ - update UglifyJS to 3.2.0
111
+ - remove Angular ngInject processing
112
+ - add unsafe_math compress option
113
+ - add reduce_funcs compress option
114
+ - add parse options
115
+ - add shebang output option
116
+ - add keep_infinity compress option
117
+ - add quote_style output option
118
+ - add side_effects compress option
119
+ - add switches compress option
120
+ - more helpful error Message in Harmony mode
121
+
122
+ Dropped options:
123
+
124
+ - output: angular
125
+ - mangle: except => reserved
126
+ - mangle_properties: ignore_quoted => keep_quoted
127
+ - enclose
128
+ - squeeze, copyright and screw_ie8 options
129
+
130
+
131
+ ## 3.2.0 (9 April 2017)
132
+
133
+ - experimental ES6/Harmony mode based on UglifyJS2 Harmony branch
134
+ - update UglifyJS to 2.8.22
135
+
136
+ ## 3.1.13 (3 April 2017)
137
+
138
+ - update UglifyJS to 2.8.21
139
+
140
+ ## 3.1.12 (31 March 2017)
141
+
142
+ - update UglifyJS to 2.8.20
143
+
144
+ ## 3.1.11 (28 March 2017)
145
+
146
+ - update UglifyJS to 2.8.17
147
+
148
+ ## 3.1.10 (25 March 2017)
149
+
150
+ - update UglifyJS to 2.8.16
151
+
152
+ ## 3.1.9 (19 March 2017)
153
+
154
+ - update UglifyJS to 2.8.14
155
+
156
+ ## 3.1.8 (17 March 2017)
157
+
158
+ - update UglifyJS to 2.8.13
159
+
160
+ ## 3.1.7 (11 March 2017)
161
+
162
+ - fix NoMethodError on `Uglifier.compile(source, source_map: false)` (#114)
163
+ - update UglifyJS to 2.8.12
164
+
165
+ ## 3.1.6 (9 March 2017)
166
+
167
+ - update UglifyJS to 2.8.11
168
+
169
+ ## 3.1.5 (8 March 2017)
170
+
171
+ - update UglifyJS to 2.8.9
172
+
173
+ ## 3.1.4 (5 March 2017)
174
+
175
+ - Update UglifyJS to 2.8.7
176
+
177
+ ## 3.1.3 (2 March 2017)
178
+
179
+ - update UglifyJS to 2.8.5
180
+ - default passes to 1
181
+ - allow source_map option to be `true` instead of a hash
182
+
183
+ ## 3.1.2 (1 March 2017)
184
+
185
+ - fix `reduce_vars` compressor option
186
+ - add `passes` compressor option
187
+ - update UglifyJS to 2.8.4
188
+
189
+ ## 3.1.1 (27 February 2017)
190
+
191
+ - disable `reduce_vars` by default as it causes JS errors (#110)
192
+
193
+ ## 3.1.0 (27 February 2017)
194
+
195
+ - update UglifyJS to 2.8.0
196
+ - add reduce_vars compress option
197
+ - enable `reduce_vars` and `collapse_vars` compress options by default
198
+ - unused top-level function and variable removal with `toplevel` compress option
199
+ - add `top_retain` compress option to specify list of top-level variables to always retain
200
+ - add `unsafe_comps` and `unsafe_proto` options
201
+
202
+ ## 3.0.4 (30 November 2016)
203
+
204
+ - update UglifyJS to 2.7.5
205
+ - implement ignore_quoted and debug options for mangle_properties
206
+
207
+ ## 3.0.3 (24 October 2016)
208
+
209
+ - update UglifyJS to 2.7.4
210
+ - add wrap_iife output option to wrap IIFEs in parenthesis
211
+
212
+ ## 3.0.2 (20 August 2016)
213
+
214
+ - add top-level keep_fnames option that implies both compressor and mangler keep_fnames
215
+ - update UglifyJS to 2.7.3
216
+
217
+ ## 3.0.1 (28 July 2016)
218
+
219
+ - update UglifyJS to 2.7.0
220
+ - split JS dependencies to separate files
221
+
222
+ ## 3.0.0 (22 March 2016)
223
+
224
+ - drop support for Ruby 1.8
225
+ - remove json as dependency
226
+ - discard unused function arguments only in unsafe mode
227
+ - add `keep_fnames` option to preserve function names in compressed code
228
+ - add `collapse_vars` option to collapse single-use variables
229
+ - backwards incompatible changes to source map options
230
+ - support for inline base64 encoded source maps
231
+ - mangle property names option (disabled by default)
232
+ - update UglifyJS to 2.6.2
233
+
234
+ ## 2.7.2 (26 August 2015)
235
+
236
+ - update UglifyJS to 2.4.24
237
+
238
+ ## 2.7.1 (27 February 2015)
239
+
240
+ - fix compatibility with experimental Alaska ExecJS runtime
241
+
242
+ ## 2.7.0 (8 January 2015)
243
+
244
+ - copyright comment preservation also includes comments starting with a bang (!)
245
+
246
+ ## 2.6.1 (1 January 2015)
247
+
248
+ - update UglifyJS to 2.4.16
249
+
250
+ ## 2.6.0 (8 December 2014)
251
+
252
+ - allow metadata to be appended to minified code
253
+
254
+ ## 2.5.3 (18 July 2014)
255
+
256
+ - no changes
257
+
258
+ ## 2.5.2 (18 July 2014)
259
+
260
+ - update UglifyJS to 2.4.15
261
+
262
+ ## 2.5.1 (13 June 2014)
263
+
264
+ - update UglifyJS to 2.4.14
265
+
266
+ ## 2.5.0 (15 March 2014)
267
+
268
+ - update UglifyJS to 2.4.13
269
+ - process Angular @ngInject annotations
270
+ - add keep_fargs option
271
+ - change `ascii_only` default to true
272
+
273
+ ## 2.4.0 (19 December 2013)
274
+
275
+ - update UglifyJS to 2.4.8
276
+ - add drop_console compress option
277
+
278
+ ## 2.3.3 (12 December 2013)
279
+
280
+ - update UglifyJS to 2.4.7
281
+
282
+ ## 2.3.2 (1 December 2013)
283
+
284
+ - update UglifyJS to 2.4.6
285
+ - document missing mangler and output options
286
+
287
+ ## 2.3.1 (8 November 2013)
288
+
289
+ - update UglifyJS to 2.4.3
290
+
291
+ ## 2.3.0 (26 October 2013)
292
+
293
+ - use JSON gem instead of multi_json
294
+ - update UglifyJS to 2.4.1
295
+ - fix issues with some Unicode JS identifiers (#47, #58)
296
+
297
+ ## 2.2.1 (28 August 2013)
298
+
299
+ - fix IE8 compatibility
300
+
301
+ ## 2.2.0 (25 August 2013)
302
+
303
+ - update UglifyJS to 2.4.0
304
+ - add `negate_iife` compressor option
305
+ - escape null characters as \x00, so that null followed by number isn't
306
+ interpreted as octal (#47)
307
+
308
+ ## 2.1.2 (7 July 2013)
309
+
310
+ - update UglifyJS to 2.3.6
311
+
312
+ ## 2.1.1 (18 May 2013)
313
+
314
+ - fix JScript compatibility
315
+ - update UglifyJS to 2.3.4
316
+
317
+ ## 2.1.0 (8 May 2013)
318
+
319
+ - update to UglifyJS 2.3.0
320
+ - add enclose and screw_ie8 options
321
+
322
+ ## 2.0.1 (6 April 2013)
323
+
324
+ - fix compatibility with Sprockets 2.9.0
325
+
326
+ ## 2.0.0 (6 April 2013)
327
+
328
+ This release is backwards incompatible for JS compressor options.
329
+
330
+ - update UglifyJS to 2.2.5
331
+ - change compressor arguments to align with UglifyJS2
332
+ - `compile_with_map`: generate source maps for minified code
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,47 @@
1
+ # Contributing to Uglifier
2
+
3
+ Any contributions to Uglifier are welcome, whether they are feedback, bug reports, or - even better - pull requests.
4
+
5
+ ## Development
6
+
7
+ To start working on Uglifier, fork the repo to your own account. [Ruby](https://www.ruby-lang.org), [bundler](http://bundler.io) and [Node.js](http://nodejs.org) are required as dependencies.
8
+
9
+ Ensure that your local copy is up-to-date before you start working on a feature or a bug fix. You should write any new code in a topic branch.
10
+
11
+ ### Tests
12
+
13
+ Try to write a test case that reproduces the problem you're trying to fix or describes a feature that you want to build. Tests are located in `spec/` directory.
14
+
15
+ Tests as a pull request are appreciated even without a fix to highlight or reproduce a problem.
16
+
17
+ To run tests, first install all project dependencies:
18
+
19
+ bundle install
20
+
21
+ Then run tests using rake:
22
+
23
+ bundle exec rake
24
+
25
+ ### Updating UglifyJS and source-map
26
+
27
+ [UglifyJS](https://github.com/mishoo/UglifyJS2) and [source-map](https://github.com/mozilla/source-map/) are included in the project as Git submodules. To install submodules, run in your terminal
28
+
29
+ git submodule update --init
30
+
31
+ After that, UglifyJS can be updated to a specific version with rake task.
32
+
33
+ rake uglifyjs:update VERSION=3.3.4
34
+
35
+ To compile JS with dependencies, run
36
+
37
+ rake uglifyjs:build
38
+
39
+ You can even write custom patches to UglifyJS in `vendor/uglifyjs` and `vendor/uglifyjs-harmony` directories and compile the bundles JS using the command above. However, for the changes to be releasable, they should be in UglifyJS repository.
40
+
41
+ To automatically update UglifyJS version and commit changes
42
+
43
+ rake uglifyjs VERSION=3.3.4
44
+
45
+ ## Reporting issues
46
+
47
+ Uglifier uses the [GitHub issue tracker](https://github.com/lautis/uglifier/issues) to track bugs and features. Before submitting a bug report or feature request, check to make sure it hasn't already been submitted. When submitting a bug report, please include a Gist that includes a stack trace and any details that may be necessary to reproduce the bug, including your gem version, Ruby version, and **ExecJS runtime**. Ideally, a bug report should include a pull request with failing specs.
data/Gemfile CHANGED
@@ -1,25 +1,5 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
- gem "execjs", ">=0.3.0"
4
- gem "multi_json", "~> 1.0", ">= 1.0.2"
3
+ gemspec
5
4
 
6
- # Depend on defined ExecJS runtime
7
- execjs_runtimes = {
8
- "RubyRacer" => "therubyracer",
9
- "RubyRhino" => "therubyrhino",
10
- "Mustang" => "mustang"
11
- }
12
-
13
- if ENV["EXECJS_RUNTIME"] && execjs_runtimes[ENV["EXECJS_RUNTIME"]]
14
- gem execjs_runtimes[ENV["EXECJS_RUNTIME"]], :group => :development
15
- end
16
-
17
- # Engine
18
- gem ENV["MULTI_JSON_ENGINE"], :group => :development if ENV["MULTI_JSON_ENGINE"]
19
-
20
- group :development do
21
- gem "rspec", "~> 2.7"
22
- gem "bundler", "~> 1.0"
23
- gem "jeweler", "~> 1.8.3"
24
- gem "rdoc", "~> 3.11"
25
- end
5
+ gem 'rubocop', '~> 1.7.0', :group => [:development] if RUBY_VERSION >= '2.5'