rem:  if(action instanceof Reveal) { action.streakLength = prev ? prev.streakLength : 0; return 0; } 
context:   getScoreFor: function(action) {    if(action instanceof DealToPile) {      action.streakLength = 0;      return -5;    }    var done = this.actionsDone;    var prev = done.length>1 ? done[done.length-2] : null;    if(action instanceof Reveal) {      action.streakLength = prev ? prev.streakLength : 0;      return 0;    }    // it's a Move    var score = action.streakLength = prev ? prev.streakLength + 1 : 1;    // bonuses for removing a peak card    var pile = action.source, ps = this.piles;    if(pile.isPeak)      score += (ps[0].hasChildNodes() + ps[1].hasChildNodes() + ps[2].hasChildNodes() == 1) ? 30 : 15;    return score;  }
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/51238e4aeced596a0a6b1b1d3f980bc0d9f2ac0c/tripeaks.js/buggy/tripeaks.js