mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
fixed non-recursive traverse() for CodeNode
This commit is contained in:
@@ -953,7 +953,7 @@
|
|||||||
_a = []; _b = this.real_children();
|
_a = []; _b = this.real_children();
|
||||||
for (_c = 0, _d = _b.length; _c < _d; _c++) {
|
for (_c = 0, _d = _b.length; _c < _d; _c++) {
|
||||||
child = _b[_c];
|
child = _b[_c];
|
||||||
_a.push(block(child));
|
_a.push(child.traverse(block));
|
||||||
}
|
}
|
||||||
return _a;
|
return _a;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -723,7 +723,7 @@ exports.CodeNode: class CodeNode extends BaseNode
|
|||||||
# Custom `traverse` implementation that uses the `real_children`.
|
# Custom `traverse` implementation that uses the `real_children`.
|
||||||
traverse: (block) ->
|
traverse: (block) ->
|
||||||
block this
|
block this
|
||||||
block(child) for child in @real_children()
|
child.traverse block for child in @real_children()
|
||||||
|
|
||||||
toString: (idt) ->
|
toString: (idt) ->
|
||||||
idt ||= ''
|
idt ||= ''
|
||||||
|
|||||||
Reference in New Issue
Block a user