UNPKG

448 BJavaScriptView Raw
1'use strict';
2var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
3
4var aTypedArray = ArrayBufferViewCore.aTypedArray;
5var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
6var $sort = [].sort;
7
8// `%TypedArray%.prototype.sort` method
9// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort
10exportTypedArrayMethod('sort', function sort(comparefn) {
11 return $sort.call(aTypedArray(this), comparefn);
12});