|
Last change
on this file since a762898 was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
334 bytes
|
| Line | |
|---|
| 1 | export default function(callback, that) {
|
|---|
| 2 | var node = this, nodes = [node], children, i, index = -1;
|
|---|
| 3 | while (node = nodes.pop()) {
|
|---|
| 4 | callback.call(that, node, ++index, this);
|
|---|
| 5 | if (children = node.children) {
|
|---|
| 6 | for (i = children.length - 1; i >= 0; --i) {
|
|---|
| 7 | nodes.push(children[i]);
|
|---|
| 8 | }
|
|---|
| 9 | }
|
|---|
| 10 | }
|
|---|
| 11 | return this;
|
|---|
| 12 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.