Index: scripts/astDecompile.js |
=================================================================== |
--- a/scripts/astDecompile.js |
+++ b/scripts/astDecompile.js |
@@ -129,16 +129,27 @@ function decompileForInStatement(ast) { |
str += decompileVariableDeclaration(ast.left, true); |
else |
str += decompileAST(ast.left); |
str += " in " + decompileExpr(ast.right, ast) + ") "; |
str += decompileAST(ast.body); |
return str; |
} |
+function decompileForOfStatement(ast) { |
+ let str = "for ("; |
+ if (ast.left.type == "VariableDeclaration") |
+ str += decompileVariableDeclaration(ast.left, true); |
+ else |
+ str += decompileAST(ast.left); |
+ str += " of " + decompileExpr(ast.right, ast) + ") "; |
+ str += decompileAST(ast.body); |
+ return str; |
+} |
+ |
function decompileLetStatement(ast) { |
let str = "let ("; |
str += [d ? decompileAST(d) : ' ' for each (d in ast.head)].join(', '); |
str += ") " + decompileAST(ast.body); |
return str; |
} |
function decompileDebuggerStatement(ast) { |