On Mon, Jun 28, 2010 at 7:51 AM, Jacob Beard <jbea...@cs.mcgill.ca> wrote: > Hi, > > Another question I had recently was about the specification of the > script module. In ecmascript, the "this" object can change, and a > developer must be careful to keep track of what "this" is bound to. > From reading the SCXML specification, I'm not clear what the "this" > object should be bound to inside of a <script> tag for the ecmascript > profile. <snip/>
Right, I don't think it is specified. > It seems to me that the most intuitive thing would be to bind > it to the executing statechart object, but I wanted to see if this was > actually stated somewhere in the SCXML specification. > <snap/> Or to the variable context / datamodel of the statechart. Thereby, if I have two <data> elements with ids "foo" and "bar", then the expression "this.foo" would return the value in the appropriate <data>. This would also prevent accidental overwriting and/or shadowing in the script. The script needn't have access to all other functions on the statechart object (easier to use incorrectly). -Rahul > Please let me know what you think about this. Thanks, > > Jake > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org