function handleInvalidStateChanges(newState) {
        if (!isValidState(newState)) {
          signalChangeFailed('\'' + newState + '\' is not a valid state', newState);

          return false;
        }

        if (!isValidTransition(currentState, newState)) {
          signalChangeFailed('\'' + currentState + '\' cannot transition to \'' +
            newState + '\'', newState);

          return false;
        }

        return true;
      }
// Validates +newState+. If it's invalid it triggers stateChangeFailed and returns false.
Validates +newState+. If it's invalid it triggers stateChangeFailed and returns false.
Validates + newState + . If it ' s invalid it triggers stateChangeFailed and returns false .
function handleInvalidStateChanges(newState) {
        if (!isValidState(newState)) {
          signalChangeFailed('\'' + newState + '\' is not a valid state', newState);
          return false;
        }
        if (!isValidTransition(currentState, newState)) {
          signalChangeFailed('\'' + currentState + '\' cannot transition to \'' +
            newState + '\'', newState);
          return false;
        }
        return true;
      }
function handleInvalidStateChanges ( newState ) { if ( ! isValidState ( newState ) ) { signalChangeFailed ( '\'' + newState + '\' is not a valid state' , newState ) ; return false ; } if ( ! isValidTransition ( currentState , newState ) ) { signalChangeFailed ( '\'' + currentState + '\' cannot transition to \'' + newState + '\'' , newState ) ; return false ; } return true ; }
Validates +newState+.
Validates + newState + .