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

https://codereview.chromium.org/579973002/diff/1/src/harmony-array.js#newcode129
src/harmony-array.js:129: function ArrayContains(searchElement /*,
fromIndex */) { // length == 1
On 2014/09/18 06:26:45, Dmitry Lomov (chromium) wrote:
Needs COERCIBLE check. (No strong preference on how you set the length
of
function/access arguments)

There is no COERCIBLE check in the spec for any of the array methods
these days. Its presence in V8 seems to be a separate bug?

https://codereview.chromium.org/579973002/diff/1/src/harmony-array.js#newcode133
src/harmony-array.js:133: if (len === 0) {
On 2014/09/18 06:26:45, Dmitry Lomov (chromium) wrote:
Do you need this check? The below will work just fine for zero length.

Yes, as otherwise we will trigger ToInteger on fromIndex, which has
observable consequences for e.g. fromIndex = { valueOf() { /* side
effects */ } }

https://codereview.chromium.org/579973002/diff/1/src/harmony-array.js#newcode139
src/harmony-array.js:139: if (n >= len) {
On 2014/09/18 06:26:45, Dmitry Lomov (chromium) wrote:
Do you need this check? 'while' below has a check already.

Removed, tests still pass.

https://codereview.chromium.org/579973002/diff/1/src/harmony-array.js#newcode147
src/harmony-array.js:147: k = len - MathAbs(n);
On 2014/09/18 06:26:45, Dmitry Lomov (chromium) wrote:
Simply len + n?

Weird, I wonder why the spec used abs for indexOf (which I copied).
Fixing.

https://codereview.chromium.org/579973002/diff/1/src/harmony-array.js#newcode155
src/harmony-array.js:155: if (SameValueZero(searchElement, elementK) ===
true) {
On 2014/09/18 06:26:45, Dmitry Lomov (chromium) wrote:
=== true? Why not "if (SameValueZero(...))"

Just going for spec-verbatimness. Will change.

https://codereview.chromium.org/579973002/

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