All pastes #570785 Raw Edit

Stuff

public text v1 · immutable
·published 2007-06-16 21:35 UTC
rendered paste body
Directory.prototype.getChild = function (id)
{
	if (!requestIDChild[this.id])
	requestIDChild[this.id] = 1;
	else
	requestIDChild[this.id]++;
	
	if (this.id == id)
	return this;
	
	if (!this.hasChild())
	return false;
	
	for (_a=0;_a<this.child.length;_a++)
	{
		if (this.child[_a].id == id)
		{
			return this.child[_a];
		}
		
		if (this.child[_a].hasChild())
		{
			recur = this.child[_a].getChild(id);
			
			if (recur != false)
			return recur;
		}
	}
	
	return false;
}