Cool. Few comments.
As this is a new unapproved feature, this needs intent-to-implement mail.
I guess this is the first time when somebody add test262 tests first and
patch
later, but I think we still want some tests in our tree (under
test/mjsunit/harmony)
Code comemnts below:
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
Needs COERCIBLE check. (No strong preference on how you set the length
of function/access arguments)
https://codereview.chromium.org/579973002/diff/1/src/harmony-array.js#newcode133
src/harmony-array.js:133: if (len === 0) {
Do you need this check? The below will work just fine for zero length.
https://codereview.chromium.org/579973002/diff/1/src/harmony-array.js#newcode139
src/harmony-array.js:139: if (n >= len) {
Do you need this check? 'while' below has a check already.
https://codereview.chromium.org/579973002/diff/1/src/harmony-array.js#newcode147
src/harmony-array.js:147: k = len - MathAbs(n);
Simply len + n?
https://codereview.chromium.org/579973002/diff/1/src/harmony-array.js#newcode155
src/harmony-array.js:155: if (SameValueZero(searchElement, elementK) ===
true) {
=== true? Why not "if (SameValueZero(...))"
https://codereview.chromium.org/579973002/diff/1/src/runtime.js
File src/runtime.js (right):
https://codereview.chromium.org/579973002/diff/1/src/runtime.js#newcode581
src/runtime.js:581: if (%_IsSmi(x) && x > 0) return x; // not >= since
-0 >= +0
if %_IsSmi(x) then x can only be +0 (-0 is not Smi). Feel free to do:
if (%_IsSmi(x)) return (x > 0 ? x : 0);
All Smis are safe
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.