Permalink
Browse files

Allow SCION host to pass in a sessionid and have it reflected as _ses…

…sionid, issue #7
  • Loading branch information...
1 parent a17638a commit 0fd81a8e709ca0d0bbd653217c9585efe365345c @jbeard4 committed Dec 24, 2012
Showing with 5 additions and 2 deletions.
  1. +4 −1 lib/core/scxml/SCXML.js
  2. +1 −1 lib/core/util/code-gen.js
View
@@ -52,6 +52,8 @@ function SCXMLInterpreter(model, opts){
this.opts.TransitionPairSet = this.opts.TransitionPairSet || ArraySet;
this.opts.priorityComparisonFn = this.opts.priorityComparisonFn || getTransitionWithHigherSourceChildPriority(this.opts.model);
+ this._sessionid = this.opts.sessionid || "";
+
this._configuration = new this.opts.BasicStateSet();
this._historyValue = {};
this._innerEventQueue = [];
@@ -93,7 +95,8 @@ SCXMLInterpreter.prototype = {
this.opts.origin,
this.isIn.bind(this),
actionCodeRequire,
- pm.platform.parseDocumentFromString);
+ pm.platform.parseDocumentFromString,
+ this._sessionid);
this._actions = tmp.actions;
this._datamodel = tmp.datamodel;
@@ -246,7 +246,7 @@ function makeTopLevelFunctionBody(datamodelDeclaration,topLevelScripts,datamodel
}
function wrapTopLevelFunctionBodyInDeclaration(fnBody){
- return "function($log,$cancel,$send,$origin,In,require,$parseXml){\n" + fnBody + "\n}";
+ return "function($log,$cancel,$send,$origin,In,require,$parseXml,_sessionid){\n" + fnBody + "\n}";
}
//this function ensures that the code in each SCXML document will run in "document scope".

0 comments on commit 0fd81a8

Please sign in to comment.