aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js1
-rw-r--r--lib/output.js2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index cbcb7b86..3804a932 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -2327,6 +2327,7 @@ merge(Compressor.prototype, {
};
OPT(AST_For, function(self, compressor){
+ if (is_empty(self.init)) self.init = null;
if (!compressor.option("loops")) return self;
if (self.condition) {
var cond = self.condition.evaluate(compressor);
diff --git a/lib/output.js b/lib/output.js
index 767abd4d..c0f10523 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -799,7 +799,7 @@ function OutputStream(options) {
output.print("for");
output.space();
output.with_parens(function(){
- if (self.init && !(self.init instanceof AST_EmptyStatement)) {
+ if (self.init) {
if (self.init instanceof AST_Definitions) {
self.init.print(output);
} else {