Starting destructuring.

This commit is contained in:
Fábio Santos
2015-01-15 03:03:38 +00:00
committed by Richard van Velzen
parent 252fc65558
commit 32f76f7ff8
7 changed files with 317 additions and 41 deletions

View File

@@ -598,6 +598,17 @@ function OutputStream(options) {
output.print_string(self.value, self.quote);
output.semicolon();
});
DEFPRINT(AST_Destructuring, function (self, output) {
output.print(self.is_array ? "[" : "{");
var first = true;
self.names.forEach(function (name) {
if (first) first = false; else { output.comma(); output.space(); }
name.print(output);
})
output.print(self.is_array ? "]" : "}");
})
DEFPRINT(AST_Debugger, function(self, output){
output.print("debugger");
output.semicolon();