aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMihai Bazon <mihai.bazon@gmail.com>2015-11-11 22:15:25 +0200
committerMihai Bazon <mihai.bazon@gmail.com>2015-11-11 22:15:25 +0200
commit7691bebea525e96cb74d52e0bb8f294cf778c966 (patch)
treed2485ce55b215edb1846cbbe9cc3e4e3ad28725d /tools
parent3c4346728e5067608b6393ba98e24849ac22adea (diff)
downloadtracifyjs-7691bebea525e96cb74d52e0bb8f294cf778c966.tar.gz
tracifyjs-7691bebea525e96cb74d52e0bb8f294cf778c966.zip
Rework has_directive
It's now available during tree walking, i.e. walker.has_directive("use asm"), rather than as part of the scope. It's thus no longer necessary to call `figure_out_scope` before codegen. Added special bits in the code generator to overcome the fact that it doesn't inherit from TreeWalker. Fix #861
Diffstat (limited to 'tools')
-rw-r--r--tools/node.js10
1 files changed, 1 insertions, 9 deletions
diff --git a/tools/node.js b/tools/node.js
index 7e61d2a1..f6048661 100644
--- a/tools/node.js
+++ b/tools/node.js
@@ -45,7 +45,6 @@ exports.minify = function(files, options) {
UglifyJS.base54.reset();
// 1. parse
- var haveScope = false;
var toplevel = null,
sourcesContent = {};
@@ -74,7 +73,6 @@ exports.minify = function(files, options) {
var compress = { warnings: options.warnings };
UglifyJS.merge(compress, options.compress);
toplevel.figure_out_scope();
- haveScope = true;
var sq = UglifyJS.Compressor(compress);
toplevel = toplevel.transform(sq);
}
@@ -82,17 +80,11 @@ exports.minify = function(files, options) {
// 3. mangle
if (options.mangle) {
toplevel.figure_out_scope(options.mangle);
- haveScope = true;
toplevel.compute_char_frequency(options.mangle);
toplevel.mangle_names(options.mangle);
}
- // 4. scope (if needed)
- if (!haveScope) {
- toplevel.figure_out_scope();
- }
-
- // 5. output
+ // 4. output
var inMap = options.inSourceMap;
var output = {};
if (typeof options.inSourceMap == "string") {