[Pkg-javascript-commits] [uglifyjs] 183/228: sort options in alphabetical order (#1743)

Jonas Smedegaard dr at jones.dk
Sat Apr 15 14:25:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository uglifyjs.

commit a0c3836ba0e3baca8d758d9855144ac15ec0ac8d
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date:   Fri Mar 31 16:41:04 2017 +0800

    sort options in alphabetical order (#1743)
    
    They started off as functional groups I guess, but given the sheer number of options this is becoming too difficult to read.
---
 lib/compress.js   | 50 +++++++++++++++++++++++++-------------------------
 lib/output.js     | 28 ++++++++++++++--------------
 lib/parse.js      | 10 +++++-----
 lib/propmangle.js | 12 ++++++------
 lib/scope.js      | 14 +++++++-------
 tools/node.js     | 20 ++++++++++----------
 6 files changed, 67 insertions(+), 67 deletions(-)

diff --git a/lib/compress.js b/lib/compress.js
index ac7ea35..55f6d79 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -48,42 +48,42 @@ function Compressor(options, false_by_default) {
         return new Compressor(options, false_by_default);
     TreeTransformer.call(this, this.before, this.after);
     this.options = defaults(options, {
-        sequences     : !false_by_default,
-        properties    : !false_by_default,
+        angular       : false,
+        booleans      : !false_by_default,
+        cascade       : !false_by_default,
+        collapse_vars : !false_by_default,
+        comparisons   : !false_by_default,
+        conditionals  : !false_by_default,
         dead_code     : !false_by_default,
+        drop_console  : false,
         drop_debugger : !false_by_default,
-        unsafe        : false,
-        unsafe_comps  : false,
-        unsafe_math   : false,
-        unsafe_proto  : false,
-        conditionals  : !false_by_default,
-        comparisons   : !false_by_default,
         evaluate      : !false_by_default,
-        booleans      : !false_by_default,
-        loops         : !false_by_default,
-        unused        : !false_by_default,
-        toplevel      : !!(options && options["top_retain"]),
-        top_retain    : null,
+        expression    : false,
+        global_defs   : {},
         hoist_funs    : !false_by_default,
-        keep_fargs    : true,
-        keep_fnames   : false,
         hoist_vars    : false,
         if_return     : !false_by_default,
         join_vars     : !false_by_default,
-        collapse_vars : !false_by_default,
-        reduce_vars   : !false_by_default,
-        cascade       : !false_by_default,
-        side_effects  : !false_by_default,
+        keep_fargs    : true,
+        keep_fnames   : false,
+        loops         : !false_by_default,
+        negate_iife   : !false_by_default,
+        passes        : 1,
+        properties    : !false_by_default,
         pure_getters  : false,
         pure_funcs    : null,
-        negate_iife   : !false_by_default,
+        reduce_vars   : !false_by_default,
         screw_ie8     : true,
-        drop_console  : false,
-        angular       : false,
-        expression    : false,
+        sequences     : !false_by_default,
+        side_effects  : !false_by_default,
+        top_retain    : null,
+        toplevel      : !!(options && options["top_retain"]),
+        unsafe        : false,
+        unsafe_comps  : false,
+        unsafe_math   : false,
+        unsafe_proto  : false,
+        unused        : !false_by_default,
         warnings      : true,
-        global_defs   : {},
-        passes        : 1,
     }, true);
     var pure_funcs = this.options["pure_funcs"];
     if (typeof pure_funcs == "function") {
diff --git a/lib/output.js b/lib/output.js
index ac9e065..d5c7304 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -53,26 +53,26 @@ function is_some_comments(comment) {
 function OutputStream(options) {
 
     options = defaults(options, {
-        indent_start     : 0,
-        indent_level     : 4,
-        quote_keys       : false,
-        space_colon      : true,
         ascii_only       : false,
-        unescape_regexps : false,
-        inline_script    : false,
-        width            : 80,
-        max_line_len     : false,
         beautify         : false,
-        source_map       : null,
         bracketize       : false,
-        semicolons       : true,
         comments         : false,
-        shebang          : true,
-        preserve_line    : false,
-        screw_ie8        : true,
+        indent_level     : 4,
+        indent_start     : 0,
+        inline_script    : false,
+        keep_quoted_props: false,
+        max_line_len     : false,
         preamble         : null,
+        preserve_line    : false,
+        quote_keys       : false,
         quote_style      : 0,
-        keep_quoted_props: false,
+        screw_ie8        : true,
+        semicolons       : true,
+        shebang          : true,
+        source_map       : null,
+        space_colon      : true,
+        unescape_regexps : false,
+        width            : 80,
         wrap_iife        : false,
     }, true);
 
diff --git a/lib/parse.js b/lib/parse.js
index 1ccde26..c34e13d 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -688,14 +688,14 @@ var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "nam
 function parse($TEXT, options) {
 
     options = defaults(options, {
-        strict         : false,
-        filename       : null,
-        toplevel       : null,
+        bare_returns   : false,
+        cli            : false,
         expression     : false,
+        filename       : null,
         html5_comments : true,
-        bare_returns   : false,
         shebang        : true,
-        cli            : false,
+        strict         : false,
+        toplevel       : null,
     });
 
     var S = {
diff --git a/lib/propmangle.js b/lib/propmangle.js
index 3c75cac..cfa035d 100644
--- a/lib/propmangle.js
+++ b/lib/propmangle.js
@@ -62,12 +62,12 @@ function find_builtins() {
 
 function mangle_properties(ast, options) {
     options = defaults(options, {
-        reserved : null,
-        cache : null,
-        only_cache : false,
-        regex : null,
-        ignore_quoted : false,
-        debug : false
+        cache: null,
+        debug: false,
+        ignore_quoted: false,
+        only_cache: false,
+        regex: null,
+        reserved: null,
     });
 
     var reserved = options.reserved;
diff --git a/lib/scope.js b/lib/scope.js
index df0a7e0..74760e4 100644
--- a/lib/scope.js
+++ b/lib/scope.js
@@ -92,8 +92,8 @@ SymbolDef.prototype = {
 
 AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
     options = defaults(options, {
+        cache: null,
         screw_ie8: true,
-        cache: null
     });
 
     // pass 1: setup scope chaining and handle definitions
@@ -398,12 +398,12 @@ AST_Symbol.DEFMETHOD("global", function(){
 
 AST_Toplevel.DEFMETHOD("_default_mangler_options", function(options){
     return defaults(options, {
-        except      : [],
         eval        : false,
+        except      : [],
+        keep_fnames : false,
+        screw_ie8   : true,
         sort        : false, // Ignored. Flag retained for backwards compatibility.
         toplevel    : false,
-        screw_ie8   : true,
-        keep_fnames : false
     });
 });
 
@@ -576,12 +576,12 @@ var base54 = (function() {
 
 AST_Toplevel.DEFMETHOD("scope_warnings", function(options){
     options = defaults(options, {
-        undeclared       : false, // this makes a lot of noise
-        unreferenced     : true,
         assign_to_global : true,
+        eval             : true,
         func_arguments   : true,
         nested_defuns    : true,
-        eval             : true
+        undeclared       : false, // this makes a lot of noise
+        unreferenced     : true,
     });
     var tw = new TreeWalker(function(node){
         if (options.undeclared
diff --git a/tools/node.js b/tools/node.js
index 6568a74..147751a 100644
--- a/tools/node.js
+++ b/tools/node.js
@@ -46,21 +46,21 @@ function read_source_map(code) {
 
 UglifyJS.minify = function(files, options) {
     options = UglifyJS.defaults(options, {
-        spidermonkey     : false,
-        outSourceMap     : null,
-        outFileName      : null,
-        sourceRoot       : null,
-        inSourceMap      : null,
-        sourceMapUrl     : null,
-        sourceMapInline  : false,
+        compress         : {},
         fromString       : false,
-        warnings         : false,
+        inSourceMap      : null,
         mangle           : {},
         mangleProperties : false,
         nameCache        : null,
+        outFileName      : null,
         output           : null,
-        compress         : {},
-        parse            : {}
+        outSourceMap     : null,
+        parse            : {},
+        sourceMapInline  : false,
+        sourceMapUrl     : null,
+        sourceRoot       : null,
+        spidermonkey     : false,
+        warnings         : false,
     });
     UglifyJS.base54.reset();
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list