|
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:
405 bytes
|
| Rev | Line | |
|---|
| [e4c61dd] | 1 | export default function(callback, that) {
|
|---|
| 2 | var node = this, nodes = [node], next = [], children, i, n, index = -1;
|
|---|
| 3 | while (node = nodes.pop()) {
|
|---|
| 4 | next.push(node);
|
|---|
| 5 | if (children = node.children) {
|
|---|
| 6 | for (i = 0, n = children.length; i < n; ++i) {
|
|---|
| 7 | nodes.push(children[i]);
|
|---|
| 8 | }
|
|---|
| 9 | }
|
|---|
| 10 | }
|
|---|
| 11 | while (node = next.pop()) {
|
|---|
| 12 | callback.call(that, node, ++index, this);
|
|---|
| 13 | }
|
|---|
| 14 | return this;
|
|---|
| 15 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.