Changeset 159323 in webkit
- Timestamp:
- Nov 14, 2013 4:55:45 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r159317 r159323 1 2013-11-14 Victor Costan <costan@gmail.com> 2 3 Clean up sequence handling in Blob constructor 4 https://bugs.webkit.org/show_bug.cgi?id=124343 5 6 Reviewed by Alexey Proskuryakov. 7 8 * fast/files/blob-constructor-expected.txt: 9 * fast/files/script-tests/blob-constructor.js: 10 Add test with sequence that throws an error on property access. 11 (get Object): 12 1 13 2013-11-14 Tim Horton <timothy_horton@apple.com> 2 14 -
trunk/LayoutTests/fast/files/blob-constructor-expected.txt
r159275 r159323 79 79 PASS new Blob({length: 1, 0: 'string'}, {type: 'text/html'}).type is 'text/html' 80 80 PASS new Blob({length: 0}, {endings:'illegal'}) threw exception TypeError: The endings property must be either "transparent" or "native". 81 PASS new Blob(throwingSequence) threw exception Error: Misbehaving property. 81 82 PASS successfullyParsed is true 82 83 -
trunk/LayoutTests/fast/files/script-tests/blob-constructor.js
r159275 r159323 107 107 shouldBe("new Blob({length: 1, 0: 'string'}, {type: 'text/html'}).type", "'text/html'"); 108 108 shouldThrow("new Blob({length: 0}, {endings:'illegal'})", "'TypeError: The endings property must be either \"transparent\" or \"native\"'"); 109 110 // Test passing blog parts in a sequence-like object that throws on property access. 111 var throwingSequence = {length: 4, 0: 'hello', 3: 'world'}; 112 Object.defineProperty(throwingSequence, "1", { 113 get: function() { throw new Error("Misbehaving property"); }, 114 enumerable: true, configurable: true 115 }); 116 Object.defineProperty(throwingSequence, "2", { 117 get: function() { throw new Error("This should not be thrown"); }, 118 enumerable: true, configurable: true 119 }); 120 shouldThrow("new Blob(throwingSequence)", "'Error: Misbehaving property'"); -
trunk/Source/WebCore/ChangeLog
r159321 r159323 1 2013-11-14 Victor Costan <costan@gmail.com> 2 3 Clean up sequence handling in Blob constructor 4 https://bugs.webkit.org/show_bug.cgi?id=124343 5 6 Reviewed by Alexey Proskuryakov. 7 8 Added test case to LayoutTests/fast/files/blob-constructor.html 9 10 * bindings/js/JSBlobCustom.cpp: 11 (WebCore::JSBlobConstructor::constructJSBlob): 12 Handle exceptions in sequences, eliminate double type-checking for 13 ArrayBuffer, ArrayBufferView and Blob parts. 14 1 15 2013-11-14 Oliver Hunt <oliver@apple.com> 2 16 -
trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp
r159275 r159323 115 115 for (unsigned i = 0; i < blobPartsLength; ++i) { 116 116 JSValue item = blobParts->get(exec, i); 117 if (exec->hadException()) 118 return JSValue::encode(jsUndefined()); 119 117 120 #if ENABLE(BLOB) 118 if ( item.inherits(JSArrayBuffer::info()))119 blobBuilder.append( toArrayBuffer(item));120 else if ( item.inherits(JSArrayBufferView::info()))121 blobBuilder.append( toArrayBufferView(item));121 if (ArrayBuffer* arrayBuffer = toArrayBuffer(item)) 122 blobBuilder.append(arrayBuffer); 123 else if (RefPtr<ArrayBufferView> arrayBufferView = toArrayBufferView(item)) 124 blobBuilder.append(arrayBufferView.release()); 122 125 else 123 126 #endif 124 if ( item.inherits(JSBlob::info()))125 blobBuilder.append( toBlob(item));127 if (Blob* blob = toBlob(item)) 128 blobBuilder.append(blob); 126 129 else { 127 130 String string = item.toString(exec)->value(exec);
Note: See TracChangeset
for help on using the changeset viewer.