More fun with undefined

Andreas Rossberg rossberg at google.com
Fri Jun 15 00:09:03 PDT 2012


On 15 June 2012 01:22, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
> A wonder if this wart is hairy enough, that we wouldn't be justified in some
> explicit backwards compatibility hackery in the spec. to remove it.
>
> For example, we could allow it to appear in parameter lists and provide a
> dynamic check to ensure that nothing (other than a real undefined) is
> passed.  Similarly we could explicitly allow:
>       var undefined;

Actually, for very much the same effect, you could simply treat
'undefined' as a (refutable) _pattern_ that is only matched by the
undefined value. No need to make special rules for var or parameters
then.

/Andreas


More information about the es-discuss mailing list