[es6] Spread in array literals
authorarv <arv@chromium.org>
Thu, 21 May 2015 08:09:06 +0000 (01:09 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 21 May 2015 08:08:55 +0000 (08:08 +0000)
commit9502e91adbed48a546463aa848656d07619d14e6
tree453675d2ed83f83999cc1f16b8d6184452589755
parente56585077bdc3f6ce9990c86c00858c62eae790d
[es6] Spread in array literals

This allows you to put iterables into your array literals
and the will get spread into the array.

  let x = [0, ...range(1, 3)];  // [0, 1, 2]

This is done by treating the array literal up to the first
spread element as usual, including using a boiler plate
array, and then appending the remaining expressions and rest
expressions.

BUG=v8:3018
LOG=N

Review URL: https://codereview.chromium.org/1125183008

Cr-Commit-Position: refs/heads/master@{#28534}
23 files changed:
src/arm/full-codegen-arm.cc
src/arm64/full-codegen-arm64.cc
src/ast-numbering.cc
src/ast.cc
src/bailout-reason.h
src/bootstrapper.cc
src/builtins.h
src/compiler/ast-graph-builder.cc
src/flag-definitions.h
src/full-codegen.cc
src/hydrogen.cc
src/ia32/full-codegen-ia32.cc
src/mips/full-codegen-mips.cc
src/mips64/full-codegen-mips64.cc
src/parser.cc
src/preparser.h
src/runtime.js
src/runtime/runtime-object.cc
src/runtime/runtime.h
src/typing.cc
src/x64/full-codegen-x64.cc
test/cctest/test-parsing.cc
test/mjsunit/harmony/spread-array.js [new file with mode: 0644]