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: autotest now passes for me Created April 11, 2014, 10:51 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
« no previous file with comments | « 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) {
« no previous file with comments | « scripts/abprewrite.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld