Closed Bug 1018453 Opened 10 years ago Closed 10 years ago

Destructuring ObjectPattern does not work in assignment

Categories

(Core :: JavaScript Engine, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: Swatinem, Unassigned)

References

(Blocks 1 open bug)

Details

As part of a VariableDeclaration, it works fine:

var {a} = {a:1}; a;
1

But not as an AssignmentExpression:

{a} = {a:1}; a;
SyntaxError: syntax error
Blocks: es6
{a} = {a: 1}; a;

is a block statement whose single kid is the expression |a|, followed by a stray = that should generate a SyntaxError (and then the rest is irrelevant).  Is there a bug at all here if the assignment is enclosed in parentheses?
Hm, right. Putting it in parentheses solves the problem. Sorry for the inconvenience.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.