Fix a number of problems with destructuring of arguments
https://bugs.webkit.org/show_bug.cgi?id=123357

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

This renames the destructuring node's emitBytecode to bindValue
in order to remove the existing confusion over what was happening.

We then fix an incorrect fall through in the destructuring arguments
logic, and fix the then exposed bug where we placed the index rather
than value into the bound property.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
* bytecompiler/NodesCodegen.cpp:
(JSC::ForInNode::emitBytecode):
(JSC::ForOfNode::emitBytecode):
(JSC::DeconstructingAssignmentNode::emitBytecode):
(JSC::ArrayPatternNode::bindValue):
(JSC::ArrayPatternNode::emitDirectBinding):
(JSC::ObjectPatternNode::bindValue):
(JSC::BindingNode::bindValue):
* parser/Nodes.h:

LayoutTests:

Add additional testing

* js/destructuring-assignment-expected.txt:
* js/script-tests/destructuring-assignment.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158051 268f45cc-cd09-0410-ab3c-d52691b4dbfc
7 files changed