uglifier 2.6.1 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of uglifier might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2570f55b4b84cb731907be06c74b9e06381a6eef
4
- data.tar.gz: adf2e3037a255c13730c13186514ce02a5f46329
3
+ metadata.gz: bb026fa4f1d075fee10aa54bc2e86f50bc688cfb
4
+ data.tar.gz: 52bf135ebd2d66a0bb0041908df6c88b0572f966
5
5
  SHA512:
6
- metadata.gz: 084e7c1360f788b9e4e9b2d1b85fd06924864189d12174ae0237021fb24426619839343e1539a3cb757360f59c523c347369ffb4982f661c32294032794feab3
7
- data.tar.gz: d0e03e549667e9c15457998e7f22683d54a1f533179eaea50b58bdebabd56b41a6242585d15e864c8949ac4afa0f88c8b037cac690dc95315ce38d8f2bc55d40
6
+ metadata.gz: 56a67dd0bb264a5a0ecc863bb775d9fe5e559712c958cca43cd829d3461286f27d639d54efa8764b16de11067efeb8394ae6e3f4abffae563b6418f5180e8798
7
+ data.tar.gz: c01510deda6fb3fbf9816e2572edbbffd9808a13691d0e0ee7f55b8f1a6c8acb29f57d47e2b2c98833110524be4d39a9d41897fb3868e7f34038817614bcf25e
@@ -1,3 +1,7 @@
1
+ ## 2.7.0 (8 January 2015)
2
+
3
+ - copyright comment preservation also includes comments starting with a bang (!)
4
+
1
5
  ## 2.6.1 (1 January 2015)
2
6
 
3
7
  - update UglifyJS to 2.4.16
data/README.md CHANGED
@@ -45,7 +45,7 @@ Available options and their defaults are
45
45
  {
46
46
  :output => {
47
47
  :ascii_only => true, # Escape non-ASCII characters
48
- :comments => :copyright, # Preserve comments (:all, :jsdoc, :copyright, :none)
48
+ :comments => :copyright, # Preserve comments (:all, :jsdoc, :copyright, :none, Regexp (see below))
49
49
  :inline_script => false, # Escape occurrences of </script in strings
50
50
  :quote_keys => false, # Quote keys in object literals
51
51
  :max_line_len => 32 * 1024, # Maximum line length in minified code
@@ -101,6 +101,18 @@ Available options and their defaults are
101
101
  }
102
102
  ```
103
103
 
104
+ When passing a regular expression to the output => comments option, be sure to pass a valid Ruby Regexp.
105
+ The beginning and ending of comments are removed and cannot be matched (/*, */, //). For example:
106
+ When matching
107
+
108
+ ```
109
+ /*!
110
+ * comment
111
+ */
112
+ ```
113
+
114
+ use `Uglifier.new(output: {comments: /^!/})`.
115
+
104
116
  ## Development
105
117
 
106
118
  Tests are run using
@@ -237,7 +237,7 @@ class Uglifier
237
237
  when :jsdoc
238
238
  "jsdoc"
239
239
  when :copyright
240
- encode_regexp(/Copyright/i)
240
+ encode_regexp(/(^!)|Copyright/i)
241
241
  when Regexp
242
242
  encode_regexp(comment_setting)
243
243
  else
@@ -1,4 +1,4 @@
1
1
  class Uglifier
2
2
  # Current version of Uglifier.
3
- VERSION = "2.6.1"
3
+ VERSION = "2.7.0"
4
4
  end
@@ -60,8 +60,11 @@ describe "Uglifier" do
60
60
  /* @preserve Copyright Notice */
61
61
  /* (c) 2011 */
62
62
  // INCLUDED
63
+ //! BANG
63
64
  function identity(p) { return p; }
64
65
  /* Another Copyright */
66
+ /*! Another Bang */
67
+ // A comment!
65
68
  function add(a, b) { return a + b; }
66
69
  EOS
67
70
  end
@@ -79,8 +82,14 @@ describe "Uglifier" do
79
82
  expect(subject).to match(/Another Copyright/)
80
83
  end
81
84
 
85
+ it "preserves comments that start with a bang (!)" do
86
+ expect(subject).to match(/! BANG/)
87
+ expect(subject).to match(/! Another Bang/)
88
+ end
89
+
82
90
  it "ignores other comments" do
83
91
  expect(subject).not_to match(/INCLUDED/)
92
+ expect(subject).not_to match(/A comment!/)
84
93
  end
85
94
  end
86
95
 
@@ -17,7 +17,9 @@ Gem::Specification.new do |spec|
17
17
 
18
18
  spec.extra_rdoc_files = [
19
19
  "LICENSE.txt",
20
- "README.md"
20
+ "README.md",
21
+ "CHANGELOG.md",
22
+ "CONTRIBUTING.md"
21
23
  ]
22
24
  spec.files = `git ls-files`.split($/)
23
25
  spec.test_files = spec.files.grep(%r{^spec/})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uglifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ville Lautanala
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-01 00:00:00.000000000 Z
11
+ date: 2015-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs
@@ -117,6 +117,8 @@ extensions: []
117
117
  extra_rdoc_files:
118
118
  - LICENSE.txt
119
119
  - README.md
120
+ - CHANGELOG.md
121
+ - CONTRIBUTING.md
120
122
  files:
121
123
  - ".document"
122
124
  - ".gitignore"