[Streams API] Error storage should be moved from source to stream/reader
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Mar 2015 15:23:24 +0000 (15:23 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Mar 2015 15:23:24 +0000 (15:23 +0000)
commitd4013a7622780d7562e02befc035a5950a92a696
tree4874f3d0a6346ef194dfc20f3915a4215b4e3e4f
parentd40cb4bf33acaf24fe2c26ceb05d1ad95b59d2a8
[Streams API] Error storage should be moved from source to stream/reader
https://bugs.webkit.org/show_bug.cgi?id=143048

Reviewed by Benjamin Poulain.

This patch removes error storage from the source as it should be stored at the stream level as error access goes through the reader.
It removes abstract ReadableStreamSource::isErrored and the storage of JavaScript errors from ReadableStreamJSSource.

Existing tests cover most of the changes.
Added test case for creating readable stream from empty JS object.

* Modules/streams/ReadableStreamSource.h: Removing isErrored().
* bindings/js/JSReadableStreamCustom.cpp:
(WebCore::constructJSReadableStream): Added JS stream constructor parameters checking.
* bindings/js/ReadableStreamJSSource.cpp:
(WebCore::ReadableStreamJSSource::ReadableStreamJSSource): Removed JS stream constructor parameters checking.
(WebCore::ReadableStreamJSSource::start): Changed prototype of start so that start can throw errors directly.
(WebCore::ReadableStreamJSSource::setInternalError): Deleted.
* bindings/js/ReadableStreamJSSource.h: Removed m_error, setInternalError and updated start declaration.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/streams/readablestream-constructor-expected.txt
LayoutTests/streams/readablestream-constructor.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/streams/ReadableStreamSource.h
Source/WebCore/bindings/js/JSReadableStreamCustom.cpp
Source/WebCore/bindings/js/ReadableStreamJSSource.cpp
Source/WebCore/bindings/js/ReadableStreamJSSource.h