Re: empty fields in SCXML events.

I'd like to add that _event.data might also be a string:

./test179.scxml:  <transition event="event1" cond="_event.data === '123'" target="pass"/>
./test294.scxml:   <transition event="done.state.s1" cond="_event.data === 'foo'" target="pass">
./test527.scxml:   <transition event="done.state.s0" cond="_event.data === 'foo'" target="pass">
./test529.scxml:   <transition event="done.state.s0" cond="_event.data === '21'" target="pass">
./test562.scxml:  <transition event="foo" cond="_event.data == 'this is a string'" target="pass"/>

Best regards
  Stefan

On Apr 5, 2013, at 5:53 PM, David Junger <tffy@free.fr<mailto:tffy@free.fr>> wrote:

Le 5 apr 2013 à 16:46, Jim Barnett a écrit :

The spec defines a set of standard fields in events, such as sendid, etc., and then defines conditions under which they should be left ‘emtpy’.  In the ECMAScript data model, we say that “name,type, sendid, origin, origintype, and invokeid are String values, while data is an Object value.”   So what should their values be when they are left ‘empty’?

String -> "", obviously
Object -> null or {}

The question for Object is what you want to get if you evaluate it as a condition. null is a falsy value, while {} converts to true. But {} is more of an "empty object" than null so I like it better.

David

Received on Friday, 5 April 2013 16:57:14 UTC