aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-12-29 14:04:52 +0800
committerGitHub <noreply@github.com>2017-12-29 14:04:52 +0800
commitd819559a01fca28921a9b93cb1f4127b6ea3306b (patch)
tree7f4a43d06937a215a76399df7bc8d073024296f5
parent8ca49155a8a3b0030b621fd4a5ba63147ea1c72f (diff)
downloadtracifyjs-d819559a01fca28921a9b93cb1f4127b6ea3306b.tar.gz
tracifyjs-d819559a01fca28921a9b93cb1f4127b6ea3306b.zip
minor clean-ups (#2686)
-rw-r--r--lib/compress.js2
-rw-r--r--lib/output.js8
2 files changed, 3 insertions, 7 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 4e3a8f82..318246cd 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -3998,7 +3998,7 @@ merge(Compressor.prototype, {
}
if (defs) defs.push(arg.definition());
}
- return !defs || defs.length == 0 || !is_reachable(fn.body[0], defs);
+ return !defs || defs.length == 0 || !is_reachable(stat, defs);
}
function flatten_args(fn) {
diff --git a/lib/output.js b/lib/output.js
index fc592d60..58521e3c 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -671,9 +671,7 @@ function OutputStream(options) {
}
};
- PARENS(AST_Node, function(){
- return false;
- });
+ PARENS(AST_Node, return_false);
// a function expression needs parens around it when it's provably
// the first token to appear in a statement.
@@ -699,9 +697,7 @@ function OutputStream(options) {
// same goes for an object literal, because otherwise it would be
// interpreted as a block of code.
- PARENS(AST_Object, function(output){
- return first_in_statement(output);
- });
+ PARENS(AST_Object, first_in_statement);
PARENS(AST_Unary, function(output){
var p = output.parent();