Parse and compress destructuring VarDefs
This commit is contained in:
committed by
Richard van Velzen
parent
824ecfb8a2
commit
c44c2d6c21
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user