[Fetch API] Request constructor should provide exception messages
https://bugs.webkit.org/show_bug.cgi?id=162382
Source/WebCore:
Patch by Youenn Fablet <youenn@apple.com> on 2016-10-08
Reviewed by Darin Adler.
No change of behavior, except that exceptions now have error messages.
Added support of exception messages to ExceptionOr.
Making use of ExceptionOr for Request constructor parameter checking.
* Modules/fetch/FetchRequest.cpp:
(WebCore::setReferrerPolicy):
(WebCore::setMode):
(WebCore::setCredentials):
(WebCore::setCache):
(WebCore::setRedirect):
(WebCore::setMethod):
(WebCore::setReferrer):
(WebCore::buildOptions):
(WebCore::FetchRequest::initializeOptions):
(WebCore::FetchRequest::initializeWith):
* Modules/fetch/FetchRequest.h:
* Modules/fetch/FetchRequest.idl:
* bindings/js/JSDOMBinding.cpp:
(WebCore::setDOMException):
* bindings/js/JSDOMBinding.h:
(WebCore::toJS):
(WebCore::toJSNewlyCreated):
* dom/Exception.h:
(WebCore::Exception::code):
(WebCore::Exception::message):
(WebCore::Exception::Exception):
* dom/ExceptionOr.h:
(WebCore::ExceptionOr<ReturnType>::exceptionMessage):
LayoutTests:
Patch by Youenn Fablet <youennf@gmail.com> on 2016-10-08
Reviewed by Darin Adler.
* fetch/fetch-url-serialization-expected.txt: Rebasing test expectation.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206954
268f45cc-cd09-0410-ab3c-
d52691b4dbfc