fix output for arrays containing undefined values
authorMihai Bazon <mihai@bazon.net>
Tue, 28 Aug 2012 12:38:35 +0000 (15:38 +0300)
committerMihai Bazon <mihai@bazon.net>
Tue, 28 Aug 2012 12:38:35 +0000 (15:38 +0300)
[1,,2,] ==> [1,,2] instead of [1,undefined,2]

lib/output.js

index 7cd3e3c..5f2f46d 100644 (file)
@@ -812,7 +812,8 @@ function OutputStream(options) {
             if (len > 0) output.space();
             a.forEach(function(exp, i){
                 if (i) output.comma();
-                exp.print(output);
+                if (!(exp instanceof AST_Undefined))
+                    exp.print(output);
             });
             if (len > 0) output.space();
         });