Re: [WebIDL] platform array objects

On 19/08/11 04:00, Cameron McCormack wrote:
> Thanks for your comments Andrew.
> 
> Andrew Oakley:
>> http://dev.w3.org/2006/webapi/WebIDL/#es-array:
>>> Platform array objects defy being fixed; if Object.freeze,
>>> Object.seal or Object.preventExtensions is called on one, the
>>> function MUST throw a TypeError.
>>
>> Can I ask why? I don't see any reason for this and it feels like it
>> would make implementations more complicated. (This also seems to be
>> present in the platform objects description.)
> 
> I think it makes implementations simpler -- then there is no need to
> define and handle what should happen to properties on a platform array
> object if it changes length.

I guess platform objects gaining or loosing properties when fixed would
be a little odd, so that seems reasonably sensible.

>> § 4.2.20.1 Platform array object [[GetOwnProperty]] method says that the
>> property descriptor for "length" whould have [[Configurable]] set to
>> true. Later on we try to make sure it can't be deleted (§ 4.2.20.3).
>> Would it not be easier just to make it not [[Configurable]]?
> 
> To be able to implement platform array objects with proxies, we need to
> expose configurable properties, since last I checked the Proxy proposal
> did not support exposing non-configurable properties.  If this has
> changed, then I agree we should make it non-configurable.

OK, I hadn't considered the proxy stuff.

>> The [[GetOwnProperty]] implementation also tries calling the normal
>> version of [[GetOwnProperty]] at the end of the algorithm rather than at
>> the start like Array and Arguments objects. I could agree with it being
>> either way round, but it would be nice to be consistent with the
>> ECMAScript spec.
> 
> Array objects don't have a specialised [[GetOwnProperty]] do they?
> Anyway for platform array objects, I don't think it matters too much,
> since there can never be a "real" own property named "length" or like
> one of the array index properties on an platform array object.
> 
> I think it looks cleaner as is, resolving the special properties first
> before looking at the regular properties, so I will leave it.

Like you said, it doesn't really matter.

>> Finally, we don't define what "Reject" means here (although we do define
>> it for the "platform object" algorithms.
> 
> Good point, I've added some wording before the platform array object
> algorithms that use it.
> 
> 
> http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.html.diff?r1=1.341;r2=1.342;f=h
> 
> 
> If the above resolutions are satisfactory, could you please indicate so
> for the Disposition of Comments document I will need to assemble for
> this Last Call.

Yes, everything looks OK here.  Sorry for the delay in responding.

> 
> Thanks,
> 
> Cameron


-- 
Andrew Oakley

Received on Tuesday, 23 August 2011 09:28:48 UTC