Move the idea of a symbol having a default value up the class chain.
This commit is contained in:
parent
600ff2f6be
commit
6a95d60abd
10
lib/ast.js
10
lib/ast.js
|
|
@ -1037,16 +1037,8 @@ var AST_SymbolConst = DEFNODE("SymbolConst", null, {
|
||||||
$documentation: "A constant declaration"
|
$documentation: "A constant declaration"
|
||||||
}, AST_SymbolDeclaration);
|
}, AST_SymbolDeclaration);
|
||||||
|
|
||||||
var AST_SymbolFunarg = DEFNODE("SymbolFunarg", "default", {
|
var AST_SymbolFunarg = DEFNODE("SymbolFunarg", null, {
|
||||||
$documentation: "Symbol naming a function argument",
|
$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);
|
}, AST_SymbolVar);
|
||||||
|
|
||||||
var AST_SymbolDefun = DEFNODE("SymbolDefun", null, {
|
var AST_SymbolDefun = DEFNODE("SymbolDefun", null, {
|
||||||
|
|
|
||||||
|
|
@ -1292,7 +1292,7 @@ function OutputStream(options) {
|
||||||
DEFPRINT(AST_Symbol, function (self, output) {
|
DEFPRINT(AST_Symbol, function (self, output) {
|
||||||
self._do_print(output);
|
self._do_print(output);
|
||||||
});
|
});
|
||||||
DEFPRINT(AST_SymbolFunarg, function(self, output){
|
DEFPRINT(AST_SymbolDeclaration, function(self, output){
|
||||||
self._do_print(output);
|
self._do_print(output);
|
||||||
if (self.default) {
|
if (self.default) {
|
||||||
output.space();
|
output.space();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user