https://codereview.chromium.org/1148513002/diff/1/src/harmony-typedarray.js
File src/harmony-typedarray.js (right):
https://codereview.chromium.org/1148513002/diff/1/src/harmony-typedarray.js#newcode94
src/harmony-typedarray.js:94: function TypedArrayComparefn(x, y) {
This is OK for now but I think we might want to inline this.
https://codereview.chromium.org/1148513002/diff/1/src/harmony-typedarray.js#newcode97
src/harmony-typedarray.js:97: } else if ($isNaN(x)) {
no else after return
The order can be changed to reduce the number of tests:
if ($isNaN(x)) {
return $isNaN(y) ? 0 : 1;
}
if ($isNaN(y)) {
return -1;
}
https://codereview.chromium.org/1148513002/diff/1/src/harmony-typedarray.js#newcode102
src/harmony-typedarray.js:102: return -1;
Do we care about -1? Generally this just has to be a negative number
which allows us to do:
return x - y;
https://codereview.chromium.org/1148513002/diff/1/src/harmony-typedarray.js#newcode108
src/harmony-typedarray.js:108: } else if (!%_IsMinusZero(x) &&
%_IsMinusZero(y)) {
reorg to reduce test?
https://codereview.chromium.org/1148513002/diff/1/test/mjsunit/harmony/typedarray-sort.js
File test/mjsunit/harmony/typedarray-sort.js (right):
https://codereview.chromium.org/1148513002/diff/1/test/mjsunit/harmony/typedarray-sort.js#newcode26
test/mjsunit/harmony/typedarray-sort.js:26:
assertTrue(Object.is(expected[i], value[i]), "expected " + expected[i] +
" found " + value[i]);
assertSameValue should also work.
https://codereview.chromium.org/1148513002/diff/1/test/mjsunit/harmony/typedarray-sort.js#newcode38
test/mjsunit/harmony/typedarray-sort.js:38: if (constructor ==
Float32Array || constructor == Float64Array) {
===
https://codereview.chromium.org/1148513002/
--
--
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.