aboutsummaryrefslogtreecommitdiff
path: root/lib/minify.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/minify.js')
-rw-r--r--lib/minify.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/minify.js b/lib/minify.js
index d84f6825..5f865c63 100644
--- a/lib/minify.js
+++ b/lib/minify.js
@@ -51,7 +51,6 @@ function to_json(cache) {
}
function minify(files, options) {
- var warn_function = AST_Node.warn_function;
try {
options = defaults(options, {
compress: {},
@@ -78,7 +77,6 @@ function minify(files, options) {
set_shorthand("ie8", options, [ "compress", "mangle", "output" ]);
set_shorthand("keep_fnames", options, [ "compress", "mangle" ]);
set_shorthand("toplevel", options, [ "compress", "mangle" ]);
- set_shorthand("warnings", options, [ "compress" ]);
var quoted_props;
if (options.mangle) {
options.mangle = defaults(options.mangle, {
@@ -116,11 +114,9 @@ function minify(files, options) {
}, true);
}
var warnings = [];
- if (options.warnings && !AST_Node.warn_function) {
- AST_Node.warn_function = function(warning) {
- warnings.push(warning);
- };
- }
+ if (options.warnings) AST_Node.log_function(function(warning) {
+ warnings.push(warning);
+ }, options.warnings == "verbose");
if (timings) timings.parse = Date.now();
var source_maps, toplevel;
if (files instanceof AST_Toplevel) {
@@ -240,7 +236,5 @@ function minify(files, options) {
return result;
} catch (ex) {
return { error: ex };
- } finally {
- AST_Node.warn_function = warn_function;
}
}