Enumerate children only.
This commit is contained in:
parent
9dcf49b548
commit
97312fe080
@ -46,11 +46,11 @@ OV.Node = class
|
||||
return this.meshIndices;
|
||||
}
|
||||
|
||||
Enumerate (processor)
|
||||
EnumerateChildren (processor)
|
||||
{
|
||||
processor (this);
|
||||
for (const childNode of this.childNodes) {
|
||||
childNode.Enumerate (processor);
|
||||
processor (childNode);
|
||||
childNode.EnumerateChildren (processor);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -51,10 +51,10 @@ describe ('Node', function() {
|
||||
child1.AddChildNode (child12);
|
||||
|
||||
let enumerated = [];
|
||||
node.Enumerate ((child) => {
|
||||
node.EnumerateChildren ((child) => {
|
||||
enumerated.push (child);
|
||||
});
|
||||
|
||||
assert.deepStrictEqual (enumerated, [node, child1, child11, child12, child2]);
|
||||
assert.deepStrictEqual (enumerated, [child1, child11, child12, child2]);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user