https://codereview.chromium.org/553413002/diff/40001/src/array.js
File src/array.js (right):

https://codereview.chromium.org/553413002/diff/40001/src/array.js#newcode1413
src/array.js:1413: var element = array[i];
On 2014/09/23 18:39:01, wingo wrote:
what happened to the ToObject that was here in the previous patch?

I think it doesn't apply in this case or at least I couldn't code a test
case.

receiver is initialized from callback, and callback must be a function.
So, it's not possible that receiver will be a primitive value.

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

https://codereview.chromium.org/553413002/diff/40001/src/harmony-array.js#newcode14
src/harmony-array.js:14: function ArrayFind(predicate /* receiver */) {
// length == 1
On 2014/09/23 18:39:01, wingo wrote:
So in the last patch I wanted to avoid new_thisArg (mixed underscores
and
camelcase).  I suggested a fix to replace new_thisArg by receiver,
though
perhaps it was unclear.  Now in this patch you changed the thisArg
name to
receiver, which probably isn't the right thing, as the spec calls it
thisArg.
Please change it back; the only thing that really needs renaming was
your
new_thisArg.  You could call it receiver or newThisArg or anything
that keeps
the style :)

OK, understood.

It's worth noticing that array functions 'filter', 'forEach', 'map',
'same' and 'every', call this parameter 'receiver' although the spec
also names it 'thisArg'. Maybe at some point is worth to do a
refactoring and use the same name for all functions. For the moment I
agree with not changing the name of this parameter.

https://codereview.chromium.org/553413002/diff/40001/test/mjsunit/array-iteration.js
File test/mjsunit/array-iteration.js (right):

https://codereview.chromium.org/553413002/diff/40001/test/mjsunit/array-iteration.js#newcode71
test/mjsunit/array-iteration.js:71: // When evaluating 'this', primitive
values should be coerced to an object.
On 2014/09/23 18:39:01, wingo wrote:
previous comment was more correct -- the wrapper happens when
determining the
receiver for the function call, not when evaluating this within the
function.

Acknowledged.

https://codereview.chromium.org/553413002/

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