@@ -82,14 +82,14 @@ function minify(files, options) {
8282 keep_fargs : false ,
8383 keep_fnames : false ,
8484 mangle : { } ,
85- module : false ,
85+ module : undefined ,
8686 nameCache : null ,
8787 output : { } ,
8888 parse : { } ,
8989 rename : undefined ,
9090 sourceMap : false ,
9191 timings : false ,
92- toplevel : ! ! ( options && ! options [ "expression" ] && options [ "module" ] ) ,
92+ toplevel : undefined ,
9393 v8 : false ,
9494 validate : false ,
9595 warnings : false ,
@@ -104,8 +104,10 @@ function minify(files, options) {
104104 if ( options . ie ) set_shorthand ( "ie" , options , [ "compress" , "mangle" , "output" , "rename" ] ) ;
105105 if ( options . keep_fargs ) set_shorthand ( "keep_fargs" , options , [ "compress" , "mangle" , "rename" ] ) ;
106106 if ( options . keep_fnames ) set_shorthand ( "keep_fnames" , options , [ "compress" , "mangle" , "rename" ] ) ;
107+ if ( options . module === undefined && ! options . ie ) options . module = true ;
107108 if ( options . module ) set_shorthand ( "module" , options , [ "compress" , "parse" ] ) ;
108- if ( options . toplevel ) set_shorthand ( "toplevel" , options , [ "compress" , "mangle" , "rename" ] ) ;
109+ if ( options . toplevel === undefined && ! options . expression && options . module ) options . toplevel = true ;
110+ if ( options . toplevel !== undefined ) set_shorthand ( "toplevel" , options , [ "compress" , "mangle" , "rename" ] ) ;
109111 if ( options . v8 ) set_shorthand ( "v8" , options , [ "mangle" , "output" , "rename" ] ) ;
110112 if ( options . webkit ) set_shorthand ( "webkit" , options , [ "compress" , "mangle" , "output" , "rename" ] ) ;
111113 var quoted_props ;
0 commit comments