RE: empty fields in SCXML events.

So we say that the values of empty event fields is 'Undefined'?  I don't care personally, I just want something that ECMAScript programmers will find intuitive and consistent.  I would like to use the same value for the string-valued fields and _event.data  (Looking at the ECMA spec, it seems that 'Undefined', Null, 0, NaN, and "" all evaluate to Boolean 'false'.)


-          Jim

From: David Junger [mailto:tffy@free.fr]
Sent: Friday, April 05, 2013 1:33 PM
To: Voice Public List
Subject: Re: empty fields in SCXML events.

Le 5 apr 2013 à 19:18, Jim Barnett a écrit :


So your proposal is that we say that it can be a string or an Object, and if it is "empty", its value can be anything that evaluates to 'false'?  Can we say the same thing for the string-valued slots?  It would be nice to have a consistent way of representing the absence of a value.

In the ECMAScript datamodel, type is not important. It's ECMAScript, after all! things have mixed types all the time here.

The absence of a value of any type is consistently represented by the special value (and type) 'undefined'. Which does convert to boolean false.

                                    David

Received on Friday, 5 April 2013 17:39:23 UTC