Changeset 207204 in webkit
- Timestamp:
- Oct 12, 2016 1:41:25 AM (8 years ago)
- Location:
- branches/safari-602-branch
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-602-branch/JSTests/ChangeLog
r207202 r207204 1 2016-10-12 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r204868. rdar://problem/28216263 4 5 2016-08-23 Keith Miller <keith_miller@apple.com> 6 7 %TypedArray%.prototype.slice needs to check that the source and destination have not been detached. 8 https://bugs.webkit.org/show_bug.cgi?id=161031 9 <rdar://problem/27937019> 10 11 Reviewed by Geoffrey Garen. 12 13 * stress/typedarray-slice.js: 14 (get let): 15 (get try): 16 (testSpeciesWithTransferring): 17 1 18 2016-10-12 Matthew Hanson <matthew_hanson@apple.com> 2 19 -
branches/safari-602-branch/JSTests/stress/typedarray-slice.js
r204434 r207204 136 136 }); 137 137 } 138 139 138 shouldBeTrue("forEachTypedArray(subclasses, testSpeciesWithSameBuffer)"); 140 139 140 function testSpeciesWithTransferring(unused, constructor) { 141 142 let array = new constructor(10); 143 Object.defineProperty(constructor, Symbol.species, { get() { 144 transferArrayBuffer(array.buffer); 145 return undefined; 146 }, configurable: true }); 147 148 try { 149 array.slice(0,1); 150 return false; 151 } catch (e) { } 152 153 array = new constructor(10); 154 Object.defineProperty(constructor, Symbol.species, { get() { 155 return function(len) { 156 let a = new constructor(len); 157 transferArrayBuffer(a.buffer); 158 return a; 159 } 160 }, configurable: true }); 161 162 try { 163 array.slice(0,1); 164 return false; 165 } catch (e) { } 166 167 return true; 168 } 169 170 shouldBeTrue("forEachTypedArray(typedArrays, testSpeciesWithTransferring)"); 141 171 142 172 finishJSTest(); -
branches/safari-602-branch/Source/JavaScriptCore/ChangeLog
r207202 r207204 1 2016-10-12 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r204868. rdar://problem/28216263 4 5 2016-08-23 Keith Miller <keith_miller@apple.com> 6 7 %TypedArray%.prototype.slice needs to check that the source and destination have not been detached. 8 https://bugs.webkit.org/show_bug.cgi?id=161031 9 <rdar://problem/27937019> 10 11 Reviewed by Geoffrey Garen. 12 13 * runtime/JSGenericTypedArrayViewPrototypeFunctions.h: 14 (JSC::speciesConstruct): 15 (JSC::genericTypedArrayViewProtoFuncSlice): 16 1 17 2016-10-12 Matthew Hanson <matthew_hanson@apple.com> 2 18 -
branches/safari-602-branch/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h
r203360 r207204 70 70 return nullptr; 71 71 72 if (JSArrayBufferView* view = jsDynamicCast<JSArrayBufferView*>(result)) 73 return view; 72 if (JSArrayBufferView* view = jsDynamicCast<JSArrayBufferView*>(result)) { 73 if (!view->isNeutered()) 74 return view; 75 76 throwTypeError(exec, typedArrayBufferHasBeenDetachedErrorMessage); 77 return nullptr; 78 } 74 79 75 80 throwTypeError(exec, ASCIILiteral("species constructor did not return a TypedArray View")); … … 442 447 return JSValue::encode(JSValue()); 443 448 449 ASSERT(!result->isNeutered()); 450 if (thisObject->isNeutered()) 451 return throwVMTypeError(exec, typedArrayBufferHasBeenDetachedErrorMessage); 452 444 453 // We return early here since we don't allocate a backing store if length is 0 and memmove does not like nullptrs 445 454 if (!length)
Note: See TracChangeset
for help on using the changeset viewer.