Changeset 276612 in webkit


Ignore:
Timestamp:
Apr 26, 2021 2:03:49 PM (3 years ago)
Author:
mark.lam@apple.com
Message:

%TypedArray%.prototype.sort() should not use a regular array as a temp buffer.
https://bugs.webkit.org/show_bug.cgi?id=225062
rdar://77021547

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/typedarray-sort-should-not-use-a-regular-array-as-temp-buffer.js: Added.

Source/JavaScriptCore:

%TypedArray%.prototype.sort() should not be affected by property changes in
Array.prototype.

References:
[1] https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort
[2] https://tc39.es/ecma262/#sec-array.prototype.sort
[3] https://tc39.es/ecma262/#sec-sortcompare

  • builtins/TypedArrayPrototype.js:

(globalPrivate.typedArrayMergeSort):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r276592 r276612  
     12021-04-26  Mark Lam  <mark.lam@apple.com>
     2
     3        %TypedArray%.prototype.sort() should not use a regular array as a temp buffer.
     4        https://bugs.webkit.org/show_bug.cgi?id=225062
     5        rdar://77021547
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        * stress/typedarray-sort-should-not-use-a-regular-array-as-temp-buffer.js: Added.
     10
    1112021-04-26  Alexey Shvayka  <shvaikalesh@gmail.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r276610 r276612  
     12021-04-26  Mark Lam  <mark.lam@apple.com>
     2
     3        %TypedArray%.prototype.sort() should not use a regular array as a temp buffer.
     4        https://bugs.webkit.org/show_bug.cgi?id=225062
     5        rdar://77021547
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        %TypedArray%.prototype.sort() should not be affected by property changes in
     10        Array.prototype.
     11
     12        References:
     13        [1] https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort
     14        [2] https://tc39.es/ecma262/#sec-array.prototype.sort
     15        [3] https://tc39.es/ecma262/#sec-sortcompare
     16
     17        * builtins/TypedArrayPrototype.js:
     18        (globalPrivate.typedArrayMergeSort):
     19
    1202021-04-26  Keith Miller  <keith_miller@apple.com>
    221
  • trunk/Source/JavaScriptCore/builtins/TypedArrayPrototype.js

    r272471 r276612  
    174174    "use strict";
    175175
    176     var buffer = @newArrayWithSize(valueCount);
     176    var constructor = @typedArrayGetOriginalConstructor(array);
     177    var buffer = new constructor(valueCount);
    177178    var dst = buffer;
    178179    var src = array;
Note: See TracChangeset for help on using the changeset viewer.