Skip to content
Browse files

More optional params.

  • Loading branch information...
1 parent 5e57bdc commit b1d6dc29e6e05fc67fe423981df6cbb83bd72630 @jverkoey committed Mar 2, 2010
Showing with 6 additions and 5 deletions.
  1. +6 −5 dev/core/class.statemachine.js
View
11 dev/core/class.statemachine.js
@@ -128,17 +128,18 @@ Breeze.StateMachine.prototype.init = function(startState, opt_queuedState) {
};
/**
- * @param {number} newState
- * @param {number} queuedState
+ * @param {number} newState
+ * @param {number=} opt_queuedState
*/
-Breeze.StateMachine.prototype.transitionTo = function(newState, queuedState) {
+Breeze.StateMachine.prototype.transitionTo = function(newState, opt_queuedState) {
+ opt_queuedState = opt_queuedState || Breeze.StateMachine.ReservedIDs.InvalidID;
if (this.states_[this.curr_ - Breeze.StateMachine.ReservedIDs.StartID].flags
& Breeze.StateMachine.Flags.NotifyChildren) {
// We can't transfer immediately in this case. Let the implementor notify
// its children first.
this.isTransitioning_ = true;
this.transitionTo_ = newState;
- this.transitionToQueue_ = queuedState;
+ this.transitionToQueue_ = opt_queuedState;
this.notifier_.notifyChildrenStateChange(newState);
@@ -148,7 +149,7 @@ Breeze.StateMachine.prototype.transitionTo = function(newState, queuedState) {
}
} else {
// Otherwise we can transition immediately.
- if (this.queueStateChange(newState, queuedState)) {
+ if (this.queueStateChange(newState, opt_queuedState)) {
this.clearTransition();
}
}

0 comments on commit b1d6dc2

Please sign in to comment.
Something went wrong with that request. Please try again.