https://codereview.chromium.org/1234213004/diff/1/src/parser.cc
File src/parser.cc (right):

https://codereview.chromium.org/1234213004/diff/1/src/parser.cc#newcode4383
src/parser.cc:4383: if (fvar != nullptr) {
On 2015/07/16 13:03:57, caitp wrote:
On 2015/07/16 12:53:47, rossberg wrote:
> Hm, why do you need to move (and duplicate) fvar initialisation and
IsConstruct
> assert?

it seems that these need to happen before the init block. I suppose it
could
just use `result->insertAt(0)` instead though

Not sure I understand. They were happening before the init block before,
AFAICT? Why did that need to change at all?

https://codereview.chromium.org/1234213004/diff/1/test/mjsunit/strong/destructuring.js
File test/mjsunit/strong/destructuring.js (right):

https://codereview.chromium.org/1234213004/diff/1/test/mjsunit/strong/destructuring.js#newcode10
test/mjsunit/strong/destructuring.js:10: var a = f({ x: undefined });
On 2015/07/16 13:03:57, caitp wrote:
On 2015/07/16 12:53:47, rossberg wrote:
> On 2015/07/15 20:35:44, caitp wrote:
> > this move kind of makes destructuring initializers not very good,
but maybe
> this
> > is actually intentional? Not sure.
>
> Not sure I understand. What's not good?

It's okay for the VM, but having to fill out each field is sort of
inconvenient
and hurts one of the conveniences of using destructuring in the first
place.

eg, `function f({ x = true }) { "use strong"; return x; } f({})` would
throw
because `x` does not exist in `{}` --- so it makes destructuring
initializers
sort of pointless, because you always need to be explicit.

Ah, I see. Yes, that shouldn't throw in strong mode either, defaults are
supposed to continue to work for absent properties. But that needs some
adaptation of the desugaring, which we haven't done yet.

https://codereview.chromium.org/1234213004/

--
--
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