https://codereview.chromium.org/363833006/diff/290001/src/harmony-array.js
File src/harmony-array.js (right):

https://codereview.chromium.org/363833006/diff/290001/src/harmony-array.js#newcode143
src/harmony-array.js:143: receiver = ToObject(receiver);
On 2014/09/10 14:26:04, caitp wrote:
On 2014/09/10 07:23:55, rossberg wrote:
> Hm, is this actually necessary? Doesn't _CallFunction do it already?

Looks like Execution::Call() does this, yes --- edit, no, apparently
this does
not do the right thing, so we do actually need to set this up in the
script.
(For sloppy-mode, Execution::Call is not passing the correct global
variable
when null/undefined is used, as it looks like it should --- this
causes test
failures).

Yes. We don't want _CallFunction to have to do the extra work to do this
in general. That is why it is up to all the callers to handle it.

We could provide a helper function that does this, which would clean up
the repeated code we already have.

https://codereview.chromium.org/363833006/diff/290001/test/mjsunit/harmony/array-from.js
File test/mjsunit/harmony/array-from.js (right):

https://codereview.chromium.org/363833006/diff/290001/test/mjsunit/harmony/array-from.js#newcode111
test/mjsunit/harmony/array-from.js:111: testArrayFrom(Other, Other);
On 2014/09/10 14:32:35, rossberg wrote:
On 2014/09/10 14:26:05, caitp wrote:
> On 2014/09/10 07:23:55, rossberg wrote:
> > Cover more cases here, e.g. a function with @@iterator, a function
that is
not
> a
> > constructor. Also test what happens on primitive constructors, esp
String.
>
> Can you provide examples of functions which we would not consider
constructors?
> I think .bind() is supposed to behave this way, as well as arrow
functions ---
> but I'm not sure if they actually _do_ behave this way currently.

Yes, a test with .bind would be good. Also, most ES library functions
are not
constructors.


Anything that is lacking a .prototype. For example Math.cos or
Array.prototype.filter for example.

https://codereview.chromium.org/363833006/

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