Changeset 203952 in webkit
- Timestamp:
- Jul 30, 2016 6:08:37 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r203950 r203952 1 2016-07-30 Mark Lam <mark.lam@apple.com> 2 3 Assertion failure while setting the length of an ArrayClass array. 4 https://bugs.webkit.org/show_bug.cgi?id=160381 5 <rdar://problem/27328703> 6 7 Reviewed by Filip Pizlo. 8 9 Test that RuntimeArrays will throw an error if we try to set its length. 10 11 * platform/mac/fast/dom/wrapper-classes-objc.html: 12 * platform/mac/fast/dom/wrapper-classes-objc-expected.txt: 13 1 14 2016-07-30 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/LayoutTests/platform/mac/fast/dom/wrapper-classes-objc-expected.txt
r203535 r203952 192 192 PASS objCObjectOfClass('NSArray') instanceof Array is true 193 193 PASS concatenateArray(objCArrayOfString()) is 'onetwothree' 194 PASS let arr = objCArrayOfString(); arr.length is 3 195 PASS let arr = objCArrayOfString(); arr.length = 0 threw exception RangeError: Range error. 196 PASS let arr = objCArrayOfString(); arr.length = 5 threw exception RangeError: Range error. 197 PASS let arr = objCArrayOfString(); arr.length = 0x40000000 threw exception RangeError: Range error. 198 PASS let arr = objCArrayOfString(); try { arr.length = 0 } catch(e) { } arr.length is 3 194 199 -
trunk/LayoutTests/platform/mac/fast/dom/wrapper-classes-objc.html
r203535 r203952 291 291 shouldBe("concatenateArray(objCArrayOfString())", "'onetwothree'"); 292 292 293 shouldBe("let arr = objCArrayOfString(); arr.length", "3"); 294 shouldThrow("let arr = objCArrayOfString(); arr.length = 0"); 295 shouldThrow("let arr = objCArrayOfString(); arr.length = 5"); 296 shouldThrow("let arr = objCArrayOfString(); arr.length = 0x40000000"); 297 shouldBe("let arr = objCArrayOfString(); try { arr.length = 0 } catch(e) { } arr.length", "3"); 298 293 299 // Not yet tested: 294 300 -
trunk/Source/JavaScriptCore/ChangeLog
r203937 r203952 1 2016-07-30 Mark Lam <mark.lam@apple.com> 2 3 Assertion failure while setting the length of an ArrayClass array. 4 https://bugs.webkit.org/show_bug.cgi?id=160381 5 <rdar://problem/27328703> 6 7 Reviewed by Filip Pizlo. 8 9 When setting large length values, we're currently treating ArrayClass as a 10 ContiguousIndexingType array. This results in an assertion failure. This is 11 now fixed. 12 13 There are currently only 2 places where we create arrays with indexing type 14 ArrayClass: ArrayPrototype and RuntimeArray. The fix in JSArray:;setLength() 15 takes care of ArrayPrototype. 16 17 RuntimeArray already checks for the setting of its length property, and will 18 throw a RangeError. Hence, there's no change is needed for the RuntimeArray. 19 Instead, I added some test cases ensure that the check and throw behavior does 20 not change without notice. 21 22 * runtime/JSArray.cpp: 23 (JSC::JSArray::setLength): 24 * tests/stress/array-setLength-on-ArrayClass-with-large-length.js: Added. 25 (toString): 26 (assertEqual): 27 * tests/stress/array-setLength-on-ArrayClass-with-small-length.js: Added. 28 (toString): 29 (assertEqual): 30 1 31 2016-07-29 Keith Miller <keith_miller@apple.com> 2 32 -
trunk/Source/JavaScriptCore/runtime/JSArray.cpp
r202844 r203952 442 442 return setLengthWithArrayStorage( 443 443 exec, newLength, throwException, 444 convertContiguousToArrayStorage(exec->vm()));444 ensureArrayStorage(exec->vm())); 445 445 } 446 446 createInitialUndecided(exec->vm(), newLength);
Note: See TracChangeset
for help on using the changeset viewer.