- From: David Junger <tffy@free.fr>
- Date: Wed, 3 Apr 2013 19:14:14 +0200
- To: "VBWG Public (www-voice@w3.org)" <www-voice@w3.org>
Le 3 apr 2013 à 16:33, Jim Barnett a écrit : > That's a good question. I'm no expert on JavaScript, however if you are using the SCXML Event I/O Processor, you can do whatever you want since its implementation is platform-specific. Yeah, I can do whatever I want, as long as I don't just pass references, right? ;) I can't recall if the SCXML draft requires lossless data transmission (either over basichttp or scxml) but it is certainly nice to have that, and if you don't have that, as an author, it's nice to know what you do have. Saying nothing means that reading the SCXML spec won't tell you how to actually use the SCXML event I/O processor with the ECMAScript datamodel. Well, it's possible to almost fully serialize a JavaScript object (closure variables won't be there) but it's neither standard nor safe. There is, however, a 'structured clone' algorithm described in the HTML living standard and already implemented in a few browsers, that is more powerful than JSON but quite safe. It's still limited but at least you can have cyclic references, and some useful values like RegExes. http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#structured-clone It's worth noting that this algorithm is now used for passing DOM event data between Web pages that aren't allowed to share references, and to/from Web Workers (which run in a separate thread and so are unable to share references). I think if it's good enough for HTML, it should be good enough for us. > It's worth some thought whether we need to say anything about serialization when using the Basic HTTP Event I/O Processor. However even if we specified something for it, the spec still wouldn't say anything about how to pass data with the SCXML event i/o processor because you're not expected to interoperate with anyone else's implementation using it. That's a shame. But since I'm not implementing basichttp, I can let you guys live with that :p David
Received on Wednesday, 3 April 2013 17:14:42 UTC