⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 232138 in webkit


Ignore:
Timestamp:
May 23, 2018, 5:47:35 PM (8 years ago)
Author:
keith_miller@apple.com
Message:

Define length on CoW array should properly convert to writable
​https://bugs.webkit.org/show_bug.cgi?id=185927

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/cow-define-length-as-value.js: Added.

(test):

Source/JavaScriptCore:

  • runtime/JSArray.cpp:

(JSC::JSArray::setLength):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r232122 r232138  
     12018-05-23  Keith Miller  <keith_miller@apple.com>
     2
     3        Define length on CoW array should properly convert to writable
     4        https://bugs.webkit.org/show_bug.cgi?id=185927
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * stress/cow-define-length-as-value.js: Added.
     9        (test):
     10
    1112018-05-23  Michael Saboff  <msaboff@apple.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r232134 r232138  
     12018-05-23  Keith Miller  <keith_miller@apple.com>
     2
     3        Define length on CoW array should properly convert to writable
     4        https://bugs.webkit.org/show_bug.cgi?id=185927
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * runtime/JSArray.cpp:
     9        (JSC::JSArray::setLength):
     10
    1112018-05-23  Keith Miller  <keith_miller@apple.com>
    212
  • trunk/Source/JavaScriptCore/runtime/JSArray.cpp

    r232070 r232138  
    569569
    570570    Butterfly* butterfly = this->butterfly();
    571     switch (indexingType()) {
     571    switch (indexingMode()) {
    572572    case ArrayClass:
    573573        if (!newLength)
    … …  
    581581        createInitialUndecided(vm, newLength);
    582582        return true;
     583
     584    case CopyOnWriteArrayWithInt32:
     585    case CopyOnWriteArrayWithDouble:
     586    case CopyOnWriteArrayWithContiguous:
     587        if (newLength == butterfly->publicLength())
     588            return true;
     589        convertFromCopyOnWrite(vm);
     590        butterfly = this->butterfly();
     591        FALLTHROUGH;
    583592
    584593    case ArrayWithUndecided:
Note: See TracChangeset for help on using the changeset viewer.