<commit_before>define(function()
{
  var StateMachine = function()
  {
    this._states = [];
  }
  StateMachine.prototype.changeState = function( newState )
  {
    if ( this._states.length > 0 ) {
      state = this._states.pop();
      if ( state == newState )
        return false;
      this.onLeaveState( state );
    }
    this._states.push( newState );
    this.onEnterState( newState );
    return true;
  };
  StateMachine.prototype.pushState = function( newState )
  {
    state = this.getState();
    if ( state !== null )
      this.onLeaveState( state );
    this._states.push( newState );
    this.onEnterState( newState );
  };
  StateMachine.prototype.popState = function()
  {
    if ( this._states.length > 0 ) {
      state = this._states.pop();
      this.onLeaveState( state );
    }
    state = this.getState();
    if ( state !== null )
      this.onEnterState( state );
  };
  StateMachine.prototype.getState = function()<commit_msg>Don't lose client state half of the time when reconnecting. Fixes #7<commit_after>define(function()
{
  var StateMachine = function()
  {
    this._states = [];
  };
  StateMachine.prototype.changeState = function( newState )
  {
    if ( this._states.length > 0 ) {
      state = this.getState();
      if ( state == newState )
        return false;
      this._states.pop();
      this.onLeaveState( state );
    }
    this._states.push( newState );
    this.onEnterState( newState );
    return true;
  };
  StateMachine.prototype.pushState = function( newState )
  {
    state = this.getState();
    if ( state !== null )
      this.onLeaveState( state );
    this._states.push( newState );
    this.onEnterState( newState );
  };
  StateMachine.prototype.popState = function()
  {
    if ( this._states.length > 0 ) {
      state = this._states.pop();
      this.onLeaveState( state );
    }
    state = this.getState();
    if ( state !== null )
      this.onEnterState( state );
  };
  StateMachine.prototype.getState = function()
{'fraction_non_alphanumeric': 0.13634085213032582, 'fraction_numerical': 0.002506265664160401, 'mean_word_length': 2.5963963963963965, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6318001', 'n_tokens_mistral': 622, 'n_tokens_neox': 616, 'n_words': 127}