Skip to content

Commit 68c5c78

Browse files
author
hyperandroid
committed
Fixed some documentation typos.
1 parent 2747296 commit 68c5c78

File tree

5 files changed

+25
-15
lines changed

5 files changed

+25
-15
lines changed

automata.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ declare module Automata {
5555

5656
export function registerFSM( object:any );
5757
export function registerFDA( object:any );
58-
export function createSession( fda_name : string, logic:any ) : FSM.Session;
58+
export function createSession( fda_name : string, controller:any ) : FSM.Session;
5959
export function newGuardException( message : string ) : FSM.GuardException;
6060
export function newSessionListener( obj : any ) : FSM.SessionListener;
6161

automata.js

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@
6565
FSM.SessionCreationData;
6666

6767
/**
68-
* typedef {{ session : FSM.Session }}
68+
* @typedef {{ session : FSM.Session }}
6969
*/
7070
FSM.SessionFinalStateReachedEvent;
7171

7272
/**
73-
* typedef {{ session : FSM.Session, context : FSM.SessionContext }}
73+
* @typedef {{ session : FSM.Session, context : FSM.SessionContext }}
7474
*/
7575
FSM.SessionContextEvent;
7676

7777
/**
78-
* typedef {{
78+
* @typedef {{
7979
* session : FSM.Session,
8080
* context : FSM.SessionContext,
8181
* prevState : FSM.State,
@@ -86,7 +86,7 @@
8686
FSM.SessionStateChangeEvent;
8787

8888
/**
89-
* typedef {{
89+
* @typedef {{
9090
* session : FSM.Session,
9191
* transition : FSM.Transition,
9292
* message : FSM.TransitionMessage,
@@ -96,7 +96,7 @@
9696
FSM.TransitionGuardEvent;
9797

9898
/**
99-
* typedef {{
99+
* @typedef {{
100100
* session : FSM.Session,
101101
* data : Object,
102102
* }}
@@ -464,7 +464,7 @@
464464
*/
465465
createSession : function( sessionData ) {
466466

467-
var automata= sessionData.automata;
467+
var automata= sessionData.fda;
468468
var fsm= this.registry[ automata ];
469469
if ( typeof fsm==="undefined" ) {
470470
throw "FSM "+automata+" does not exist.";
@@ -1542,7 +1542,7 @@
15421542

15431543
this.sessionContextList.push( sc );
15441544
this.fireContextCreated( sc );
1545-
this.fireStateChanged( sc, null, state, __InitialTransitionId );
1545+
this.fireStateChanged( sc, null, state, {msgId : __InitialTransitionId} );
15461546
},
15471547

15481548
/**
@@ -1630,7 +1630,15 @@
16301630
* @type FSM.MessageCallbackTuple
16311631
*/
16321632
var pair= queue.shift();
1633+
1634+
/**
1635+
* @type {FSM.TransitionMessage}
1636+
*/
16331637
var msg= pair.message;
1638+
1639+
/**
1640+
* @type {ConsumeCallback}
1641+
*/
16341642
var callback= pair.callback;
16351643

16361644
var firingTransition= null; // FSM.Transition
@@ -1838,8 +1846,9 @@
18381846
/**
18391847
*
18401848
* @param sessionContext {FSM.SessionContext}
1849+
* @param fromState {FSM.State}
18411850
* @param newState {FSM.State}
1842-
* @param msg {FSM.State}
1851+
* @param msg {FSM.TransitionMessage}
18431852
*/
18441853
fireStateChanged : function( sessionContext, fromState, newState, msg ) {
18451854
for( var i=0; i<this.sessionListener.length; i++ ) {
@@ -2082,11 +2091,10 @@
20822091
/**
20832092
* Create a given FSM session.
20842093
*
2085-
* @param fsm <string> a FSM registered name.
2086-
* @param controller {object}
2094+
* @param data {FSM.SessionCreationData}
20872095
*/
2088-
function createSession( fsm, controller ) {
2089-
return fsmContext.createSession( fsm, controller );
2096+
function createSession( data ) {
2097+
return fsmContext.createSession( data );
20902098
}
20912099

20922100
function guardException( str ) {

changelog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* Fully asynchronous execution.
66
* Added 'consume message' callback.
77
* Logic object does not belong to the automata defintion anymore.
8+
* Logic object concept is deprecated in favor of session controller.
9+
* Session lifecycle has been modified: create, start, end.
810

911
07-02-2015 *1.1.1*
1012
------------------

test/test.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<script src="test1.js"></script>
1919
<script src="test3.js"></script>
2020
-->
21-
<script src="test4.js"></script>
21+
<script src="test1.js"></script>
2222
<!--<script src="test2.js"></script>-->
2323
<!--<script src="test3.js"></script>-->
2424
<!--<script src="test4.js"></script>-->

test/test4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ var session= context.createSession({
145145
});
146146

147147
session.start( function(session) {
148-
148+
149149
session.consume({msgId: "ab"});
150150
session.consume({msgId: "bc"}, function () {
151151

0 commit comments

Comments
 (0)