Need to pre-declare SCXML data?
Gavin Kistner <[email protected]> Tue, 15 Apr 2014 22:54:43 +0000 (GMT)
| Newsgroups | gmane.comp.web.voice |
|---|---|
| Message-ID | <[email protected]> |
Some of the tests in the SCXML test suite test to ensure that assigning to a data model value location is illegal if there did not pre-exist a <data> element declaring the location. For example, test 286. Is this a limitation of the ECMAScript data model only? I don't see anywhere in the specs that this is explicitly mentioned. In particular, Section 5.4 on <assign> says only: "Assignment to a data model is done by using a location expression to denote the part of the data model where the insertion is to be made. If the location expression does not denote a valid location in the data model […] the SCXML Processor must place the error 'error.execution' in the internal event queue.” I cannot find any other definition of what constitutes a "valid location". I assume that it is up to the data model to determine that. For my Lua-based data model, any possible value of the location attribute is a "valid location". I auto-vivify data model locations upon first value creation, be it via either <data> or <assign>. Is there a strong reason to require data model locations to be declared with <data> before later <assign>?