WebCore: Fixes part of <webkit.org/b/30412>.
Web Inspector should get human readable DOM Exceptions.
Reviewed by Darin Adler.
Add a description field to ExceptionBase, and call it through
reportException which allows the user/developer to get a more detailed
and coherent error explanation through the Web Inspector.
This only applies to exceptions that come from a script on the page when
it is run. DOM Exceptions that come from the code run in the console, or DOM
exceptions that are caught and logged will come in a future patch.
Tests: inspector/uncaught-dom1-exception.html
inspector/uncaught-dom3-exception.html
inspector/uncaught-dom8-exception.html
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
* bindings/js/JSExceptionBase.cpp: Added.
(WebCore::toExceptionBase):
* bindings/js/JSExceptionBase.h: Added.
* dom/ExceptionBase.cpp:
(WebCore::ExceptionBase::ExceptionBase):
* dom/ExceptionBase.h:
(WebCore::ExceptionBase::description):
* dom/ExceptionCode.cpp:
(WebCore::):
(WebCore::getExceptionCodeDescription):
* dom/ExceptionCode.h:
LayoutTests: Fixes part of <http://webkit.org/b/30412>.
Web Inspector should get human readable DOM Exceptions.
Reviewed by Darin Adler.
Adds tests for output of uncaught exceptions to the Web Inspector
Console. Tests DOM exceptions 1, 3, and 8 (INDEX_SIZE_ERR, NOT_FOUND_ERR, and
HIERARCHY_REQUEST_ERR).
* inspector/uncaught-dom1-exception-expected.txt: Added.
* inspector/uncaught-dom1-exception.html: Added.
* inspector/uncaught-dom3-exception-expected.txt: Added.
* inspector/uncaught-dom3-exception.html: Added.
* inspector/uncaught-dom8-exception-expected.txt: Added.
* inspector/uncaught-dom8-exception.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49723 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed: