function hop_state_history_update( olds, news ) {   var res = 0;      if( olds == undefined ) {      /* set the new values */      for( p in news ) {	 var state = news[ p ];	 if( state instanceof _hop_state_entry ) {	    var op = state.op;	    var handler = hop_state_history_handler[ op ];	    	    if( (handler != undefined) && !state.close ) {	       if( handler.proc( p, state.val ) ) {		  state.close = true;	       } else {		  res++;	       }	    }	 }      }   } else {      /* reset all the entries that used to be in old    */      /* state that are no longer present in the new one */      for( p in olds ) {	 if( (olds[ p ] instanceof _hop_state_entry) &&	     !(news[ p ] instanceof _hop_state_entry) ) {	    var op = olds[ p ].op;	    var handler = hop_state_history_handler[ op ];	    if( handler != undefined ) {	       handler.proc( p, handler.reset );	    }	 }      }      /* update all the entries that are not */      /* present and equal in old state      */      for( p in news ) {	 var state = news[ p ];	 if( state instanceof _hop_state_entry ) {	    if( !(olds[ p ] instanceof _hop_state_entry) ||		(state.op != olds[ p ].op) ||		(state.val != olds[ p ].val) ) {	       var op = state.op;	       var handler =  hop_state_history_handler[ op ];	       	       if( (handler != undefined) && !state.close ) {		  if( handler.proc( p, state.val ) ) {		     state.close = true;		  } else {		     res++;		  }	       }	    }	 }      }   }   return res;}
4636	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/4636/bb3ec76e0f1c3eabc42e454354d0f2fa692587f3/hop-history.js/clean/share/hop-history.js