Created
March 19, 2011 19:30
-
-
Save mikechambers/877734 to your computer and use it in GitHub Desktop.
Recursive Call for Clearing Nested nodes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BoundsNode.prototype.clear = function() | |
{ | |
this._stuckCount = 0; | |
//array | |
this.children.length = 0; | |
var len = this.nodes.length; | |
if(!len) | |
{ | |
return; | |
} | |
for(var i = 0; i < len; i++) | |
{ | |
this.nodes[i].clear(); | |
} | |
//array | |
this.nodes.length = 0; | |
//call the hidden super.clear, and make sure its called with this = this instance | |
//Object.getPrototypeOf(BoundsNode.prototype).clear.call(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment