Using destructuring for function arguments

Nicholas C. Zakas standards at
Tue Jun 3 10:34:02 PDT 2014

On 5/31/2014 1:54 PM, Allen Wirfs-Brock wrote:
>> What happens here is that none of `secure`, `path`, `domain`, 
>> `expires` are defined. I can use `typeof` on them to protect against 
>> this, but then I end up with some lousy looking code:
> not really, the thrown exception while processing the arguments should 
> terminate the function and you should never start executing the 
> function body 

This sounds like there's  a second error in the Firefox implementation. 
If an error should be thrown when the destructured argument is omitted, 
then Firefox is incorrectly continuing to execute the function body.

Am I reading this correctly?

Nicholas C. Zakas

More information about the es-discuss mailing list