diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-06-28 03:46:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-28 03:46:19 +0800 |
commit | 957d5537a80fcb4037df21f0dbe16391fd0424ad (patch) | |
tree | 5b3611481daad223c62e01dacba0da16a3717f21 /tools/node.js | |
parent | 88c8f4e363e0d585b33ea29df560243d3dc74ce1 (diff) | |
download | tracifyjs-957d5537a80fcb4037df21f0dbe16391fd0424ad.tar.gz tracifyjs-957d5537a80fcb4037df21f0dbe16391fd0424ad.zip |
improve `unsafe` `comparisons` (#3200)
Diffstat (limited to 'tools/node.js')
-rw-r--r-- | tools/node.js | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/tools/node.js b/tools/node.js index 2e8f2d5c..3e37092c 100644 --- a/tools/node.js +++ b/tools/node.js @@ -1,7 +1,6 @@ var fs = require("fs"); -var UglifyJS = exports; -var FILES = UglifyJS.FILES = [ +exports.FILES = [ "../lib/utils.js", "../lib/ast.js", "../lib/parse.js", @@ -19,15 +18,12 @@ var FILES = UglifyJS.FILES = [ }); new Function("MOZ_SourceMap", "exports", function() { - var code = FILES.map(function(file) { + var code = exports.FILES.map(function(file) { return fs.readFileSync(file, "utf8"); }); code.push("exports.describe_ast = " + describe_ast.toString()); return code.join("\n\n"); -}())( - require("source-map"), - UglifyJS -); +}())(require("source-map"), exports); function describe_ast() { var out = OutputStream({ beautify: true }); @@ -65,11 +61,11 @@ function describe_ast() { } function infer_options(options) { - var result = UglifyJS.minify("", options); + var result = exports.minify("", options); return result.error && result.error.defs; } -UglifyJS.default_options = function() { +exports.default_options = function() { var defs = {}; Object.keys(infer_options({ 0: 0 })).forEach(function(component) { var options = {}; |