mooremachine
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -36,2 +36,4 @@ // Copyright 2015 Joyent, Inc. | ||
this.fsm_history = []; | ||
this.fsm_inTransition = false; | ||
this.fsm_nextState = undefined; | ||
this.fsm_validTransitions = undefined; | ||
@@ -96,2 +98,8 @@ if (this.fsm_allStateEvents === undefined) | ||
if (this.fsm_inTransition) { | ||
assert.ok(this.fsm_nextState === undefined); | ||
this.fsm_nextState = state; | ||
return; | ||
} | ||
if (this.fsm_validTransitions !== undefined) { | ||
@@ -139,4 +147,6 @@ if (this.fsm_validTransitions.indexOf(state) === -1) { | ||
this.fsm_inTransition = true; | ||
f.call(this, this.sOn.bind(this), this.sOnce.bind(this), | ||
this.sTimeout.bind(this), this.sOnState.bind(this)); | ||
this.fsm_inTransition = false; | ||
@@ -154,2 +164,8 @@ var self = this; | ||
this.emit('stateChanged', state); | ||
var next = this.fsm_nextState; | ||
if (next !== undefined) { | ||
this.fsm_nextState = undefined; | ||
this.gotoState(next); | ||
} | ||
}; | ||
@@ -156,0 +172,0 @@ |
{ | ||
"name": "mooremachine", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "Moore finite state machines", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14923
216