window.onerror doesn't work with inline (attribute) scripts
authoryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Oct 2011 22:03:22 +0000 (22:03 +0000)
committeryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Oct 2011 22:03:22 +0000 (22:03 +0000)
commit28c82ad14148a0fef1b1c8d8d964e66eefdd5d93
treee314afe26c33dcf007d51c0da6162f6cdf7071df
parentf8da692649e9fbc2d222a48eda9bb9d62f49a590
window.onerror doesn't work with inline (attribute) scripts
https://bugs.webkit.org/show_bug.cgi?id=70991

Source/WebCore:

Uncaught syntax errors in inline event handlers are now reported to
window.onerror handler.

Reviewed by Geoffrey Garen.

Tests: fast/events/window-onerror-exception-in-attr.html
       fast/events/window-onerror-syntax-error-in-attr.html

* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction): report exception as usual
if it happens during event handler compilation.

LayoutTests:

Added a couple of window.onerror tests for the cases when uncaught exception
occurs in inline event handler. Test for non-syntax errors passed before this change
as well and just extends test coverage for window.onerror functionality.

Reviewed by Geoffrey Garen.

* fast/events/window-onerror-exception-in-attr-expected.txt: Added.
* fast/events/window-onerror-exception-in-attr.html: Added.
* fast/events/window-onerror-syntax-error-in-attr-expected.txt: Added.
* fast/events/window-onerror-syntax-error-in-attr.html: Added.
* platform/chromium/fast/events/window-onerror-exception-in-attr-expected.txt: Added.
* platform/chromium/fast/events/window-onerror-syntax-error-in-attr-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@98885 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/window-onerror-exception-in-attr-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/window-onerror-exception-in-attr.html [new file with mode: 0644]
LayoutTests/fast/events/window-onerror-syntax-error-in-attr-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/window-onerror-syntax-error-in-attr.html [new file with mode: 0644]
LayoutTests/platform/chromium/fast/events/window-onerror-exception-in-attr-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/fast/events/window-onerror-syntax-error-in-attr-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSLazyEventListener.cpp