Move the idea of a symbol having a default value up the class chain.

This commit is contained in:
Fábio Santos 2015-11-22 19:00:54 +00:00 committed by Burak Can
parent 600ff2f6be
commit 6a95d60abd
2 changed files with 2 additions and 10 deletions

View File

@ -1037,16 +1037,8 @@ var AST_SymbolConst = DEFNODE("SymbolConst", null, {
$documentation: "A constant declaration"
}, AST_SymbolDeclaration);
var AST_SymbolFunarg = DEFNODE("SymbolFunarg", "default", {
var AST_SymbolFunarg = DEFNODE("SymbolFunarg", null, {
$documentation: "Symbol naming a function argument",
$propdoc: {
default: "[AST_Expression] The default for this parameter. For example, `= 6`"
},
_walk: function (visitor) {
return visitor._visit(this, function() {
if (this.default) this.default._walk(visitor);
});
}
}, AST_SymbolVar);
var AST_SymbolDefun = DEFNODE("SymbolDefun", null, {

View File

@ -1292,7 +1292,7 @@ function OutputStream(options) {
DEFPRINT(AST_Symbol, function (self, output) {
self._do_print(output);
});
DEFPRINT(AST_SymbolFunarg, function(self, output){
DEFPRINT(AST_SymbolDeclaration, function(self, output){
self._do_print(output);
if (self.default) {
output.space();