On 2015/02/23 15:09:28, caitp wrote:
On 2015/02/23 15:06:53, arv wrote:
>
https://codereview.chromium.org/938443002/diff/40001/test/mjsunit/harmony/spread-call.js
> File test/mjsunit/harmony/spread-call.js (right):
>
>
https://codereview.chromium.org/938443002/diff/40001/test/mjsunit/harmony/spread-call.js#newcode3
> test/mjsunit/harmony/spread-call.js:3: // found in the LICENSE file.
> On 2015/02/23 14:46:49, caitp wrote:
> > On 2015/02/18 19:41:25, Michael Starzinger wrote:
> > > What is the expected evaluation order of the following snippet? Is
it
> "ABCXY"
> > or
> > > "ABXYC"? And can we have tests for it?
> > >
> > > function* gen() { print('X'); yield 0; print('Y'); }
> > >
> > > function a() { print('A'); }
> > > function b() { print('B'); return gen(); }
> > > function b() { print('C'); }
> > > foo(a(), ...(b()), c());
> >
> > This is a good test. I think `foo()` would be called with
`[undefined, 0,
> > undefined]`, and "ABXYC" should be printed. But interestingly, that's
not
what
> > happens (we get the expected arguments, but "ABCXY" is logged)
> >
> > That is the behaviour in FF nightly, based on
http://jsfiddle.net/beumfrrm/
> > foo() would be called with arguments `[undefined, 0, undefined]`, and
"ABXYC"
> is
> > printed. At least I think that's right :> adding test.
> >
> > Adding the test and investigating that
>
> The spec is clear on this (this one is easier than usual).
>
>
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-argument-lists-runtime-semantics-argumentlistevaluation
>
> The correct behavior is
>
> ABXYC and [undefinded, 0, undefined]
What I mean is, investigating why this isn't what actually happens. The
spead
runtime method might be interfering with the normal rules for resuming
generators
whew, tried some things, eagerly iterating works (thanks Erik), also
simplified
harmony-spread a bit.
Some changes:
- Runtime_Apply optionally takes 3 or 5 arguments (adding the offset/argc
arguments made things more complicated). Should there be 2 different
versions of
the function instead?
- Runtime_Apply will check if function is callable, and throw an error if
not.
Otherwise we were getting illegal instruction errors rather than a more
sensible
type error which explains the problem.
https://codereview.chromium.org/938443002/
--
--
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.