Clarification regarding SISR Recommendation

Hello voice,

I have a few questions/remarks concerning the last version (W3C Recommendation
5 April 2007) of the W3C SISR standard, more precisely foscused on serialization,
both ECMA and EMMA.

I will concentrate on the "easy" part in this mail: ECMA serialization.


First, I noticed a typo that had me puzzled for a while before I understood:
The drink and pizza example in ECMA format presented in 7.1 is incorrect
(as opposed to the same example reproduced in 8.1): It lacks a comma (",")
between "pepperoni" and "mushrooms".
Since I was focused on section 7, I didn't understand what the rationale was for
serializing SISR results in ECMA format...

As it happens, I think the rationale is that this serialization uses the exact
syntax of ECMA's literals. I assume that it's because it's such a "natural" choice
that it is not even mentionned in the standard.
Am I right?

In any case, in such a normative document as SISR is, I think this should be
written down, even if it seems obvious to most readers.


Now, while perusing chapter 7, I stumbled upon item 5 in section 7.1, concerning
arrays:
"Any other properties of an Array object, for instance the keys of an associative
array (e.g. a["prop"]), are subject to the same transformation rules as the
regular properties of an object. In a sparse array, only those elements which
hold defined values will be serialized."

Though this text describes the EMMA serialization, it clearly has implication on
EMMA serialization as well: Indeed, it asserts as perfectly acceptable that an
array object can have non integer properties in addition to "regular" index
properties.
The question is then how do you ECMA-serialize an array object having, in addition
to index properties, non integer properties?

>From what I understand of ECMA-262 (which is little...) the following fragment:
**   v1=new Array; v1.push("A"); v1[3]="B"; $.v1=v1;
should yield the following ECMA serialization: 
**   {v1:["A",,,"B"]}
So would the equivalent ECMA fragment using the literal syntax:
**   v1=["A",,,"B"]; $.v1=v1;

This is (hopefully) straightforward.

But then, what would the following fragment yield?
**   v1=new Array; v1.push("A"); v1[3]="B"; v1["prop"]="C"; $.v1=v1;

>From my (short, but nevertheless painful) search in ECMA reference document, I
was not able to find how you can specify literally an ECMA array with additional
non integer properties.

Anyone could help here?
I'm conscious that this question is more a question for an ECMA mailing list, but
I dare posting it here anyway.
I think SISR document would be more self-contained if a number of examples of ECMA
serializations were presented as illustrative (they obviously cannot be normative).


Comments anyone?

--Serge Le Huitouze


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.14.6/1060 - Release Date: 09/10/2007 16:43
 

Received on Wednesday, 10 October 2007 12:59:09 UTC