WebCore: Fixes part of <http://webkit.org/b/30412>.
commitb7d8265443e17c3907248b11a247ff80437d5be7
authorbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Oct 2009 01:18:24 +0000 (17 01:18 +0000)
committerbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Oct 2009 01:18:24 +0000 (17 01:18 +0000)
tree0a88c46e44f00200ede7861be0bbc18b0a38d7bb
parent9021e538dc97ab000097afc87c89e5ffd9694a9f
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:
LayoutTests/ChangeLog
LayoutTests/inspector/uncaught-dom1-exception-expected.txt [new file with mode: 0644]
LayoutTests/inspector/uncaught-dom1-exception.html [new file with mode: 0644]
LayoutTests/inspector/uncaught-dom3-exception-expected.txt [new file with mode: 0644]
LayoutTests/inspector/uncaught-dom3-exception.html [new file with mode: 0644]
LayoutTests/inspector/uncaught-dom8-exception-expected.txt [new file with mode: 0644]
LayoutTests/inspector/uncaught-dom8-exception.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/WebCore.gypi
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/JSDOMBinding.cpp
WebCore/bindings/js/JSExceptionBase.cpp [new file with mode: 0644]
WebCore/bindings/js/JSExceptionBase.h [new file with mode: 0644]
WebCore/dom/ExceptionBase.cpp
WebCore/dom/ExceptionBase.h
WebCore/dom/ExceptionCode.cpp
WebCore/dom/ExceptionCode.h