Parse and compress destructuring VarDefs

This commit is contained in:
Fábio Santos
2015-08-14 00:20:21 +01:00
committed by Richard van Velzen
parent 824ecfb8a2
commit c44c2d6c21
7 changed files with 105 additions and 8 deletions

View File

@@ -665,9 +665,12 @@ var AST_Const = DEFNODE("Const", null, {
var AST_VarDef = DEFNODE("VarDef", "name value", {
$documentation: "A variable declaration; only appears in a AST_Definitions node",
$propdoc: {
name: "[AST_SymbolVar|AST_SymbolConst] name of the variable",
name: "[AST_SymbolVar|AST_SymbolConst|AST_Destructuring] name of the variable",
value: "[AST_Node?] initializer, or null of there's no initializer"
},
is_destructuring: function() {
return this.name instanceof AST_Destructuring;
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.name._walk(visitor);