Ignore:
Timestamp:
Aug 10, 2014, 1:12:01 PM (11 years ago)
Author:
[email protected]
Message:

Destructuring assignment in a var declaration list incorrectly consumes subsequent variable initialisers
https://bugs.webkit.org/show_bug.cgi?id=135773

Reviewed by Michael Saboff.

Source/JavaScriptCore:

We should be using parseAssignment expression in order to get the correct
precedence.

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parseVarDeclarationList):

LayoutTests:

Add new tests.

  • js/destructuring-assignment-expected.txt:
  • js/script-tests/destructuring-assignment.js:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/Parser.cpp

    r170774 r172381  
    485485            if (hasInitializer) {
    486486                next(TreeBuilder::DontBuildStrings); // consume '='
    487                 TreeExpression rhs = parseExpression(context);
     487                TreeExpression rhs = parseAssignmentExpression(context);
    488488                node = context.createDeconstructingAssignment(location, pattern, rhs);
    489489                lastInitializer = rhs;
Note: See TracChangeset for help on using the changeset viewer.