Changeset 247065 in webkit


Ignore:
Timestamp:
Jul 2, 2019 11:46:42 AM (5 years ago)
Author:
keith_miller@apple.com
Message:

Frozen Arrays length assignment should throw in strict mode
https://bugs.webkit.org/show_bug.cgi?id=199365

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/frozen-array-length-should-throw-strict.js: Added.

(test):

Source/JavaScriptCore:

  • runtime/JSArray.cpp:

(JSC::JSArray::put):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r247036 r247065  
     12019-07-02  Keith Miller  <keith_miller@apple.com>
     2
     3        Frozen Arrays length assignment should throw in strict mode
     4        https://bugs.webkit.org/show_bug.cgi?id=199365
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * stress/frozen-array-length-should-throw-strict.js: Added.
     9        (test):
     10
    1112019-07-01  Justin Michaud  <justin_michaud@apple.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r247047 r247065  
     12019-07-02  Keith Miller  <keith_miller@apple.com>
     2
     3        Frozen Arrays length assignment should throw in strict mode
     4        https://bugs.webkit.org/show_bug.cgi?id=199365
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * runtime/JSArray.cpp:
     9        (JSC::JSArray::put):
     10
    1112019-07-02  Paulo Matos  <pmatos@linki.tools>
    212
  • trunk/Source/JavaScriptCore/runtime/JSArray.cpp

    r239427 r247065  
    287287
    288288    if (propertyName == vm.propertyNames->length) {
    289         if (!thisObject->isLengthWritable())
     289        if (!thisObject->isLengthWritable()) {
     290            if (slot.isStrictMode())
     291                throwTypeError(exec, scope, "Array length is not writable"_s);
    290292            return false;
     293        }
     294
    291295        unsigned newLength = value.toUInt32(exec);
    292296        RETURN_IF_EXCEPTION(scope, false);
Note: See TracChangeset for help on using the changeset viewer.