W3C home > Mailing lists > Public > www-style@w3.org > August 2012

Re: [css-regions] Invalid access in NamedFlowCollection

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 29 Aug 2012 12:53:45 -0400
Message-ID: <503E4919.2000305@mit.edu>
To: www-style@w3.org
On 8/29/12 12:46 PM, Mihai Balan wrote:
> Currently the spec says that should a script try to retrieve an
> inexistent object from a NamedFlowCollection, either by using an
> out-of-range index or an invalid name, it should return **null**.
> I think it would be better to return **undefined** instead, for a couple
> of reasons:
> ∑Currently all JavaScript and HTMLCollection-s return **undefined** for
> invalid keys (e.g. Array, document.forms, document.querySelectorAll() )
> ∑Also, in general, null doesnít mean that thereís nothing there, but
> actually that something might be there, but itís not a definite object (yet)
> Anyone has any thoughts on this?

Won't you get the "undefined" behavior for free if you use sane 
definitions of the supported names and indices in your prose?

I agree that the undefined behavior is better, btw: it also makes "in" 
work correctly and such.

Received on Wednesday, 29 August 2012 16:54:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:20 UTC