Destructuring `undefined` and `null`

Allen Wirfs-Brock allen at wirfs-brock.com
Mon Jan 19 12:07:05 PST 2015


see https://bugs.ecmascript.org/show_bug.cgi?id=3574 

already fix in my working draft

Allen

On Jan 19, 2015, at 12:01 PM, Axel Rauschmayer wrote:

> If I understand the spec correctly, destructuring works as follows:
> 
> ```js
> let {} = undefined; // OK???
> let {x} = undefined; // TypeError
> 
> let [] = undefined; // TypeError
> let [y] = undefined; // TypeError
> ```
> 
> Destructuring `undefined` (or `null`) via `{}` does not throw an exception (as per first rule inside [1]). Shouldn’t it throw one?
> 
> Thanks!
> 
> Axel
> 
> 
> [1] https://people.mozilla.org/~jorendorff/es6-draft.html#sec-runtime-semantics-destructuringassignmentevaluation
> 
> -- 
> Dr. Axel Rauschmayer
> axel at rauschma.de
> rauschma.de
> 
> 
> 
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150119/3949e23e/attachment.html>


More information about the es-discuss mailing list