rem: for(i = 0; i < this.stacks.length; i++) { var s = this.stacks[i]; 
add: for(i = 0; i != this.piles.length; i++) { var s = this.piles[i]; 
context:   init: function() {    // The numbers of the piles that should be the leftChild of piles 0 to 17.    // (The rightChild's are all 1 greater than the leftChild's.)    // Piles 18-27 have no children.    const lefts = [3,5,7,9,10,12,13,15,16,18,19,20,21,22,23,24,25,26];    for(var i = 0; i != 18; i++) {      var p = this.stacks[i];      var l = this.stacks[lefts[i]];      var r = this.stacks[lefts[i]+1];      p.leftChild = l;      l.rightParent = p;      p.rightChild = r;      r.leftParent = p;    }    // these are the piles which have no left/right parent    const nolp = [0,1,2,3,5,7,9,12,15,18];    const norp = [0,1,2,4,6,8,11,14,17,27];    for(i = 0; i != nolp.length; i++) this.stacks[nolp[i]].leftParent = null;    for(i = 0; i != norp.length; i++) this.stacks[norp[i]].rightParent = null;    // handler, and we need them to have .leftChild and .rightChild    for(i = 0; i < this.stacks.length; i++) {      var s = this.stacks[i];      s.leftFree = function() { return !(this.leftChild && this.leftChild.hasChildNodes()); };      s.rightFree = function() { return !(this.rightChild && this.rightChild.hasChildNodes()); };      s.free = function() { return !(this.leftChild && (this.leftChild.hasChildNodes() || this.rightChild.hasChildNodes())); };    }    // convenience    this.waste.free = function() { return true; };  },
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/15f3df693ddf02fb9ee6a2662189220868368b23/tripeaks.js/buggy/tripeaks.js