Permalink
Browse files

Update uglify to v2.7.0. (#416)

* bump uglify-js to 2.7

* Update files for `screw_ie8` being true in uglify 2.7.0.

* Minor lint tweaks.

* v2.0.0.
1 parent 48285c9 commit 2d04f24e347cd6429856516385d61673a94d57ae @XhmikosR XhmikosR committed with vladikoff Jul 19, 2016
View
@@ -7,6 +7,7 @@ node_js:
- "0.12"
- "4"
- "5"
+ - "6"
- "iojs"
matrix:
View
@@ -1,5 +1,9 @@
+v2.0.0:
+ date: 2016-07-19
+ changes:
+ - Update uglify-js to v2.7.0. `screwIE8` is enabled by default.
v1.0.2:
- date: 2016-03-19
+ date: 2016-07-19
changes:
- Update grunt to ^1.0.0.
- Fix `beautify` when passed as an object.
View
@@ -55,8 +55,8 @@ module.exports = function(grunt) {
files: {
'tmp/compress_mangle_banner.js': ['test/fixtures/src/simple.js']
},
- options : {
- banner : '// banner without sourcemap\n'
+ options: {
+ banner: '// banner without sourcemap\n'
}
},
no_src: {
@@ -99,7 +99,7 @@ module.exports = function(grunt) {
},
multifile: {
files: {
- 'tmp/multifile.js': ['test/fixtures/src/simple.js','test/fixtures/src/comments.js']
+ 'tmp/multifile.js': ['test/fixtures/src/simple.js', 'test/fixtures/src/comments.js']
},
options: {
mangle: false
@@ -141,7 +141,7 @@ module.exports = function(grunt) {
src: 'test/fixtures/src/screwIE8.js',
dest: 'tmp/screwIE8.js',
options: {
- screwIE8: true
+ screwIE8: false
}
},
exportAll: {
@@ -197,8 +197,8 @@ module.exports = function(grunt) {
dest: 'tmp/sourcemap_functionName.js',
options: {
sourceMap: true,
- sourceMapName: function( dest ) {
- return dest + ".fn.map";
+ sourceMapName: function(dest) {
+ return dest + '.fn.map';
}
}
},
@@ -218,7 +218,7 @@ module.exports = function(grunt) {
},
options: {
sourceMap: true,
- sourceMapName: function( dest ) {
+ sourceMapName: function(dest) {
return dest+'.fn.map';
}
}
@@ -238,13 +238,13 @@ module.exports = function(grunt) {
}
},
sourcemap_sources: {
- files: {
- 'tmp/sourcemap_sources.js': ['test/fixtures/src/simple.js']
- },
- options: {
- sourceMap: true,
- sourceMapIncludeSources: true
- }
+ files: {
+ 'tmp/sourcemap_sources.js': ['test/fixtures/src/simple.js']
+ },
+ options: {
+ sourceMap: true,
+ sourceMapIncludeSources: true
+ }
},
sourcemapin_sources: {
files: {
@@ -259,24 +259,24 @@ module.exports = function(grunt) {
}
},
expression_json: {
- files: {
- 'tmp/expression.json': ['test/fixtures/src/simple.json']
- },
- options: {
- expression: true,
- mangle: false,
- compress: false
- }
+ files: {
+ 'tmp/expression.json': ['test/fixtures/src/simple.json']
+ },
+ options: {
+ expression: true,
+ mangle: false,
+ compress: false
+ }
},
expression_js: {
- files: {
- 'tmp/expression.js': ['test/fixtures/src/expression.js']
- },
- options: {
- expression: true,
- mangle: false,
- compress: false
- }
+ files: {
+ 'tmp/expression.js': ['test/fixtures/src/expression.js']
+ },
+ options: {
+ expression: true,
+ mangle: false,
+ compress: false
+ }
},
mangleprops: {
files: {
@@ -396,20 +396,20 @@ module.exports = function(grunt) {
});
// task that expects its argument (another task) to fail
- grunt.registerTask('expectFail', function(){
+ grunt.registerTask('expectFail', function() {
var task = this.args.join(':');
var done = this.async();
function onComplete(error, result) {
- grunt.log.write("\n > " + result.stdout.split("\n").join("\n > ") + "\n");
- var rv = error ? true : new Error("Task " + task + " unexpectedly passed.");
+ grunt.log.write('\n > ' + result.stdout.split('\n').join('\n > ') + '\n');
+ var rv = error ? true : new Error('Task ' + task + ' unexpectedly passed.');
done(rv);
}
grunt.util.spawn({
- grunt : true,
- args : task
+ grunt: true,
+ args: task
}, onComplete);
});
View
@@ -1,6 +1,6 @@
-# grunt-contrib-uglify v1.0.2 [![Build Status: Linux](https://travis-ci.org/gruntjs/grunt-contrib-uglify.svg?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-uglify) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/ybtf5vbvtenii561/branch/master?svg=true)](https://ci.appveyor.com/project/gruntjs/grunt-contrib-uglify/branch/master)
+# grunt-contrib-uglify v2.0.0 [![Build Status: Linux](https://travis-ci.org/gruntjs/grunt-contrib-uglify.svg?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-uglify) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/ybtf5vbvtenii561/branch/master?svg=true)](https://ci.appveyor.com/project/gruntjs/grunt-contrib-uglify/branch/master)
-> Minify javascript files with UglifyJS
+> Minify JavaScript files with UglifyJS
@@ -186,9 +186,9 @@ This string will be appended to the minified output. Template strings (e.g. `<%=
#### screwIE8
Type: `Boolean`
-Default: `false`
+Default: `true`
-Pass this flag if you don't care about full compliance with Internet Explorer 6-8 quirks.
+Set this to `false` if you still care about full compliance with Internet Explorer 6-8 quirks.
#### mangleProperties
Type: `Boolean` `Object`
@@ -513,13 +513,12 @@ grunt.initConfig({
}
});
```
-#### Quiet Mode
-By default the task supresses the logging, use _--verbose_ to show the full output.
## Release History
- * 2016-03-19   v1.0.2   Update grunt to ^1.0.0. Fix `beautify` when passed as an object. Fix docs about `report` values.
+ * 2016-07-19   v2.0.0   Update uglify-js to v2.7.0. `screwIE8` is enabled by default.
+ * 2016-07-19   v1.0.2   Update grunt to ^1.0.0. Fix `beautify` when passed as an object. Fix docs about `report` values.
* 2016-03-16   v1.0.1   Downgrade maxmin for Node.js 0.10.
* 2016-03-04   v1.0.0   Use uglify-js ~2.6.2 to fix sourcemap issue. Improve docs for `global-defs` and `--define` options. Add `sourceMapUrl` option. Add `bare_returns` option. Optionally set report verbosity level using report option.
* 2016-01-29   v0.11.1   Update lodash to ^4.0.1. Update grunt-contrib-clean to ^0.7.0. Update grunt-contrib-jshint to ^0.12.0.
@@ -557,4 +556,4 @@ By default the task supresses the logging, use _--verbose_ to show the full outp
Task submitted by ["Cowboy" Ben Alman](http://benalman.com)
-*This file was generated on Tue Jul 19 2016 16:34:56.*
+*This file was generated on Tue Jul 19 2016 16:46:21.*
View
@@ -15,6 +15,8 @@ environment:
platform: x86
- nodejs_version: "5"
platform: x86
+ - nodejs_version: "6"
+ platform: x86
install:
- ps: Install-Product node $env:nodejs_version $env:platform
@@ -137,9 +137,9 @@ This string will be appended to the minified output. Template strings (e.g. `<%=
## screwIE8
Type: `Boolean`
-Default: `false`
+Default: `true`
-Pass this flag if you don't care about full compliance with Internet Explorer 6-8 quirks.
+Set this to `false` if you still care about full compliance with Internet Explorer 6-8 quirks.
## mangleProperties
Type: `Boolean` `Object`
View
@@ -1,7 +1,7 @@
{
"name": "grunt-contrib-uglify",
- "description": "Minify javascript files with UglifyJS",
- "version": "1.0.2",
+ "description": "Minify JavaScript files with UglifyJS",
+ "version": "2.0.0",
"author": {
"name": "Grunt Team",
"url": "http://gruntjs.com/"
@@ -19,7 +19,7 @@
"chalk": "^1.0.0",
"lodash.assign": "^4.0.9",
"maxmin": "^1.1.0",
- "uglify-js": "~2.6.2",
+ "uglify-js": "~2.7.0",
"uri-path": "^1.0.0"
},
"devDependencies": {
View
@@ -81,7 +81,10 @@ exports.init = function(grunt) {
// Need to call this before we mangle or compress,
// and call after any compression or ast altering
if (options.expression === false) {
- topLevel.figure_out_scope({ screw_ie8: options.screwIE8, cache: topLevelCache });
+ topLevel.figure_out_scope({
+ screw_ie8: options.screwIE8,
+ cache: topLevelCache
+ });
}
if (options.compress !== false) {
@@ -91,19 +94,25 @@ exports.init = function(grunt) {
if (options.compress.warnings !== true) {
options.compress.warnings = false;
}
- if (options.screwIE8) {
- options.compress.screw_ie8 = true;
+ if (options.screwIE8 === false) {
+ options.compress.screw_ie8 = false;
}
var compressor = UglifyJS.Compressor(options.compress);
topLevel = topLevel.transform(compressor);
// Need to figure out scope again after source being altered
if (options.expression === false) {
- topLevel.figure_out_scope({screw_ie8: options.screwIE8, cache: topLevelCache});
+ topLevel.figure_out_scope({
+ screw_ie8: options.screwIE8,
+ cache: topLevelCache
+ });
}
}
- var mangleExclusions = { vars: [], props: [] };
+ var mangleExclusions = {
+ vars: [],
+ props: []
+ };
if (options.reserveDOMProperties) {
mangleExclusions = UglifyJS.readDefaultReservedFile();
}
@@ -123,7 +132,7 @@ exports.init = function(grunt) {
cache = UglifyJS.readNameCache(options.nameCache, 'props');
}
- if (typeof(options.mangleProperties) !== 'undefined' && options.mangleProperties !== false) {
+ if (typeof options.mangleProperties !== 'undefined' && options.mangleProperties !== false) {
// if options.mangleProperties is a boolean (true) convert it into an object
if (typeof options.mangleProperties !== 'object') {
options.mangleProperties = {};
@@ -140,16 +149,19 @@ exports.init = function(grunt) {
// Need to figure out scope again since topLevel has been altered
if (options.expression === false) {
- topLevel.figure_out_scope({screw_ie8: options.screwIE8, cache: topLevelCache});
+ topLevel.figure_out_scope({
+ screw_ie8: options.screwIE8,
+ cache: topLevelCache
+ });
}
}
if (options.mangle !== false) {
if (options.mangle === true) {
options.mangle = {};
}
- if (options.screwIE8) {
- options.mangle.screw_ie8 = true;
+ if (options.screwIE8 === false) {
+ options.mangle.screw_ie8 = false;
}
// disabled due to:
// 1) preserve stable name mangling
@@ -195,7 +207,7 @@ exports.init = function(grunt) {
if (options.sourceMap) {
// Set all paths to forward slashes for use in the browser
var sourceMappingURL;
- sourceMappingURL = options.destToSourceMap.match(/^http[s]?\:\/\//) === null ? uriPath(options.destToSourceMap) : options.destToSourceMap;
+ sourceMappingURL = options.destToSourceMap.match(/^http[s]?:\/\//) === null ? uriPath(options.destToSourceMap) : options.destToSourceMap;
min += '\n//# sourceMappingURL=' + sourceMappingURL;
}
@@ -220,8 +232,8 @@ exports.init = function(grunt) {
outputOptions.preamble = options.banner;
}
- if (options.screwIE8) {
- outputOptions.screw_ie8 = true;
+ if (options.screwIE8 === false) {
+ outputOptions.screw_ie8 = false;
}
if (options.sourceMap) {
View
@@ -47,7 +47,7 @@ module.exports = function(grunt) {
expression: false,
maxLineLen: 32000,
ASCIIOnly: false,
- screwIE8: false,
+ screwIE8: true,
quoteStyle: 0
});
@@ -124,7 +124,7 @@ module.exports = function(grunt) {
// Calculate the path from the dest file to the sourcemap for the
// sourceMappingURL reference
// If sourceMapUrl is defined, use this instead
- if(options.sourceMap) {
+ if (options.sourceMap) {
var destToSourceMapPath, sourceMapBasename;
if (!options.sourceMapUrl) {
destToSourceMapPath = relativePath(f.dest, options.generatedSourceMapName);
@@ -1 +1 @@
-function llama(){var a="This is a single quote string",b="This is a double quote string",c={"this":"is part of an Object",and:"so is this",but:"this one has \"mixed\" quotes: '"};return[a,b,c]}
+function llama(){var a="This is a single quote string",b="This is a double quote string",c={this:"is part of an Object",and:"so is this",but:"this one has \"mixed\" quotes: '"};return[a,b,c]}
@@ -1 +1 @@
-function llama(){var a='This is a single quote string',b="This is a double quote string",c={"this":"is part of an Object",and:'so is this',but:'this one has "mixed" quotes: \''};return[a,b,c]}
+function llama(){var a='This is a single quote string',b="This is a double quote string",c={this:"is part of an Object",and:'so is this',but:'this one has "mixed" quotes: \''};return[a,b,c]}
@@ -1 +1 @@
-function llama(){var a='This is a single quote string',b='This is a double quote string',c={'this':'is part of an Object',and:'so is this',but:'this one has "mixed" quotes: \''};return[a,b,c]}
+function llama(){var a='This is a single quote string',b='This is a double quote string',c={this:'is part of an Object',and:'so is this',but:'this one has "mixed" quotes: \''};return[a,b,c]}
@@ -1 +1 @@
-var reserved_words={class:!0};
+var reserved_words={"class":!0};
@@ -1 +1 @@
-{"version":3,"sources":["../test/fixtures/src/simple2.coffee"],"names":["number","opposite","square","x","list","math","root","Math","sqrt","cube","race","winner","runners","arguments","length","slice","call","print","elvis","alert","cubes","accum$","i$","length$","num"],"mappings":";;+DACCA,QAAW,GACXC,UAAW,EAGKA,WAAhBD,YAGAE,OAAS,SAAAC,SAAOA,GAAIA,GAGpBC,MAAQ,EAAG,EAAG,EAAG,EAAG,GAGpBC,MACGC,KAAQC,KAAIC,KACbN,OAAQA,OACRO,KAAQ,SAAAN,SAAOA,GAAID,OAAOC,KAG1BO,KAAO,SAAAC,OAAAC,eAASA,SAAA,GAAAC,UAAAC,UAAAC,MAAAC,KAAAH,UAAA,MACfI,MAAMN,OAAQC,UAGf,mBAAsBM,QAAA,MAAAA,OAAtBC,MAAM,cAGRC,MAAA,SAAAC,QAAS,IAAA,QAAAC,GAAA,EAAAC,QAAyBnB,KAAAU,OAAzBQ,GAAAC,UAAAD,GAAkBE,IAAOpB,KAAAkB,gBAAzBjB,KAAII,KAAMe","file":"sourcemapin.js"}
+{"version":3,"sources":["../test/fixtures/src/simple2.coffee"],"names":["number","opposite","square","x","list","math","root","Math","sqrt","cube","race","winner","runners","arguments","length","slice","call","print","elvis","alert","cubes","accum$","i$","length$","num"],"mappings":";;+DACCA,QAAW,GACXC,UAAW,EAGKA,WAAhBD,QAAS,IAGTE,OAAS,SAAAC,SAAOA,GAAIA,GAGpBC,MAAQ,EAAG,EAAG,EAAG,EAAG,GAGpBC,MACGC,KAAQC,KAAIC,KACbN,OAAQA,OACRO,KAAQ,SAAAN,SAAOA,GAAID,OAAOC,KAG1BO,KAAO,SAAAC,OAAAC,eAASA,SAAA,GAAAC,UAAAC,UAAAC,MAAAC,KAAAH,UAAA,MACfI,MAAMN,OAAQC,UAGf,mBAAsBM,QAAA,MAAAA,OAAtBC,MAAM,cAGRC,MAAA,SAAAC,QAAS,IAAA,QAAAC,GAAA,EAAAC,QAAyBnB,KAAAU,OAAzBQ,GAAAC,UAAAD,GAAkBE,IAAOpB,KAAAkB,gBAAzBjB,KAAII,KAAMe","file":"sourcemapin.js"}
@@ -1 +1 @@
-{"version":3,"sources":["../test/fixtures/src/simple2.coffee"],"names":["number","opposite","square","x","list","math","root","Math","sqrt","cube","race","winner","runners","arguments","length","slice","call","print","elvis","alert","cubes","accum$","i$","length$","num"],"mappings":"iCACCA,GAAW,GACXC,GAAW,EAGKA,IAAhBD,OAGAE,EAAS,SAAAC,SAAOA,GAAIA,GAGpBC,GAAQ,EAAG,EAAG,EAAG,EAAG,GAGpBC,GACGC,KAAQC,KAAIC,KACbN,OAAQA,EACRO,KAAQ,SAAAN,SAAOA,GAAID,EAAOC,KAG1BO,EAAO,SAAAC,EAAAC,SAASA,GAAA,GAAAC,UAAAC,UAAAC,MAAAC,KAAAH,UAAA,MACfI,MAAMN,EAAQC,IAGf,mBAAsBM,QAAA,MAAAA,OAAtBC,MAAM,cAGRC,EAAA,SAAAC,GAAS,IAAA,MAAAC,EAAA,EAAAC,EAAyBnB,EAAAU,OAAzBQ,EAAAC,IAAAD,EAAkBE,EAAOpB,EAAAkB,UAAzBjB,EAAII,KAAMe","file":"sourcemapin_sources.js","sourcesContent":["# Assignment:\nnumber = 42\nopposite = true\n\n# Conditions:\nnumber = -42 if opposite\n\n# Functions:\nsquare = (x) -> x * x\n\n# Arrays:\nlist = [1, 2, 3, 4, 5]\n\n# Objects:\nmath =\n root: Math.sqrt\n square: square\n cube: (x) -> x * square x\n\n# Splats:\nrace = (winner, runners...) ->\n print winner, runners\n\n# Existence:\nalert \"I knew it!\" if elvis?\n\n# Array comprehensions:\ncubes = (math.cube num for num in list)"]}
+{"version":3,"sources":["../test/fixtures/src/simple2.coffee"],"names":["number","opposite","square","x","list","math","root","Math","sqrt","cube","race","winner","runners","arguments","length","slice","call","print","elvis","alert","cubes","accum$","i$","length$","num"],"mappings":"iCACCA,GAAW,GACXC,GAAW,EAGKA,IAAhBD,GAAS,IAGTE,EAAS,SAAAC,SAAOA,GAAIA,GAGpBC,GAAQ,EAAG,EAAG,EAAG,EAAG,GAGpBC,GACGC,KAAQC,KAAIC,KACbN,OAAQA,EACRO,KAAQ,SAAAN,SAAOA,GAAID,EAAOC,KAG1BO,EAAO,SAAAC,EAAAC,SAASA,GAAA,GAAAC,UAAAC,UAAAC,MAAAC,KAAAH,UAAA,MACfI,MAAMN,EAAQC,IAGf,mBAAsBM,QAAA,MAAAA,OAAtBC,MAAM,cAGRC,EAAA,SAAAC,GAAS,IAAA,MAAAC,EAAA,EAAAC,EAAyBnB,EAAAU,OAAzBQ,EAAAC,IAAAD,EAAkBE,EAAOpB,EAAAkB,UAAzBjB,EAAII,KAAMe","file":"sourcemapin_sources.js","sourcesContent":["# Assignment:\nnumber = 42\nopposite = true\n\n# Conditions:\nnumber = -42 if opposite\n\n# Functions:\nsquare = (x) -> x * x\n\n# Arrays:\nlist = [1, 2, 3, 4, 5]\n\n# Objects:\nmath =\n root: Math.sqrt\n square: square\n cube: (x) -> x * square x\n\n# Splats:\nrace = (winner, runners...) ->\n print winner, runners\n\n# Existence:\nalert \"I knew it!\" if elvis?\n\n# Array comprehensions:\ncubes = (math.cube num for num in list)"]}
@@ -1,5 +1,5 @@
-// screw-ie8 true will remove quotes
+// screw-ie8 false will not remove quotes
var reserved_words = {
'class': true
};

0 comments on commit 2d04f24

Please sign in to comment.