Implement %TypedArray%.prototype.sort
authorDaniel Ehrenberg <dehrenberg@chromium.org>
Wed, 20 May 2015 00:56:15 +0000 (17:56 -0700)
committerAdam Klein <adamk@chromium.org>
Wed, 20 May 2015 00:56:06 +0000 (00:56 +0000)
commit540bb0c80beb66578c42e71378de81b40455a83a
treed255efdd8bf2823d77e86f6f94d3d3c2f2c99bbe
parentcc74268d30074934d7a40dd8256862b45dcbf0d8
Implement %TypedArray%.prototype.sort

The sort method of TypedArrays sorts in numerical order by default.
This patch implements sorting based on Arrays and adds a test.
The length of %TypedArray%.prototype.sort, like Array.prototype.sort,
seems to be unspecified in ES6, so this patch lets it have the value
1, to match our interpretation for Array.prototype.sort (though 0
would also be a sensible length).

R=arv@chromium.org
BUG=v8:3578
LOG=Y

Review URL: https://codereview.chromium.org/1148513002

Patch from Daniel Ehrenberg <dehrenberg@chromium.org>.

Cr-Commit-Position: refs/heads/master@{#28494}
src/array.js
src/harmony-typedarray.js
test/mjsunit/harmony/typedarray-sort.js [new file with mode: 0644]