uglifier 2.7.1 → 2.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/Rakefile +1 -1
- data/lib/es5.js +1 -1
- data/lib/uglifier/version.rb +1 -1
- data/lib/uglify.js +599 -257
- data/spec/source_map_spec.rb +1 -1
- data/spec/uglifier_spec.rb +14 -5
- metadata +3 -3
data/spec/source_map_spec.rb
CHANGED
@@ -81,7 +81,7 @@ describe "Uglifier" do
|
|
81
81
|
expect(minified1.lines.to_a.length).to eq(1)
|
82
82
|
|
83
83
|
map = SourceMap.from_s(map2)
|
84
|
-
expect(map.sources).to eq(["http://localhost/ahoy.js"])
|
84
|
+
expect(map.sources).to eq(["ahoy.js", "http://localhost/ahoy.js"])
|
85
85
|
expect(map.mappings.first[:source_line]).to eq(1)
|
86
86
|
expect(map.mappings.last[:source_line]).to eq(6)
|
87
87
|
end
|
data/spec/uglifier_spec.rb
CHANGED
@@ -145,8 +145,8 @@ describe "Uglifier" do
|
|
145
145
|
|
146
146
|
it "honors max line length" do
|
147
147
|
code = "var foo = 123;function bar() { return foo; }"
|
148
|
-
uglifier = Uglifier.new(:output => { :max_line_len =>
|
149
|
-
expect(uglifier.compile(code).split("\n").length).to
|
148
|
+
uglifier = Uglifier.new(:output => { :max_line_len => 20 }, :compress => false)
|
149
|
+
expect(uglifier.compile(code).split("\n").map(&:length)).to all(be < 28)
|
150
150
|
end
|
151
151
|
|
152
152
|
it "hoists vars to top of the scope" do
|
@@ -230,10 +230,19 @@ describe "Uglifier" do
|
|
230
230
|
function plus(a, b, c) { return a + b};
|
231
231
|
plus(1, 2);
|
232
232
|
EOF
|
233
|
-
expect(Uglifier.compile(code, :mangle => false)).not_to include("c)")
|
234
233
|
|
235
|
-
|
236
|
-
|
234
|
+
options = lambda do |keep_fargs|
|
235
|
+
{
|
236
|
+
:mangle => false,
|
237
|
+
:compress => {
|
238
|
+
:keep_fargs => keep_fargs,
|
239
|
+
:unsafe => true
|
240
|
+
}
|
241
|
+
}
|
242
|
+
end
|
243
|
+
|
244
|
+
expect(Uglifier.compile(code, options.call(false))).not_to include("c)")
|
245
|
+
expect(Uglifier.compile(code, options.call(true))).to include("c)")
|
237
246
|
end
|
238
247
|
|
239
248
|
describe "Input Formats" do
|
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.7.
|
4
|
+
version: 2.7.2
|
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-
|
11
|
+
date: 2015-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execjs
|
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
version: '0'
|
165
165
|
requirements: []
|
166
166
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.4.5
|
167
|
+
rubygems_version: 2.4.5.1
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
170
|
summary: Ruby wrapper for UglifyJS JavaScript compressor
|