Destructuring object outside of var declaration

Allen Wirfs-Brock allen at wirfs-brock.com
Sun Nov 13 19:45:21 UTC 2016


> On Nov 13, 2016, at 10:49 AM, Isiah Meadows <isiahmeadows at gmail.com> wrote:
> 
> Firefox likely has a parser bug (it should never throw a ReferenceError in that situation).
> 
> 
FireFox is correct, Chrome is wrong. See the second early error rule at http://www.ecma-international.org/ecma-262/7.0/index.html#sec-assignment-operators-static-semantics-early-errors <http://www.ecma-international.org/ecma-262/7.0/index.html#sec-assignment-operators-static-semantics-early-errors> 


It is an early Reference <http://www.ecma-international.org/ecma-262/7.0/index.html#sec-reference-specification-type> Error if LeftHandSideExpression <http://www.ecma-international.org/ecma-262/7.0/index.html#prod-LeftHandSideExpression> is neither an ObjectLiteral <http://www.ecma-international.org/ecma-262/7.0/index.html#prod-ObjectLiteral> nor an ArrayLiteral <http://www.ecma-international.org/ecma-262/7.0/index.html#prod-ArrayLiteral> and IsValidSimpleAssignmentTarget of LeftHandSideExpression <http://www.ecma-international.org/ecma-262/7.0/index.html#prod-LeftHandSideExpression> is false.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20161113/8b9f953d/attachment.html>


More information about the es-discuss mailing list