Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: scripts/astDecompile.js

Issue 6256752412590080: Issue 301 - jshydra: Handle for .. of .. (Closed)
Patch Set: Created April 10, 2014, 5:05 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« jshydra.js ('K') | « scripts/abprewrite.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« jshydra.js ('K') | « scripts/abprewrite.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld