Addressed comments + do not allocate a literal index for Spread.

PTAL


https://codereview.chromium.org/1151503002/diff/1/src/ast.h
File src/ast.h (right):

https://codereview.chromium.org/1151503002/diff/1/src/ast.h#newcode2224
src/ast.h:2224: // Literal index is only used when Spread is
renterpreted as a pattern.
On 2015/05/20 12:57:35, rossberg wrote:
Nit: typo

Undid this change.

https://codereview.chromium.org/1151503002/diff/1/src/preparser.h
File src/preparser.h (right):

https://codereview.chromium.org/1151503002/diff/1/src/preparser.h#newcode2518
src/preparser.h:2518: int literal_index =
function_state_->NextMaterializedLiteralIndex();
On 2015/05/20 14:07:19, Dmitry Lomov (chromium) wrote:
On 2015/05/20 13:52:25, arv wrote:
> Is this going to be a problem in the case of array spread?

I don't think so - we will just have an unused literal index.

Scratch that - I have One Weird Trick in mind here ;)

https://codereview.chromium.org/1151503002/diff/1/src/runtime.js
File src/runtime.js (right):

https://codereview.chromium.org/1151503002/diff/1/src/runtime.js#newcode732
src/runtime.js:732:
On 2015/05/20 13:34:14, arv wrote:
undo this line removal... (it was probably from when you moved my
function)

Done.

https://codereview.chromium.org/1151503002/diff/1/src/runtime.js#newcode932
src/runtime.js:932: function SpreadIntoArray(target, iterable) {
On 2015/05/20 13:49:39, rossberg wrote:
On 2015/05/20 13:34:14, arv wrote:
> On 2015/05/20 12:57:35, rossberg wrote:
> > Nit: ConcatIterableToArray
>
> It is not to array... it adds it to an existing array. This is from
my array
> spread CL where we need to add the elements to an existing array.

Hence Concat...ToArray ;)

> For the rest destructuring we could skip passing an array and return
a new
> array. The only question is if we want to reuse this code or not?

It's good, as long as there is a simple way to make the array strong
in strong
mode.

Done.

https://codereview.chromium.org/1151503002/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to