From cdf6ce5f6695b05d8694ae14748edb31c8e27435 Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Wed, 29 Nov 2017 06:29:02 +0800 Subject: [PATCH] allow functions with no symbols --- lib/compress.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/compress.js b/lib/compress.js index 1dbe8054..dc761948 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -2264,11 +2264,14 @@ merge(Compressor.prototype, { def(AST_Constant, return_true); def(AST_Lambda, function(scope){ var self = this; - if (self.inlined) return false; var result = true; self.walk(new TreeWalker(function(node) { if (!result) return true; if (node instanceof AST_SymbolRef) { + if (self.inlined) { + result = false; + return true; + } var def = node.definition(); if (member(def, self.enclosed) && !self.variables.has(def.name)) {