<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[202023] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/202023">202023</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-06-13 20:28:10 -0700 (Mon, 13 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>window.onerror should pass the ErrorEvent's 'error' property as the 5th argument to the event handler
https://bugs.webkit.org/show_bug.cgi?id=55092
&lt;rdar://problem/25731279&gt;

Patch by Joseph Pecoraro &lt;pecoraro@apple.com&gt; on 2016-06-13
Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

This includes the actual Error in window.error / ErrorEvent:
https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface

This is useful for scripts to be able to get an error stack
from uncaught exceptions, by checking the error itself.

Tests: fast/events/window-onerror17.html
       http/tests/security/cross-origin-script-error-event-redirected.html
       http/tests/security/cross-origin-script-error-event.html
       http/tests/security/script-crossorigin-error-event-information.html
       http/tests/security/script-no-crossorigin-error-event-should-be-sanitized.html
       userscripts/window-onerror-for-isolated-world-3.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Add new custom error event file.

* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
Include the JSC::Exception when reporting exceptions, so the error value is available.

* bindings/js/JSErrorEventCustom.cpp:
(WebCore::JSErrorEvent::error):
Sanitized access to the ErrorEvent's error property to prevent leaking objects
across isolated world boundaries. This is like CustomEvent's data property.

* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
* bindings/js/JSErrorHandler.h:
Include the error object as the 4th argument to the window.onerror event handler.

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::sanitizeScriptError):
(WebCore::ScriptExecutionContext::reportException):
(WebCore::ScriptExecutionContext::dispatchErrorEvent):
* dom/ScriptExecutionContext.h:
Include the error object in the ErrorEvent constructed when dispatching error events.

* dom/ErrorEvent.cpp:
(WebCore::ErrorEvent::ErrorEvent):
(WebCore::ErrorEvent::sanitizedErrorValue):
(WebCore::ErrorEvent::trySerializeError):
* dom/ErrorEvent.h:
* dom/ErrorEvent.idl:
Include an any &quot;error&quot; property on the ErrorEvent, and allow it in initialization.

* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::evaluate):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
Within the Worker world, the error is included in the event.
When re-dispatching the error on the world object in the world that spawned the
Worker the event does not include an error object. This matches other browsers
right now, but could be improved to have the same cross world serialization
as isolated worlds have with the error data.

* dom/CustomEvent.h:
Remove unimplemented stale method.

LayoutTests:

* platform/wk2/TestExpectations:
Skip new userscript test on WebKit2 like others.

* fast/events/constructors/error-event-constructor-expected.txt:
* fast/events/constructors/error-event-constructor.html:
Test for the new any &quot;error&quot; initialization property.

* fast/events/event-leak-objects-expected.txt:
* fast/events/event-leak-objects.html:
* fast/events/event-properties-gc-expected.txt:
* fast/events/event-properties-gc.html:
Like CustomEvent.details, ErrorEvent.error should not leak
objects across isolated worlds.

* fast/events/window-onerror-exception-in-attr-expected.txt:
* fast/events/window-onerror-exception-in-attr.html:
* fast/events/window-onerror-syntax-error-in-attr-expected.txt:
* fast/events/window-onerror-syntax-error-in-attr.html:
* fast/events/window-onerror1-expected.txt:
* fast/events/window-onerror1.html:
* fast/events/window-onerror10-expected.txt:
* fast/events/window-onerror10.html:
* fast/events/window-onerror11-expected.txt:
* fast/events/window-onerror11.html:
* fast/events/window-onerror12-expected.txt:
* fast/events/window-onerror12.html:
* fast/events/window-onerror13.html:
* fast/events/window-onerror14.html:
* fast/events/window-onerror16.html:
* fast/events/window-onerror17-expected.txt: Added.
* fast/events/window-onerror17.html: Copied from LayoutTests/fast/events/window-onerror12.html.
* fast/events/window-onerror2-expected.txt:
* fast/events/window-onerror2.html:
* fast/events/window-onerror3-expected.txt:
* fast/events/window-onerror3.html:
* fast/events/window-onerror4-expected.txt:
* fast/events/window-onerror4.html:
* fast/events/window-onerror5-expected.txt:
* fast/events/window-onerror5.html:
* fast/events/window-onerror6-expected.txt:
* fast/events/window-onerror6.html:
* fast/events/window-onerror7-expected.txt:
* fast/events/window-onerror7.html:
* fast/events/window-onerror8-expected.txt:
* fast/events/window-onerror8.html:
* fast/events/window-onerror9-expected.txt:
* fast/events/window-onerror9.html:
Include output for the column number and error object where possible.

* fast/files/resources/setup-for-read-common.js:
* fast/files/workers/worker-apply-blob-url-to-xhr.html:
* fast/workers/resources/worker-error-in-handling-script-error.js:
* fast/workers/resources/worker-script-error-bubbled.js:
* fast/workers/resources/worker-script-error-handled.js:
* fast/workers/resources/worker-script-error.js:
* fast/workers/worker-script-error-expected.txt:
Test &quot;onerror&quot; within Workers, and the &quot;error&quot; event on
the Worker from the spawning context.

* http/tests/security/cross-origin-script-error-event-expected.txt: Added.
* http/tests/security/cross-origin-script-error-event-redirected-expected.txt: Added.
* http/tests/security/cross-origin-script-error-event-redirected.html: Added.
* http/tests/security/cross-origin-script-error-event.html: Added.
* http/tests/security/cross-origin-script-window-onerror-expected.txt:
* http/tests/security/cross-origin-script-window-onerror-redirected-expected.txt:
* http/tests/security/cross-origin-script-window-onerror-redirected.html:
* http/tests/security/cross-origin-script-window-onerror.html:
* http/tests/security/script-crossorigin-error-event-information-expected.txt: Added.
* http/tests/security/script-crossorigin-error-event-information.html: Added.
* http/tests/security/script-crossorigin-onerror-information-expected.txt:
* http/tests/security/script-crossorigin-onerror-information.html:
* http/tests/security/script-no-crossorigin-error-event-should-be-sanitized-expected.txt: Added.
* http/tests/security/script-no-crossorigin-error-event-should-be-sanitized.html: Copied from LayoutTests/http/tests/security/script-no-crossorigin-onerror-should-be-sanitized.html.
* http/tests/security/script-no-crossorigin-onerror-should-be-sanitized-expected.txt:
* http/tests/security/script-no-crossorigin-onerror-should-be-sanitized.html:
* http/tests/security/window-onerror-exception-in-iframe-expected.txt:
* http/tests/security/window-onerror-exception-in-iframe.html:
* http/tests/workers/worker-importScriptsOnError-expected.txt:
* js/dom/exception-line-number-expected.txt:
* js/dom/script-tests/exception-line-number.js:
(window.onerror):

* userscripts/window-onerror-for-isolated-world-1-expected.txt:
* userscripts/window-onerror-for-isolated-world-1.html:
* userscripts/window-onerror-for-isolated-world-2-expected.txt:
* userscripts/window-onerror-for-isolated-world-2.html:
* userscripts/window-onerror-for-isolated-world-3-expected.txt: Added.
* userscripts/window-onerror-for-isolated-world-3.html: Added.
Add an explicit test for error objects crossing isolated world boundaries.
In the Isolated World case, serializable values are cloned, but unserializable
values cause the error object to return to null to avoid leaking across worlds.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfasteventsconstructorserroreventconstructorexpectedtxt">trunk/LayoutTests/fast/events/constructors/error-event-constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventsconstructorserroreventconstructorhtml">trunk/LayoutTests/fast/events/constructors/error-event-constructor.html</a></li>
<li><a href="#trunkLayoutTestsfasteventseventleakobjectsexpectedtxt">trunk/LayoutTests/fast/events/event-leak-objects-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventseventleakobjectshtml">trunk/LayoutTests/fast/events/event-leak-objects.html</a></li>
<li><a href="#trunkLayoutTestsfasteventseventpropertiesgcexpectedtxt">trunk/LayoutTests/fast/events/event-properties-gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventseventpropertiesgchtml">trunk/LayoutTests/fast/events/event-properties-gc.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerrorexceptioninattrexpectedtxt">trunk/LayoutTests/fast/events/window-onerror-exception-in-attr-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerrorexceptioninattrhtml">trunk/LayoutTests/fast/events/window-onerror-exception-in-attr.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerrorsyntaxerrorinattrexpectedtxt">trunk/LayoutTests/fast/events/window-onerror-syntax-error-in-attr-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerrorsyntaxerrorinattrhtml">trunk/LayoutTests/fast/events/window-onerror-syntax-error-in-attr.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror1expectedtxt">trunk/LayoutTests/fast/events/window-onerror1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror1html">trunk/LayoutTests/fast/events/window-onerror1.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror10expectedtxt">trunk/LayoutTests/fast/events/window-onerror10-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror10html">trunk/LayoutTests/fast/events/window-onerror10.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror11expectedtxt">trunk/LayoutTests/fast/events/window-onerror11-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror11html">trunk/LayoutTests/fast/events/window-onerror11.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror12expectedtxt">trunk/LayoutTests/fast/events/window-onerror12-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror12html">trunk/LayoutTests/fast/events/window-onerror12.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror13html">trunk/LayoutTests/fast/events/window-onerror13.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror14html">trunk/LayoutTests/fast/events/window-onerror14.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror16html">trunk/LayoutTests/fast/events/window-onerror16.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror2expectedtxt">trunk/LayoutTests/fast/events/window-onerror2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror2html">trunk/LayoutTests/fast/events/window-onerror2.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror3expectedtxt">trunk/LayoutTests/fast/events/window-onerror3-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror3html">trunk/LayoutTests/fast/events/window-onerror3.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror4expectedtxt">trunk/LayoutTests/fast/events/window-onerror4-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror4html">trunk/LayoutTests/fast/events/window-onerror4.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror5expectedtxt">trunk/LayoutTests/fast/events/window-onerror5-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror5html">trunk/LayoutTests/fast/events/window-onerror5.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror6expectedtxt">trunk/LayoutTests/fast/events/window-onerror6-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror6html">trunk/LayoutTests/fast/events/window-onerror6.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror7expectedtxt">trunk/LayoutTests/fast/events/window-onerror7-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror7html">trunk/LayoutTests/fast/events/window-onerror7.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror8expectedtxt">trunk/LayoutTests/fast/events/window-onerror8-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror8html">trunk/LayoutTests/fast/events/window-onerror8.html</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror9expectedtxt">trunk/LayoutTests/fast/events/window-onerror9-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror9html">trunk/LayoutTests/fast/events/window-onerror9.html</a></li>
<li><a href="#trunkLayoutTestsfastfilesresourcessetupforreadcommonjs">trunk/LayoutTests/fast/files/resources/setup-for-read-common.js</a></li>
<li><a href="#trunkLayoutTestsfastfilesworkersworkerapplybloburltoxhrhtml">trunk/LayoutTests/fast/files/workers/worker-apply-blob-url-to-xhr.html</a></li>
<li><a href="#trunkLayoutTestsfastworkersresourcesworkererrorinhandlingscripterrorjs">trunk/LayoutTests/fast/workers/resources/worker-error-in-handling-script-error.js</a></li>
<li><a href="#trunkLayoutTestsfastworkersresourcesworkerscripterrorbubbledjs">trunk/LayoutTests/fast/workers/resources/worker-script-error-bubbled.js</a></li>
<li><a href="#trunkLayoutTestsfastworkersresourcesworkerscripterrorhandledjs">trunk/LayoutTests/fast/workers/resources/worker-script-error-handled.js</a></li>
<li><a href="#trunkLayoutTestsfastworkersworkerscripterrorexpectedtxt">trunk/LayoutTests/fast/workers/worker-script-error-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastworkersworkerscripterrorhtml">trunk/LayoutTests/fast/workers/worker-script-error.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossoriginscriptwindowonerrorexpectedtxt">trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossoriginscriptwindowonerrorredirectedexpectedtxt">trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror-redirected-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossoriginscriptwindowonerrorredirectedhtml">trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror-redirected.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossoriginscriptwindowonerrorhtml">trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityscriptcrossoriginonerrorinformationexpectedtxt">trunk/LayoutTests/http/tests/security/script-crossorigin-onerror-information-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityscriptcrossoriginonerrorinformationhtml">trunk/LayoutTests/http/tests/security/script-crossorigin-onerror-information.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityscriptnocrossoriginonerrorshouldbesanitizedexpectedtxt">trunk/LayoutTests/http/tests/security/script-no-crossorigin-onerror-should-be-sanitized-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityscriptnocrossoriginonerrorshouldbesanitizedhtml">trunk/LayoutTests/http/tests/security/script-no-crossorigin-onerror-should-be-sanitized.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritywindowonerrorexceptioniniframeexpectedtxt">trunk/LayoutTests/http/tests/security/window-onerror-exception-in-iframe-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritywindowonerrorexceptioniniframehtml">trunk/LayoutTests/http/tests/security/window-onerror-exception-in-iframe.html</a></li>
<li><a href="#trunkLayoutTestshttptestsworkersworkerimportScriptsOnErrorexpectedtxt">trunk/LayoutTests/http/tests/workers/worker-importScriptsOnError-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmldominterfacesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomexceptionlinenumberexpectedtxt">trunk/LayoutTests/js/dom/exception-line-number-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomscripttestsexceptionlinenumberjs">trunk/LayoutTests/js/dom/script-tests/exception-line-number.js</a></li>
<li><a href="#trunkLayoutTestsplatformwk2TestExpectations">trunk/LayoutTests/platform/wk2/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsuserscriptswindowonerrorforisolatedworld1expectedtxt">trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsuserscriptswindowonerrorforisolatedworld1html">trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-1.html</a></li>
<li><a href="#trunkLayoutTestsuserscriptswindowonerrorforisolatedworld2expectedtxt">trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsuserscriptswindowonerrorforisolatedworld2html">trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-2.html</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp">trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCustomEventCustomcpp">trunk/Source/WebCore/bindings/js/JSCustomEventCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingcpp">trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSErrorHandlercpp">trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSErrorHandlerh">trunk/Source/WebCore/bindings/js/JSErrorHandler.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWorkerScriptControllercpp">trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp</a></li>
<li><a href="#trunkSourceWebCoredomCustomEventh">trunk/Source/WebCore/dom/CustomEvent.h</a></li>
<li><a href="#trunkSourceWebCoredomErrorEventcpp">trunk/Source/WebCore/dom/ErrorEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomErrorEventh">trunk/Source/WebCore/dom/ErrorEvent.h</a></li>
<li><a href="#trunkSourceWebCoredomErrorEventidl">trunk/Source/WebCore/dom/ErrorEvent.idl</a></li>
<li><a href="#trunkSourceWebCoredomScriptExecutionContextcpp">trunk/Source/WebCore/dom/ScriptExecutionContext.cpp</a></li>
<li><a href="#trunkSourceWebCoredomScriptExecutionContexth">trunk/Source/WebCore/dom/ScriptExecutionContext.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerMessagingProxycpp">trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasteventswindowonerror17expectedtxt">trunk/LayoutTests/fast/events/window-onerror17-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventswindowonerror17html">trunk/LayoutTests/fast/events/window-onerror17.html</a></li>
<li><a href="#trunkLayoutTestsfastworkersresourcesworkerscripterrorjs">trunk/LayoutTests/fast/workers/resources/worker-script-error.js</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossoriginscripterroreventexpectedtxt">trunk/LayoutTests/http/tests/security/cross-origin-script-error-event-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossoriginscripterroreventredirectedexpectedtxt">trunk/LayoutTests/http/tests/security/cross-origin-script-error-event-redirected-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossoriginscripterroreventredirectedhtml">trunk/LayoutTests/http/tests/security/cross-origin-script-error-event-redirected.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossoriginscripterroreventhtml">trunk/LayoutTests/http/tests/security/cross-origin-script-error-event.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityscriptcrossoriginerroreventinformationexpectedtxt">trunk/LayoutTests/http/tests/security/script-crossorigin-error-event-information-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityscriptcrossoriginerroreventinformationhtml">trunk/LayoutTests/http/tests/security/script-crossorigin-error-event-information.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityscriptnocrossoriginerroreventshouldbesanitizedexpectedtxt">trunk/LayoutTests/http/tests/security/script-no-crossorigin-error-event-should-be-sanitized-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityscriptnocrossoriginerroreventshouldbesanitizedhtml">trunk/LayoutTests/http/tests/security/script-no-crossorigin-error-event-should-be-sanitized.html</a></li>
<li><a href="#trunkLayoutTestsuserscriptswindowonerrorforisolatedworld3expectedtxt">trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestsuserscriptswindowonerrorforisolatedworld3html">trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-3.html</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSErrorEventCustomcpp">trunk/Source/WebCore/bindings/js/JSErrorEventCustom.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/ChangeLog        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,3 +1,103 @@
</span><ins>+2016-06-13  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        window.onerror should pass the ErrorEvent's 'error' property as the 5th argument to the event handler
+        https://bugs.webkit.org/show_bug.cgi?id=55092
+        &lt;rdar://problem/25731279&gt;
+
+        Reviewed by Dean Jackson.
+
+        * platform/wk2/TestExpectations:
+        Skip new userscript test on WebKit2 like others.
+
+        * fast/events/constructors/error-event-constructor-expected.txt:
+        * fast/events/constructors/error-event-constructor.html:
+        Test for the new any &quot;error&quot; initialization property.
+
+        * fast/events/event-leak-objects-expected.txt:
+        * fast/events/event-leak-objects.html:
+        * fast/events/event-properties-gc-expected.txt:
+        * fast/events/event-properties-gc.html:
+        Like CustomEvent.details, ErrorEvent.error should not leak
+        objects across isolated worlds.
+
+        * fast/events/window-onerror-exception-in-attr-expected.txt:
+        * fast/events/window-onerror-exception-in-attr.html:
+        * fast/events/window-onerror-syntax-error-in-attr-expected.txt:
+        * fast/events/window-onerror-syntax-error-in-attr.html:
+        * fast/events/window-onerror1-expected.txt:
+        * fast/events/window-onerror1.html:
+        * fast/events/window-onerror10-expected.txt:
+        * fast/events/window-onerror10.html:
+        * fast/events/window-onerror11-expected.txt:
+        * fast/events/window-onerror11.html:
+        * fast/events/window-onerror12-expected.txt:
+        * fast/events/window-onerror12.html:
+        * fast/events/window-onerror13.html:
+        * fast/events/window-onerror14.html:
+        * fast/events/window-onerror16.html:
+        * fast/events/window-onerror17-expected.txt: Added.
+        * fast/events/window-onerror17.html: Copied from LayoutTests/fast/events/window-onerror12.html.
+        * fast/events/window-onerror2-expected.txt:
+        * fast/events/window-onerror2.html:
+        * fast/events/window-onerror3-expected.txt:
+        * fast/events/window-onerror3.html:
+        * fast/events/window-onerror4-expected.txt:
+        * fast/events/window-onerror4.html:
+        * fast/events/window-onerror5-expected.txt:
+        * fast/events/window-onerror5.html:
+        * fast/events/window-onerror6-expected.txt:
+        * fast/events/window-onerror6.html:
+        * fast/events/window-onerror7-expected.txt:
+        * fast/events/window-onerror7.html:
+        * fast/events/window-onerror8-expected.txt:
+        * fast/events/window-onerror8.html:
+        * fast/events/window-onerror9-expected.txt:
+        * fast/events/window-onerror9.html:
+        Include output for the column number and error object where possible.
+
+        * fast/files/resources/setup-for-read-common.js:
+        * fast/files/workers/worker-apply-blob-url-to-xhr.html:
+        * fast/workers/resources/worker-error-in-handling-script-error.js:
+        * fast/workers/resources/worker-script-error-bubbled.js:
+        * fast/workers/resources/worker-script-error-handled.js:
+        * fast/workers/resources/worker-script-error.js:
+        * fast/workers/worker-script-error-expected.txt:
+        Test &quot;onerror&quot; within Workers, and the &quot;error&quot; event on
+        the Worker from the spawning context.
+
+        * http/tests/security/cross-origin-script-error-event-expected.txt: Added.
+        * http/tests/security/cross-origin-script-error-event-redirected-expected.txt: Added.
+        * http/tests/security/cross-origin-script-error-event-redirected.html: Added.
+        * http/tests/security/cross-origin-script-error-event.html: Added.
+        * http/tests/security/cross-origin-script-window-onerror-expected.txt:
+        * http/tests/security/cross-origin-script-window-onerror-redirected-expected.txt:
+        * http/tests/security/cross-origin-script-window-onerror-redirected.html:
+        * http/tests/security/cross-origin-script-window-onerror.html:
+        * http/tests/security/script-crossorigin-error-event-information-expected.txt: Added.
+        * http/tests/security/script-crossorigin-error-event-information.html: Added.
+        * http/tests/security/script-crossorigin-onerror-information-expected.txt:
+        * http/tests/security/script-crossorigin-onerror-information.html:
+        * http/tests/security/script-no-crossorigin-error-event-should-be-sanitized-expected.txt: Added.
+        * http/tests/security/script-no-crossorigin-error-event-should-be-sanitized.html: Copied from LayoutTests/http/tests/security/script-no-crossorigin-onerror-should-be-sanitized.html.
+        * http/tests/security/script-no-crossorigin-onerror-should-be-sanitized-expected.txt:
+        * http/tests/security/script-no-crossorigin-onerror-should-be-sanitized.html:
+        * http/tests/security/window-onerror-exception-in-iframe-expected.txt:
+        * http/tests/security/window-onerror-exception-in-iframe.html:
+        * http/tests/workers/worker-importScriptsOnError-expected.txt:
+        * js/dom/exception-line-number-expected.txt:
+        * js/dom/script-tests/exception-line-number.js:
+        (window.onerror):
+
+        * userscripts/window-onerror-for-isolated-world-1-expected.txt:
+        * userscripts/window-onerror-for-isolated-world-1.html:
+        * userscripts/window-onerror-for-isolated-world-2-expected.txt:
+        * userscripts/window-onerror-for-isolated-world-2.html:
+        * userscripts/window-onerror-for-isolated-world-3-expected.txt: Added.
+        * userscripts/window-onerror-for-isolated-world-3.html: Added.
+        Add an explicit test for error objects crossing isolated world boundaries.
+        In the Isolated World case, serializable values are cloned, but unserializable
+        values cause the error object to return to null to avoid leaking across worlds.
+
</ins><span class="cx"> 2016-06-13  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         SVG elements don't blend correctly into HTML
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsconstructorserroreventconstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/constructors/error-event-constructor-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/constructors/error-event-constructor-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/constructors/error-event-constructor-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -64,6 +64,14 @@
</span><span class="cx"> PASS new ErrorEvent('eventType', { colno: 1 }).colno is 1
</span><span class="cx"> PASS new ErrorEvent('eventType', { colno: 4294967294 }).colno is 4294967294
</span><span class="cx"> PASS new ErrorEvent('eventType', { colno: 4294967295 }).colno is 4294967295
</span><ins>+PASS new ErrorEvent('eventType', { error: undefined }).error is undefined
+PASS new ErrorEvent('eventType', { error: null }).error is null
+PASS new ErrorEvent('eventType', { error: '' }).error is ''
+PASS new ErrorEvent('eventType', { error: '12345' }).error is '12345'
+PASS new ErrorEvent('eventType', { error: [] }).error is []
+PASS new ErrorEvent('eventType', { error: [12345] }).error is [12345]
+PASS new ErrorEvent('eventType', { error: [12345, 67890] }).error is [12345, 67890]
+PASS new ErrorEvent('eventType', { error: {moemoe: 12345} }).error.moemoe is 12345
</ins><span class="cx"> PASS new ErrorEvent('eventType', { colno: 9007199254740991 }).colno is 4294967295
</span><span class="cx"> PASS new ErrorEvent('eventType', { colno: 18446744073709551615 }).colno is 0
</span><span class="cx"> PASS new ErrorEvent('eventType', { colno: 12345678901234567890 }).colno is 3944679424
</span><span class="lines">@@ -82,12 +90,13 @@
</span><span class="cx"> PASS new ErrorEvent('eventType', { colno: {} }).colno is 0
</span><span class="cx"> PASS new ErrorEvent('eventType', { colno: {moemoe: 12345} }).colno is 0
</span><span class="cx"> PASS new ErrorEvent('eventType', { colno: {valueOf: function () { return 12345; }} }).colno is 12345
</span><del>-PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).bubbles is true
-PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).cancelable is true
-PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).message is &quot;sakuranbo&quot;
-PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).filename is &quot;amaenbo&quot;
-PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).lineno is 12345
-PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).colno is 23456
</del><ins>+PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456, error: 42 }).bubbles is true
+PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456, error: 42 }).cancelable is true
+PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456, error: 42 }).message is &quot;sakuranbo&quot;
+PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456, error: 42 }).filename is &quot;amaenbo&quot;
+PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456, error: 42 }).lineno is 12345
+PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456, error: 42 }).colno is 23456
+PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456, error: 42 }).error is 42
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsconstructorserroreventconstructorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/constructors/error-event-constructor.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/constructors/error-event-constructor.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/constructors/error-event-constructor.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -81,6 +81,16 @@
</span><span class="cx"> shouldBe(&quot;new ErrorEvent('eventType', { colno: 4294967294 }).colno&quot;, &quot;4294967294&quot;);
</span><span class="cx"> shouldBe(&quot;new ErrorEvent('eventType', { colno: 4294967295 }).colno&quot;, &quot;4294967295&quot;);
</span><span class="cx"> 
</span><ins>+// error is passed.
+shouldBe(&quot;new ErrorEvent('eventType', { error: undefined }).error&quot;, &quot;undefined&quot;);
+shouldBe(&quot;new ErrorEvent('eventType', { error: null }).error&quot;, &quot;null&quot;);
+shouldBe(&quot;new ErrorEvent('eventType', { error: '' }).error&quot;, &quot;''&quot;);
+shouldBe(&quot;new ErrorEvent('eventType', { error: '12345' }).error&quot;, &quot;'12345'&quot;);
+shouldBe(&quot;new ErrorEvent('eventType', { error: [] }).error&quot;, &quot;[]&quot;);
+shouldBe(&quot;new ErrorEvent('eventType', { error: [12345] }).error&quot;, &quot;[12345]&quot;);
+shouldBe(&quot;new ErrorEvent('eventType', { error: [12345, 67890] }).error&quot;, &quot;[12345, 67890]&quot;);
+shouldBe(&quot;new ErrorEvent('eventType', { error: {moemoe: 12345} }).error.moemoe&quot;, &quot;12345&quot;);
+
</ins><span class="cx"> // numbers out of the unsigned long range.
</span><span class="cx"> // 2^{53}-1, the largest number that can be exactly represented by double.
</span><span class="cx"> shouldBe(&quot;new ErrorEvent('eventType', { colno: 9007199254740991 }).colno&quot;, &quot;4294967295&quot;);
</span><span class="lines">@@ -106,12 +116,13 @@
</span><span class="cx"> shouldBe(&quot;new ErrorEvent('eventType', { colno: {valueOf: function () { return 12345; }} }).colno&quot;, &quot;12345&quot;);
</span><span class="cx"> 
</span><span class="cx"> // All initializers are passed.
</span><del>-shouldBe(&quot;new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).bubbles&quot;, &quot;true&quot;);
-shouldBe(&quot;new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).cancelable&quot;, &quot;true&quot;);
-shouldBeEqualToString(&quot;new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).message&quot;, &quot;sakuranbo&quot;);
-shouldBeEqualToString(&quot;new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).filename&quot;, &quot;amaenbo&quot;);
-shouldBe(&quot;new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).lineno&quot;, &quot;12345&quot;);
-shouldBe(&quot;new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).colno&quot;, &quot;23456&quot;);
</del><ins>+shouldBe(&quot;new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456, error: 42 }).bubbles&quot;, &quot;true&quot;);
+shouldBe(&quot;new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456, error: 42 }).cancelable&quot;, &quot;true&quot;);
+shouldBeEqualToString(&quot;new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456, error: 42 }).message&quot;, &quot;sakuranbo&quot;);
+shouldBeEqualToString(&quot;new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456, error: 42 }).filename&quot;, &quot;amaenbo&quot;);
+shouldBe(&quot;new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456, error: 42 }).lineno&quot;, &quot;12345&quot;);
+shouldBe(&quot;new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456, error: 42 }).colno&quot;, &quot;23456&quot;);
+shouldBe(&quot;new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456, error: 42 }).error&quot;, &quot;42&quot;);
</ins><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventseventleakobjectsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/event-leak-objects-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/event-leak-objects-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/event-leak-objects-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,3 +1,5 @@
</span><ins>+
+Testing ErrorEvent.error
</ins><span class="cx"> PASS window.internals.isFromCurrentWorld(event) is true
</span><span class="cx"> PASS checkAllPropertiesFromCurrentWorld(resultValue) is true
</span><span class="cx"> PASS Object.pageDefinedVar is undefined.
</span><span class="lines">@@ -16,6 +18,8 @@
</span><span class="cx"> PASS window.internals.isFromCurrentWorld(event) is true
</span><span class="cx"> PASS checkAllPropertiesFromCurrentWorld(resultValue) is true
</span><span class="cx"> PASS Object.pageDefinedVar is undefined.
</span><ins>+
+Testing PopStateEvent.state
</ins><span class="cx"> PASS window.internals.isFromCurrentWorld(event) is true
</span><span class="cx"> PASS checkAllPropertiesFromCurrentWorld(resultValue) is true
</span><span class="cx"> PASS Object.pageDefinedVar is undefined.
</span><span class="lines">@@ -34,6 +38,8 @@
</span><span class="cx"> PASS window.internals.isFromCurrentWorld(event) is true
</span><span class="cx"> PASS checkAllPropertiesFromCurrentWorld(resultValue) is true
</span><span class="cx"> PASS Object.pageDefinedVar is undefined.
</span><ins>+
+Testing MessageEvent.data
</ins><span class="cx"> PASS window.internals.isFromCurrentWorld(event) is true
</span><span class="cx"> PASS checkAllPropertiesFromCurrentWorld(resultValue) is true
</span><span class="cx"> PASS Object.pageDefinedVar is undefined.
</span><span class="lines">@@ -52,6 +58,26 @@
</span><span class="cx"> PASS window.internals.isFromCurrentWorld(event) is true
</span><span class="cx"> PASS checkAllPropertiesFromCurrentWorld(resultValue) is true
</span><span class="cx"> PASS Object.pageDefinedVar is undefined.
</span><ins>+
+Testing CustomEvent.detail
+PASS window.internals.isFromCurrentWorld(event) is true
+PASS checkAllPropertiesFromCurrentWorld(resultValue) is true
+PASS Object.pageDefinedVar is undefined.
+PASS window.internals.isFromCurrentWorld(event) is true
+PASS checkAllPropertiesFromCurrentWorld(resultValue) is true
+PASS Object.pageDefinedVar is undefined.
+PASS window.internals.isFromCurrentWorld(event) is true
+PASS checkAllPropertiesFromCurrentWorld(resultValue) is true
+PASS Object.pageDefinedVar is undefined.
+PASS window.internals.isFromCurrentWorld(event) is true
+PASS checkAllPropertiesFromCurrentWorld(resultValue) is true
+PASS Object.pageDefinedVar is undefined.
+PASS window.internals.isFromCurrentWorld(event) is true
+PASS checkAllPropertiesFromCurrentWorld(resultValue) is true
+PASS Object.pageDefinedVar is undefined.
+PASS window.internals.isFromCurrentWorld(event) is true
+PASS checkAllPropertiesFromCurrentWorld(resultValue) is true
+PASS Object.pageDefinedVar is undefined.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventseventleakobjectshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/event-leak-objects.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/event-leak-objects.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/event-leak-objects.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -11,7 +11,8 @@
</span><span class="cx"> var events = [
</span><span class="cx">     { eventKind: &quot;CustomEvent&quot;, propName: &quot;detail&quot; },
</span><span class="cx">     { eventKind: &quot;MessageEvent&quot;, propName: &quot;data&quot;  },
</span><del>-    { eventKind: &quot;PopStateEvent&quot;, propName: &quot;state&quot; }
</del><ins>+    { eventKind: &quot;PopStateEvent&quot;, propName: &quot;state&quot; },
+    { eventKind: &quot;ErrorEvent&quot;, propName: &quot;error&quot; },
</ins><span class="cx"> ];
</span><span class="cx"> 
</span><span class="cx"> // Types we can put in the property of the Event
</span><span class="lines">@@ -103,12 +104,21 @@
</span><span class="cx"> 
</span><span class="cx"> // Keep a count to make a unique string
</span><span class="cx"> var count = 1;
</span><ins>+var lastEventKind, lastPropertyName;
</ins><span class="cx"> function runNextTest () {
</span><span class="cx">     var test = tests.pop();
</span><span class="cx">     if (!test) {
</span><span class="cx">         finishJSTest();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><ins>+
+    if (test.eventKind !== lastEventKind) {
+        debug(&quot;&quot;);
+        debug(&quot;Testing &quot; + test.eventKind + &quot;.&quot; + test.propName);
+        lastEventKind = test.eventKind;
+        lastPropertyName = test.propName;
+    }
+
</ins><span class="cx">     runScript(test.eventKind, test.propName, test.propValue, count++);
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventseventpropertiesgcexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/event-properties-gc-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/event-properties-gc-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/event-properties-gc-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,6 +1,15 @@
</span><ins>+
+Testing: ErrorEvent.error
</ins><span class="cx"> PASS event[prop] is &quot;foo&quot;
</span><ins>+
+Testing: PopStateEvent.state
</ins><span class="cx"> PASS event[prop] is &quot;foo&quot;
</span><ins>+
+Testing: MessageEvent.data
</ins><span class="cx"> PASS event[prop] is &quot;foo&quot;
</span><ins>+
+Testing: CustomEvent.detail
+PASS event[prop] is &quot;foo&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventseventpropertiesgchtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/event-properties-gc.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/event-properties-gc.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/event-properties-gc.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx"> function addListener(eventType, prop) {
</span><span class="cx">     document.addEventListener(eventType, function(event) {
</span><span class="cx">         window.prop = prop;
</span><del>-        // Despite the earlier assignement of the local variable to null and
</del><ins>+        // Despite the earlier assignment of the local variable to null and
</ins><span class="cx">         // the following garabage collection, the property should still be
</span><span class="cx">         // present here.
</span><span class="cx">         shouldBeEqualToString(&quot;event[prop]&quot;, &quot;foo&quot;);
</span><span class="lines">@@ -33,7 +33,8 @@
</span><span class="cx"> var events = [
</span><span class="cx">     { eventType: &quot;CustomEvent&quot;, prop: &quot;detail&quot; },
</span><span class="cx">     { eventType: &quot;MessageEvent&quot;, prop: &quot;data&quot; },
</span><del>-    { eventType: &quot;PopStateEvent&quot;, prop: &quot;state&quot; }
</del><ins>+    { eventType: &quot;PopStateEvent&quot;, prop: &quot;state&quot; },
+    { eventType: &quot;ErrorEvent&quot;, prop: &quot;error&quot; },
</ins><span class="cx"> ];
</span><span class="cx"> 
</span><span class="cx"> function runNextTest () {
</span><span class="lines">@@ -42,6 +43,9 @@
</span><span class="cx">         finishJSTest();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><ins>+
+    debug(&quot;&quot;);
+    debug(&quot;Testing: &quot; + evt.eventType + &quot;.&quot; + evt.prop);
</ins><span class="cx">     var value = &quot;foo&quot;;
</span><span class="cx">     var eventToDispatch = newEvent(evt.eventType, evt.prop, value);
</span><span class="cx">     value = null;
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerrorexceptioninattrexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror-exception-in-attr-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror-exception-in-attr-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror-exception-in-attr-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> Test that window.onerror is called on window object when there is an exception(excluding syntax errors) in attribute handler. Bug 70991.
</span><span class="cx"> 
</span><del>-Main frame window.onerror: TypeError: null is not an object (evaluating 'null.m') at window-onerror-exception-in-attr.html:10
-Main frame window.onerror: TypeError: null is not an object (evaluating 'null.m') at window-onerror-exception-in-attr.html:36
-Main frame window.onerror: TypeError: null is not an object (evaluating 'null.m') at window-onerror-exception-in-attr.html:36
</del><ins>+Main frame window.onerror: TypeError: null is not an object (evaluating 'null.m') at window-onerror-exception-in-attr.html:10:5 TypeError: null is not an object (evaluating 'null.m')
+Main frame window.onerror: TypeError: null is not an object (evaluating 'null.m') at window-onerror-exception-in-attr.html:36:5 TypeError: null is not an object (evaluating 'null.m')
+Main frame window.onerror: TypeError: null is not an object (evaluating 'null.m') at window-onerror-exception-in-attr.html:36:5 TypeError: null is not an object (evaluating 'null.m')
</ins><span class="cx"> Button 1 Button 2 Button 3
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerrorexceptioninattrhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror-exception-in-attr.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror-exception-in-attr.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror-exception-in-attr.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -16,10 +16,10 @@
</span><span class="cx">     document.getElementById(&quot;console&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line)
</del><ins>+window.onerror = function(msg, url, line, column, error)
</ins><span class="cx"> {
</span><span class="cx">     url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
</span><del>-    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;:&quot; + line);
</del><ins>+    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;:&quot; + line + &quot;:&quot; + column + &quot; &quot; + error);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerrorsyntaxerrorinattrexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror-syntax-error-in-attr-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror-syntax-error-in-attr-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror-syntax-error-in-attr-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> Test that window.onerror is called on window object when there is a syntax error in attribute handler. Bug 70991.
</span><span class="cx"> 
</span><del>-Main frame window.onerror: SyntaxError: Unexpected token '%' at window-onerror-syntax-error-in-attr.html:10
-Main frame window.onerror: SyntaxError: Unexpected token '%' at window-onerror-syntax-error-in-attr.html:36
-Main frame window.onerror: SyntaxError: Unexpected token '%' at window-onerror-syntax-error-in-attr.html:36
</del><ins>+Main frame window.onerror: SyntaxError: Unexpected token '%' at window-onerror-syntax-error-in-attr.html:10:38 SyntaxError: Unexpected token '%'
+Main frame window.onerror: SyntaxError: Unexpected token '%' at window-onerror-syntax-error-in-attr.html:36:38 SyntaxError: Unexpected token '%'
+Main frame window.onerror: SyntaxError: Unexpected token '%' at window-onerror-syntax-error-in-attr.html:36:14 SyntaxError: Unexpected token '%'
</ins><span class="cx"> Button 1 Button 2 Button 3
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerrorsyntaxerrorinattrhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror-syntax-error-in-attr.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror-syntax-error-in-attr.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror-syntax-error-in-attr.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -16,10 +16,10 @@
</span><span class="cx">     document.getElementById(&quot;console&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line)
</del><ins>+window.onerror = function(msg, url, line, column, error)
</ins><span class="cx"> {
</span><span class="cx">     url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
</span><del>-    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;:&quot; + line);
</del><ins>+    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;:&quot; + line + &quot;:&quot; + column + &quot; &quot; + error);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror1expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror1-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror1-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror1-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><span class="cx"> This page tests setting onerror handlers through the DOM. If it passes, you will see &quot;PASS&quot; messages below.Bug 8519.
</span><span class="cx"> 
</span><del>-PASS: caught global error: ReferenceError: Can't find variable: hahaha_good_luck_finding_me at window-onerror1.html, line: 25, column: 32
</del><ins>+PASS: caught global error: ReferenceError: Can't find variable: hahaha_good_luck_finding_me at window-onerror1.html, line: 25, column: 32, error ReferenceError: Can't find variable: hahaha_good_luck_finding_me
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror1html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror1.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror1.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror1.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -17,9 +17,9 @@
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><span class="cx">     // must be last because the exception ends JavaScript execution
</span><del>-    window.onerror = function (error, url, line, column) {
</del><ins>+    window.onerror = function (msg, url, line, column, error) {
</ins><span class="cx">         url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
</span><del>-        print(&quot;PASS: caught global error: &quot; + error + &quot; at &quot; + url + &quot;, line: &quot; + line + &quot;, column: &quot; + column, &quot;green&quot;);
</del><ins>+        print(&quot;PASS: caught global error: &quot; + msg + &quot; at &quot; + url + &quot;, line: &quot; + line + &quot;, column: &quot; + column + &quot;, error &quot; + error, &quot;green&quot;);
</ins><span class="cx">         return true;
</span><span class="cx">     };
</span><span class="cx">     hahaha_good_luck_finding_me(); // caught by window.onerror
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror10expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror10-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror10-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror10-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -7,5 +7,7 @@
</span><span class="cx"> currentTarget is the global object: true
</span><span class="cx"> message: Error: My fault.
</span><span class="cx"> filename: window-onerror10.html
</span><del>-lineno: 29
</del><ins>+lineno: 31
+colno: 29
+error: Error: My fault.
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror10html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror10.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror10.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror10.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -23,6 +23,8 @@
</span><span class="cx">     log(&quot;message: &quot; + e.message);
</span><span class="cx">     log(&quot;filename: &quot; + lastPathComponent(e.filename));
</span><span class="cx">     log(&quot;lineno: &quot; + e.lineno);
</span><ins>+    log(&quot;colno: &quot; + e.colno);
+    log(&quot;error: &quot; + e.error);
</ins><span class="cx">     e.preventDefault();
</span><span class="cx"> }, false);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror11expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror11-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror11-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror11-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><span class="cx"> Test that window.onerror is called on window object. Bug 8519.
</span><span class="cx"> 
</span><del>-Main frame window.onerror: Error: An exception at window-onerror.js, line: 2, column: 36
</del><ins>+Main frame window.onerror: Error: An exception at window-onerror.js, line: 2, column: 36, error: Error: An exception
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror11html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror11.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror11.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror11.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -14,10 +14,10 @@
</span><span class="cx">     document.getElementById(&quot;console&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line, column)
</del><ins>+window.onerror = function(msg, url, line, column, error)
</ins><span class="cx"> {
</span><span class="cx">     url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
</span><del>-    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;, line: &quot; + line + &quot;, column: &quot; + column);
</del><ins>+    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;, line: &quot; + line + &quot;, column: &quot; + column + &quot;, error: &quot; + error);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror12expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror12-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror12-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror12-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -5,5 +5,6 @@
</span><span class="cx"> url: undefined
</span><span class="cx"> line: undefined
</span><span class="cx"> column: undefined
</span><ins>+error: undefined
</ins><span class="cx"> DONE.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror12html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror12.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror12.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror12.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -14,13 +14,14 @@
</span><span class="cx">     document.getElementById(&quot;console&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line, column)
</del><ins>+window.onerror = function(msg, url, line, column, error)
</ins><span class="cx"> {
</span><span class="cx">     log(&quot;Main frame window.onerror: &quot;);
</span><span class="cx">     log(&quot;msg: &quot; + msg);
</span><span class="cx">     log(&quot;url: &quot; + url);
</span><span class="cx">     log(&quot;line: &quot; + line);
</span><span class="cx">     log(&quot;column: &quot; + column);
</span><ins>+    log(&quot;error: &quot; + error);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror13html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror13.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror13.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror13.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx">     document.getElementById(&quot;console&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line, column)
</del><ins>+window.onerror = function(msg, url, line, column, error)
</ins><span class="cx"> {
</span><span class="cx">   log(&quot;Uncaught error should be printed in console when window.onerror returns not true.&quot;);
</span><span class="cx">   log(&quot;DONE.&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror14html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror14.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror14.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror14.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx">     document.getElementById(&quot;console&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line, column)
</del><ins>+window.onerror = function(msg, url, line, column, error)
</ins><span class="cx"> {
</span><span class="cx">   log(&quot;Uncaught error should *not* be printed in console when window.onerror returns true.&quot;);
</span><span class="cx">   log(&quot;window.onerror invoked.&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror16html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror16.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror16.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror16.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx">     document.getElementById(&quot;console&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line, column)
</del><ins>+window.onerror = function(msg, url, line, column, error)
</ins><span class="cx"> {
</span><span class="cx">   log(&quot;window.onerror invoked. Uncaught error should be printed in console&quot;);
</span><span class="cx">   log(&quot;DONE.&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror17expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/window-onerror17-expected.txt (0 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror17-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/events/window-onerror17-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Test that window.onerror is called on window object for events created using new ErrorEvent('error', {}).
+
+Main frame window.onerror: 
+msg: Some error
+url: Some file
+line: 42
+column: 43
+error: Hello there
+DONE.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror17htmlfromrev202022trunkLayoutTestsfasteventswindowonerror12html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/fast/events/window-onerror17.html (from rev 202022, trunk/LayoutTests/fast/events/window-onerror12.html) (0 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror17.html                                (rev 0)
+++ trunk/LayoutTests/fast/events/window-onerror17.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/window-onerror.js&quot;&gt;
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Test that window.onerror is called on window object for events created using new ErrorEvent('error', {}).&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+
+function log(msg) {
+    document.getElementById(&quot;console&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
+}
+
+window.onerror = function(msg, url, line, column, error)
+{
+    log(&quot;Main frame window.onerror: &quot;);
+    log(&quot;msg: &quot; + msg);
+    log(&quot;url: &quot; + url);
+    log(&quot;line: &quot; + line);
+    log(&quot;column: &quot; + column);
+    log(&quot;error: &quot; + error);
+    return true;
+}
+
+var evt = new ErrorEvent('error', {
+    message: 'Some error',
+    filename: 'Some file',
+    lineno: 42,
+    colno: 43,
+    error: 'Hello there',
+});
+window.dispatchEvent(evt);
+log(&quot;DONE.&quot;);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror2expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror2-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror2-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror2-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> Test that uncaught exceptions will be reported to the window.onerror handler. Bug 8519.
</span><span class="cx"> 
</span><del>-Main frame window.onerror: Error: Inline script exception at window-onerror2.html, line: 34, column: 47
-Main frame window.onerror: Exception in onload at window-onerror2.html, line: 2, column: 66
-Main frame window.onerror: Error: Exception in setTimeout at window-onerror2.html, line: 29, column: 47
</del><ins>+Main frame window.onerror: Error: Inline script exception at window-onerror2.html, line: 34, column: 47, error: Error: Inline script exception
+Main frame window.onerror: Exception in onload at window-onerror2.html, line: 2, column: 66, error: Exception in onload
+Main frame window.onerror: Error: Exception in setTimeout at window-onerror2.html, line: 29, column: 47, error: Error: Exception in setTimeout
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror2html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror2.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror2.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror2.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -13,10 +13,10 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> var unhandledErrorCount = 0;
</span><del>-window.onerror = function(msg, url, line, column)
</del><ins>+window.onerror = function(msg, url, line, column, error)
</ins><span class="cx"> {
</span><span class="cx">     url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
</span><del>-    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;, line: &quot; + line + &quot;, column: &quot; + column);
</del><ins>+    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;, line: &quot; + line + &quot;, column: &quot; + column + &quot;, error: &quot; + error);
</ins><span class="cx">     
</span><span class="cx">     if (++unhandledErrorCount === 3 &amp;&amp; window.testRunner)
</span><span class="cx">         testRunner.notifyDone();
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror3expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror3-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror3-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror3-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><span class="cx"> You should see a message if window.onerror is working properly for this test.Bug 8519.
</span><span class="cx"> 
</span><del>-Error caught successfully: ReferenceError: Can't find variable: unknownObject File: window-onerror3.html Line: 16
</del><ins>+Error caught successfully: ReferenceError: Can't find variable: unknownObject File: window-onerror3.html Line: 16 Column: 18 Error: ReferenceError: Can't find variable: unknownObject
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror3html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror3.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror3.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror3.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -8,9 +8,9 @@
</span><span class="cx"> 
</span><span class="cx"> function test1()
</span><span class="cx"> {
</span><del>-    window.onerror = function (error, url, line) {
</del><ins>+    window.onerror = function (error, url, line, column, error) {
</ins><span class="cx">         url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
</span><del>-        log(&quot;Error caught successfully: &quot; + error + &quot;\nFile: &quot; + url + &quot;\nLine: &quot; + line)
</del><ins>+        log(&quot;Error caught successfully: &quot; + error + &quot;\nFile: &quot; + url + &quot;\nLine: &quot; + line + &quot;\nColumn: &quot; + column + &quot;\nError: &quot; + error)
</ins><span class="cx">         return true;
</span><span class="cx">     };
</span><span class="cx">     unknownObject.unknownProperty++;
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror4expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror4-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror4-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror4-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><span class="cx"> You should see a log record if window.onerror is working properly for this test.Bug 8519.
</span><span class="cx"> 
</span><del>-Error caught successfully: ReferenceError: Left side of assignment is not a reference. File: undefined Line: 1 Column: 3
</del><ins>+Error caught successfully: ReferenceError: Left side of assignment is not a reference. File: undefined Line: 1 Column: 3 Error: ReferenceError: Left side of assignment is not a reference.
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror4html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror4.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror4.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror4.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -8,9 +8,9 @@
</span><span class="cx"> 
</span><span class="cx"> function test1()
</span><span class="cx"> {
</span><del>-    window.onerror = function (error, url, line, column) {
</del><ins>+    window.onerror = function (error, url, line, column, error) {
</ins><span class="cx">         url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
</span><del>-        log(&quot;Error caught successfully: &quot; + error + &quot;\nFile: &quot; + url + &quot;\nLine: &quot; + line + &quot;\nColumn: &quot; + column)
</del><ins>+        log(&quot;Error caught successfully: &quot; + error + &quot;\nFile: &quot; + url + &quot;\nLine: &quot; + line + &quot;\nColumn: &quot; + column + &quot;\nError: &quot; + error)
</ins><span class="cx">         return true;
</span><span class="cx">     };
</span><span class="cx">     eval(&quot;1=2&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror5expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror5-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror5-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror5-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><span class="cx"> Test that window.onerror is invoked for syntax error in eval. You should see a log record if window.onerror is working properly for this test.Bug 8519.
</span><span class="cx"> 
</span><del>-Error caught successfully: SyntaxError: Unexpected end of script File: window-onerror5.html Line: 16 Column: 9
</del><ins>+Error caught successfully: SyntaxError: Unexpected end of script File: window-onerror5.html Line: 16 Column: 9 Error: SyntaxError: Unexpected end of script
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror5html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror5.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror5.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror5.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -8,9 +8,9 @@
</span><span class="cx"> 
</span><span class="cx"> function test1()
</span><span class="cx"> {
</span><del>-    window.onerror = function (error, url, line, column) {
</del><ins>+    window.onerror = function (error, url, line, column, error) {
</ins><span class="cx">         url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
</span><del>-        log(&quot;Error caught successfully: &quot; + error + &quot;\nFile: &quot; + url + &quot;\nLine: &quot; + line + &quot;\nColumn: &quot; + column)
</del><ins>+        log(&quot;Error caught successfully: &quot; + error + &quot;\nFile: &quot; + url + &quot;\nLine: &quot; + line + &quot;\nColumn: &quot; + column + &quot;\nError: &quot; + error)
</ins><span class="cx">         return true;
</span><span class="cx">     };
</span><span class="cx">     eval(&quot;a(&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror6expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror6-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror6-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror6-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><span class="cx"> Test that syntax error will be reported to the window.onerror handler. Bug 8519.
</span><span class="cx"> 
</span><del>-Main frame window.onerror: SyntaxError: Unexpected token ')' at window-onerror6.html, line: 22, column: 0
</del><ins>+Main frame window.onerror: SyntaxError: Unexpected token ')' at window-onerror6.html, line: 22, column: 0, error: SyntaxError: Unexpected token ')'
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror6html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror6.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror6.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror6.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -10,10 +10,10 @@
</span><span class="cx">     document.getElementById(&quot;console&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line, column)
</del><ins>+window.onerror = function(msg, url, line, column, error)
</ins><span class="cx"> {
</span><span class="cx">     url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
</span><del>-    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;, line: &quot; + line + &quot;, column: &quot; + column);
</del><ins>+    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;, line: &quot; + line + &quot;, column: &quot; + column + &quot;, error: &quot; + error);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror7expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror7-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror7-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror7-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -2,5 +2,5 @@
</span><span class="cx"> CONSOLE MESSAGE: line 17: Error: Nested error
</span><span class="cx"> Test that exception in window.onerror won't lead to recursive window.onerror call. Bug 8519.
</span><span class="cx"> 
</span><del>-Main frame window.onerror: Error: Original error at window-onerror7.html, line: 20, column: 34
</del><ins>+Main frame window.onerror: Error: Original error at window-onerror7.html, line: 20, column: 34, error: Error: Original error
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror7html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror7.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror7.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror7.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -10,10 +10,10 @@
</span><span class="cx">     document.getElementById(&quot;console&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line, column)
</del><ins>+window.onerror = function(msg, url, line, column, error)
</ins><span class="cx"> {
</span><span class="cx">     url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
</span><del>-    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;, line: &quot; + line + &quot;, column: &quot; + column);
</del><ins>+    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;, line: &quot; + line + &quot;, column: &quot; + column + &quot;, error: &quot; + error);
</ins><span class="cx">     throw new Error(&quot;Nested error&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror8expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror8-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror8-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror8-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> Test that window.onerror is called on window object. Bug 8519.
</span><span class="cx"> 
</span><del>-Main frame window.onerror: 2010 at window-onerror8.html, line: 24, column: 11
</del><ins>+Main frame window.onerror: 2010 at window-onerror8.html, line: 24, column: 11, error: 2010
</ins><span class="cx"> PASSED: this === window
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror8html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror8.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror8.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror8.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -10,10 +10,10 @@
</span><span class="cx">     document.getElementById(&quot;console&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line, column)
</del><ins>+window.onerror = function(msg, url, line, column, error)
</ins><span class="cx"> {
</span><span class="cx">     url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
</span><del>-    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;, line: &quot; + line + &quot;, column: &quot; + column);
</del><ins>+    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;, line: &quot; + line + &quot;, column: &quot; + column + &quot;, error: &quot; + error);
</ins><span class="cx">     if (this === window) 
</span><span class="cx">         log(&quot;PASSED: this === window&quot;);
</span><span class="cx">     else
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror9expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror9-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror9-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror9-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> Test that when window.onerror handler is called, window.event is the corresponding ErrorEvent object. Bug 8519.
</span><span class="cx"> 
</span><del>-Main frame window.onerror: Error: 2010 at window-onerror9.html, line: 32, column: 22
</del><ins>+Main frame window.onerror: Error: 2010 at window-onerror9.html, line: 32, column: 22, error: Error: 2010
</ins><span class="cx"> window.event.type = error
</span><span class="cx"> window.event.message = Error: 2010
</span><span class="cx"> window.event.filename = window-onerror9.html
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventswindowonerror9html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/window-onerror9.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/window-onerror9.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/events/window-onerror9.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -16,9 +16,9 @@
</span><span class="cx">     return url ? url.match( /[^\/]+\/?$/ )[0] : url;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line, column)
</del><ins>+window.onerror = function(msg, url, line, column, error)
</ins><span class="cx"> {
</span><del>-    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + lastPathComponent(url) + &quot;, line: &quot; + line + &quot;, column: &quot; + column);
</del><ins>+    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + lastPathComponent(url) + &quot;, line: &quot; + line + &quot;, column: &quot; + column + &quot;, error: &quot; + error);
</ins><span class="cx">     log(&quot;window.event.type = &quot; + window.event.type);
</span><span class="cx">     log(&quot;window.event.message = &quot; + window.event.message);
</span><span class="cx">     log(&quot;window.event.filename = &quot; + lastPathComponent(window.event.filename));
</span></span></pre></div>
<a id="trunkLayoutTestsfastfilesresourcessetupforreadcommonjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/files/resources/setup-for-read-common.js (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/files/resources/setup-for-read-common.js        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/files/resources/setup-for-read-common.js        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx">     }
</span><span class="cx">     worker.onerror = function(event)
</span><span class="cx">     {
</span><del>-        log(&quot;Received error from worker: &quot; + event.message);
</del><ins>+        log(&quot;Received error from worker: &quot; + event.message + &quot; at &quot; + event.filename + &quot;:&quot; + event.lineno + &quot;:&quot; + event.colno + &quot; &quot; + event.error);
</ins><span class="cx">         if (window.testRunner)
</span><span class="cx">             testRunner.notifyDone();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkLayoutTestsfastfilesworkersworkerapplybloburltoxhrhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/files/workers/worker-apply-blob-url-to-xhr.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/files/workers/worker-apply-blob-url-to-xhr.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/files/workers/worker-apply-blob-url-to-xhr.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx">     }
</span><span class="cx">     worker.onerror = function(event)
</span><span class="cx">     {
</span><del>-        log(&quot;Received error from worker: &quot; + event.message);
</del><ins>+        log(&quot;Received error from worker: &quot; + event.message + &quot; at &quot; + event.filename + &quot;:&quot; + event.lineno + &quot;:&quot; + event.colno + &quot; &quot; + event.error);
</ins><span class="cx">         if (window.testRunner)
</span><span class="cx">             testRunner.notifyDone();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkLayoutTestsfastworkersresourcesworkererrorinhandlingscripterrorjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/workers/resources/worker-error-in-handling-script-error.js (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/workers/resources/worker-error-in-handling-script-error.js        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/workers/resources/worker-error-in-handling-script-error.js        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-onerror = function(message, url, lineno)
</del><ins>+onerror = function(message, url, lineno, colno, error)
</ins><span class="cx"> {
</span><span class="cx">     bar.foo = 0;
</span><span class="cx">     return false;
</span></span></pre></div>
<a id="trunkLayoutTestsfastworkersresourcesworkerscripterrorbubbledjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/workers/resources/worker-script-error-bubbled.js (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/workers/resources/worker-script-error-bubbled.js        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/workers/resources/worker-script-error-bubbled.js        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,9 +1,9 @@
</span><del>-onerror = function(message, url, lineno)
</del><ins>+onerror = function(message, url, lineno, colno, error)
</ins><span class="cx"> {
</span><span class="cx">     if (url != location.href)
</span><span class="cx">         postMessage(&quot;FAIL: Bad location. Actual: &quot; + url + &quot; Expected: &quot; + location.href);
</span><span class="cx">     splitUrl = url.split('/');
</span><del>-    postMessage(&quot;PASS: onerror in worker context invoked for a script that has script error '&quot; + message + &quot;' at line &quot; + lineno + &quot; in &quot; + splitUrl[splitUrl.length - 1]);
</del><ins>+    postMessage(&quot;PASS: onerror in worker context invoked for a script that has script error '&quot; + message + &quot;' at &quot; + splitUrl[splitUrl.length - 1] + &quot;:&quot; + lineno + &quot;:&quot; + colno + &quot; with error object &quot; + error);
</ins><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastworkersresourcesworkerscripterrorhandledjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/workers/resources/worker-script-error-handled.js (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/workers/resources/worker-script-error-handled.js        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/workers/resources/worker-script-error-handled.js        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><del>-onerror = function(message, url, lineno, colno)
</del><ins>+onerror = function(message, url, lineno, colno, error)
</ins><span class="cx"> {
</span><del>-    postMessage(&quot;onerror invoked for a script that has script error '&quot; + message + &quot;' at line &quot; + lineno + &quot; and column &quot; + colno);
</del><ins>+    splitUrl = url.split('/');
+    postMessage(&quot;onerror invoked for a script that has script error '&quot; + message + &quot;' at &quot; + splitUrl[splitUrl.length - 1] + &quot;:&quot; + lineno + &quot;:&quot; + colno + &quot; with error object &quot; + error);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastworkersresourcesworkerscripterrorjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/workers/resources/worker-script-error.js (0 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/workers/resources/worker-script-error.js                                (rev 0)
+++ trunk/LayoutTests/fast/workers/resources/worker-script-error.js        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+self.addEventListener(&quot;error&quot;, function(event) {
+    self.postMessage(&quot;Worker saw: &quot; + event.error);
+});
+
+throw &quot;WorkerScriptError&quot;;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastworkersworkerscripterrorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/workers/worker-script-error-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/workers/worker-script-error-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/workers/worker-script-error-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -6,10 +6,12 @@
</span><span class="cx"> PASS: event listener invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1 and column 4.
</span><span class="cx"> PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7 and column 4.
</span><span class="cx"> PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: bar' at line 3 and column 8.
</span><del>-message from worker: &quot;PASS: onerror in worker context invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 10 in worker-script-error-bubbled.js&quot;.
</del><ins>+message from worker: &quot;PASS: onerror in worker context invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at worker-script-error-bubbled.js:10:4 with error object ReferenceError: Can't find variable: foo&quot;.
</ins><span class="cx"> PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 10 and column 4.
</span><span class="cx"> PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 10 and column 4.
</span><del>-PASS: message received from WorkerGlobalScope.onerror: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7 and column 14.
</del><ins>+PASS: message received from WorkerGlobalScope.onerror: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at worker-script-error-handled.js:8:14 with error object ReferenceError: Can't find variable: foo.
</ins><span class="cx"> PASS: onerror invoked for an exception in setTimeout callback.
</span><ins>+PASS: message received from WorkerGlobalScope.onerror: Worker saw: WorkerScriptError
+PASS: Main World saw error event with: null
</ins><span class="cx"> DONE
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastworkersworkerscripterrorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/workers/worker-script-error.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/workers/worker-script-error.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/fast/workers/worker-script-error.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -16,6 +16,7 @@
</span><span class="cx">     &quot;testScriptErrorBubbledAndReportedToUser&quot;,
</span><span class="cx">     &quot;testScriptErrorHandled&quot;,
</span><span class="cx">     &quot;testExceptionInTimeoutCallback&quot;,
</span><ins>+    &quot;testScriptErrorInWorkerAndSpawner&quot;,
</ins><span class="cx"> ];
</span><span class="cx"> var testIndex = 0;
</span><span class="cx"> 
</span><span class="lines">@@ -163,6 +164,23 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function testScriptErrorInWorkerAndSpawner()
+{
+    try {
+        var worker = new Worker(&quot;resources/worker-script-error.js&quot;);
+        worker.addEventListener(&quot;message&quot;, function(event) {
+            log(&quot;PASS: message received from WorkerGlobalScope.onerror: &quot; + event.data);
+        });
+        worker.addEventListener(&quot;error&quot;, function(event) {
+            log(&quot;PASS: Main World saw error event with: &quot; + event.error);
+            runNextTest();
+        });
+    } catch (ex) {
+        log(&quot;FAIL: unexpected exception &quot; + ex);
+        runNextTest();
+    }
+}
+
</ins><span class="cx"> if (window.testRunner) {
</span><span class="cx">     testRunner.dumpAsText();
</span><span class="cx">     testRunner.waitUntilDone();
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossoriginscripterroreventexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/security/cross-origin-script-error-event-expected.txt (0 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-origin-script-error-event-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/security/cross-origin-script-error-event-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+CONSOLE MESSAGE: line 1: SyntaxError: Unexpected identifier 'sensitive'
+Test that error events won't reveal any potentially sensitive script content if the latter is loaded from a different domain. The test passes if you don't see any data from the linked resource. Bug 52903.
+
+error event message: Script error. at : 0:0 null
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossoriginscripterroreventredirectedexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/security/cross-origin-script-error-event-redirected-expected.txt (0 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-origin-script-error-event-redirected-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/security/cross-origin-script-error-event-redirected-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+CONSOLE MESSAGE: line 1: SyntaxError: Unexpected identifier 'sensitive'
+Test that error events won't reveal any potentially sensitive script content if the latter is loaded from a different domain after a redirect. The test passes if you don't see any data from the linked resource. Bug 52903.
+
+error event message: Script error. at : 0:0 null
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossoriginscripterroreventredirectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/security/cross-origin-script-error-event-redirected.html (0 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-origin-script-error-event-redirected.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/security/cross-origin-script-error-event-redirected.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;
+Test that error events won't reveal any potentially sensitive script content if the latter is loaded from a different domain after a redirect. The test passes if you don't see any data from the linked resource. &lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=52903&quot;&gt;Bug 52903.&lt;/a&gt;
+&lt;/p&gt;
+&lt;div id=&quot;result&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+window.addEventListener('error', function(event) {
+    document.getElementById(&quot;result&quot;).textContent = &quot;error event message: &quot; + event.message + &quot; at &quot; + event.filename + &quot;: &quot; + event.lineno + &quot;:&quot; + event.colno + &quot; &quot; + event.error;
+    if (window.testRunner)
+        testRunner.notifyDone();
+    return true;
+});
+&lt;/script&gt;
+&lt;script src=&quot;/resources/redirect.php?url=http://localhost:8000/security/resources/cross-origin-script.txt&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossoriginscripterroreventhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/security/cross-origin-script-error-event.html (0 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-origin-script-error-event.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/security/cross-origin-script-error-event.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;
+Test that error events won't reveal any potentially sensitive script content if the latter is loaded from a different domain. The test passes if you don't see any data from the linked resource. &lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=52903&quot;&gt;Bug 52903.&lt;/a&gt;
+&lt;/p&gt;
+&lt;div id=&quot;result&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+window.addEventListener('error', function(event) {
+    document.getElementById(&quot;result&quot;).textContent = &quot;error event message: &quot; + event.message + &quot; at &quot; + event.filename + &quot;: &quot; + event.lineno + &quot;:&quot; + event.colno + &quot; &quot; + event.error;
+    if (window.testRunner)
+        testRunner.notifyDone();
+    return true;
+});
+&lt;/script&gt;
+&lt;script src=&quot;http://localhost:8000/security/resources/cross-origin-script.txt&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossoriginscriptwindowonerrorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><span class="cx"> Test that window.onerror won't reveal any potentially sensitive script content if the latter is loaded from a different domain. The test passes if you don't see any data from the linked resource. Bug 52903.
</span><span class="cx"> 
</span><del>-window.onerror message: Script error. at : 0
</del><ins>+window.onerror message: Script error. at : 0:0 null
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossoriginscriptwindowonerrorredirectedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror-redirected-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror-redirected-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror-redirected-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><span class="cx"> Test that window.onerror won't reveal any potentially sensitive script content if the latter is loaded from a different domain after a redirect. The test passes if you don't see any data from the linked resource. Bug 52903.
</span><span class="cx"> 
</span><del>-window.onerror message: Script error. at : 0
</del><ins>+window.onerror message: Script error. at :0:0 null
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossoriginscriptwindowonerrorredirectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror-redirected.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror-redirected.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror-redirected.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -10,8 +10,8 @@
</span><span class="cx">   testRunner.dumpAsText();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(message, url, line) {
-  document.getElementById(&quot;result&quot;).textContent = &quot;window.onerror message: &quot; + message + &quot; at &quot; + url + &quot;: &quot; + line;
</del><ins>+window.onerror = function(message, url, line, column, error) {
+  document.getElementById(&quot;result&quot;).textContent = &quot;window.onerror message: &quot; + message + &quot; at &quot; + url + &quot; :&quot; + line + &quot;:&quot; + column + &quot; &quot; + error;
</ins><span class="cx">   if (window.testRunner)
</span><span class="cx">     testRunner.notifyDone();
</span><span class="cx">   return true;
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossoriginscriptwindowonerrorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/http/tests/security/cross-origin-script-window-onerror.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -12,8 +12,8 @@
</span><span class="cx">   testRunner.dumpAsText();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(message, url, line) {
-  document.getElementById(&quot;result&quot;).textContent = &quot;window.onerror message: &quot; + message + &quot; at &quot; + url + &quot;: &quot; + line;
</del><ins>+window.onerror = function(message, url, line, column, error) {
+  document.getElementById(&quot;result&quot;).textContent = &quot;window.onerror message: &quot; + message + &quot; at &quot; + url + &quot;: &quot; + line + &quot;:&quot; + column + &quot; &quot; + error;
</ins><span class="cx">   if (window.testRunner)
</span><span class="cx">     testRunner.notifyDone();
</span><span class="cx">   return true;
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityscriptcrossoriginerroreventinformationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/security/script-crossorigin-error-event-information-expected.txt (0 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/script-crossorigin-error-event-information-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/security/script-crossorigin-error-event-information-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+CONSOLE MESSAGE: line 1: SomeError
+The test passes if error event gets unsanitized information about the script error.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS event.message.match(/SomeError/)[0] is &quot;SomeError&quot;
+PASS event.filename is &quot;http://localhost:8000/security/resources/cors-script.php?fail=true&quot;
+PASS event.lineno is 1
+PASS event.colno is 52
+PASS event.error.toString() is &quot;SomeError&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityscriptcrossoriginerroreventinformationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/security/script-crossorigin-error-event-information.html (0 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/script-crossorigin-error-event-information.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/security/script-crossorigin-error-event-information.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;head&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../js-test-resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+window.jsTestIsAsync = true;
+description(&quot;The test passes if error event gets unsanitized information about the script error.&quot;);
+
+window.addEventListener('error', function() {
+    shouldBeEqualToString(&quot;event.message.match(/SomeError/)[0]&quot;, &quot;SomeError&quot;);
+    shouldBeEqualToString(&quot;event.filename&quot;, &quot;http://localhost:8000/security/resources/cors-script.php?fail=true&quot;);
+    shouldBe(&quot;event.lineno&quot;, &quot;1&quot;);
+    shouldBe(&quot;event.colno&quot;, &quot;52&quot;);
+    shouldBeEqualToString(&quot;event.error.toString()&quot;, &quot;SomeError&quot;);
+    finishJSTest();
+});
+
+successfullyParsed = true;
+&lt;/script&gt;
+&lt;script crossorigin=&quot;anonymous&quot; src=&quot;http://localhost:8000/security/resources/cors-script.php?fail=true&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../js-test-resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityscriptcrossoriginonerrorinformationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/script-crossorigin-onerror-information-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/script-crossorigin-onerror-information-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/http/tests/security/script-crossorigin-onerror-information-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -7,6 +7,8 @@
</span><span class="cx"> PASS msg.match(/SomeError/)[0] is &quot;SomeError&quot;
</span><span class="cx"> PASS url is &quot;http://localhost:8000/security/resources/cors-script.php?fail=true&quot;
</span><span class="cx"> PASS line is 1
</span><ins>+PASS column is 52
+PASS error.toString() is &quot;SomeError&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityscriptcrossoriginonerrorinformationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/script-crossorigin-onerror-information.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/script-crossorigin-onerror-information.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/http/tests/security/script-crossorigin-onerror-information.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -7,13 +7,17 @@
</span><span class="cx"> window.jsTestIsAsync = true;
</span><span class="cx"> description(&quot;The test passes if window.onerror gets unsanitized information about the script error.&quot;);
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line) {
</del><ins>+window.onerror = function(msg, url, line, column, error) {
</ins><span class="cx">     window.msg = msg;
</span><span class="cx">     window.url = url;
</span><span class="cx">     window.line = line;
</span><ins>+    window.column = column;
+    window.error = error;
</ins><span class="cx">     shouldBeEqualToString(&quot;msg.match(/SomeError/)[0]&quot;, &quot;SomeError&quot;);
</span><span class="cx">     shouldBeEqualToString(&quot;url&quot;, &quot;http://localhost:8000/security/resources/cors-script.php?fail=true&quot;);
</span><span class="cx">     shouldBe(&quot;line&quot;, &quot;1&quot;);
</span><ins>+    shouldBe(&quot;column&quot;, &quot;52&quot;);
+    shouldBeEqualToString(&quot;error.toString()&quot;, &quot;SomeError&quot;);
</ins><span class="cx">     finishJSTest();
</span><span class="cx"> }
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityscriptnocrossoriginerroreventshouldbesanitizedexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/security/script-no-crossorigin-error-event-should-be-sanitized-expected.txt (0 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/script-no-crossorigin-error-event-should-be-sanitized-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/security/script-no-crossorigin-error-event-should-be-sanitized-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+CONSOLE MESSAGE: line 1: SomeError
+The test passes if error event gets sanitized information about the script error.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS event.message.match(/SomeError/) is null
+PASS event.filename is &quot;&quot;
+PASS event.lineno is 0
+PASS event.colno is 0
+PASS event.error is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityscriptnocrossoriginerroreventshouldbesanitizedhtmlfromrev202022trunkLayoutTestshttptestssecurityscriptnocrossoriginonerrorshouldbesanitizedhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/http/tests/security/script-no-crossorigin-error-event-should-be-sanitized.html (from rev 202022, trunk/LayoutTests/http/tests/security/script-no-crossorigin-onerror-should-be-sanitized.html) (0 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/script-no-crossorigin-error-event-should-be-sanitized.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/security/script-no-crossorigin-error-event-should-be-sanitized.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+&lt;body&gt;
+&lt;script src=&quot;../../js-test-resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+window.jsTestIsAsync = true;
+description(&quot;The test passes if error event gets sanitized information about the script error.&quot;);
+
+window.addEventListener('error', function() {
+    shouldBeNull(&quot;event.message.match(/SomeError/)&quot;);
+    shouldBeEqualToString(&quot;event.filename&quot;, &quot;&quot;);
+    shouldBe(&quot;event.lineno&quot;, &quot;0&quot;);
+    shouldBe(&quot;event.colno&quot;, &quot;0&quot;);
+    shouldBeNull(&quot;event.error&quot;);
+    finishJSTest();
+});
+
+successfullyParsed = true;
+&lt;/script&gt;
+&lt;!-- crossorigin attribute is not set, we shouldn't get any specific info on the error. --&gt;
+&lt;script src=&quot;http://localhost:8000/security/resources/cors-script.php?fail=true&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../js-test-resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityscriptnocrossoriginonerrorshouldbesanitizedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/script-no-crossorigin-onerror-should-be-sanitized-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/script-no-crossorigin-onerror-should-be-sanitized-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/http/tests/security/script-no-crossorigin-onerror-should-be-sanitized-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -7,6 +7,8 @@
</span><span class="cx"> PASS msg.match(/SomeError/) is null
</span><span class="cx"> PASS url is &quot;&quot;
</span><span class="cx"> PASS line is 0
</span><ins>+PASS column is 0
+PASS error is null
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityscriptnocrossoriginonerrorshouldbesanitizedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/script-no-crossorigin-onerror-should-be-sanitized.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/script-no-crossorigin-onerror-should-be-sanitized.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/http/tests/security/script-no-crossorigin-onerror-should-be-sanitized.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -4,13 +4,17 @@
</span><span class="cx"> window.jsTestIsAsync = true;
</span><span class="cx"> description(&quot;The test passes if window.onerror gets sanitized information about the script error.&quot;);
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line) {
</del><ins>+window.onerror = function(msg, url, line, column, error) {
</ins><span class="cx">     window.msg = msg;
</span><span class="cx">     window.url = url;
</span><span class="cx">     window.line = line;
</span><ins>+    window.column = column;
+    window.error = error;
</ins><span class="cx">     shouldBeNull(&quot;msg.match(/SomeError/)&quot;);
</span><span class="cx">     shouldBeEqualToString(&quot;url&quot;, &quot;&quot;);
</span><span class="cx">     shouldBe(&quot;line&quot;, &quot;0&quot;);
</span><ins>+    shouldBe(&quot;column&quot;, &quot;0&quot;);
+    shouldBeNull(&quot;error&quot;);
</ins><span class="cx">     finishJSTest();
</span><span class="cx"> }
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritywindowonerrorexceptioniniframeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/window-onerror-exception-in-iframe-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/window-onerror-exception-in-iframe-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/http/tests/security/window-onerror-exception-in-iframe-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> CONSOLE MESSAGE: line 7: IframeException
</span><span class="cx"> Test that exceptions in iframe are not reported to the main frame window.onerror handler. window.onerror should print exactly one line.
</span><span class="cx"> 
</span><del>-Main frame window.onerror: MainFrameException at window-onerror-exception-in-iframe.html:34
</del><ins>+Main frame window.onerror: MainFrameException at window-onerror-exception-in-iframe.html:34:27 MainFrameException
</ins><span class="cx"> DONE
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritywindowonerrorexceptioniniframehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/window-onerror-exception-in-iframe.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/window-onerror-exception-in-iframe.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/http/tests/security/window-onerror-exception-in-iframe.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -13,10 +13,10 @@
</span><span class="cx">     document.getElementById(&quot;result&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line)
</del><ins>+window.onerror = function(msg, url, line, column, error)
</ins><span class="cx"> {
</span><span class="cx">     url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
</span><del>-    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;:&quot; + line);
</del><ins>+    log(&quot;Main frame window.onerror: &quot; + msg + &quot; at &quot; + url + &quot;:&quot; + line + &quot;:&quot; + column + &quot; &quot; + error);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsworkersworkerimportScriptsOnErrorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/workers/worker-importScriptsOnError-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/workers/worker-importScriptsOnError-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/http/tests/workers/worker-importScriptsOnError-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> composedPath: function composedPath() { [native code] },
</span><span class="cx"> currentTarget: [object Worker],
</span><span class="cx"> defaultPrevented: false,
</span><ins>+error: null,
</ins><span class="cx"> eventPhase: 2,
</span><span class="cx"> filename: http://127.0.0.1:8000/workers/resources/worker-importScripts-error.js,
</span><span class="cx"> initEvent: function initEvent() { [native code] },
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-06-13  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        window.onerror should pass the ErrorEvent's 'error' property as the 5th argument to the event handler
+        https://bugs.webkit.org/show_bug.cgi?id=55092
+        &lt;rdar://problem/25731279&gt;
+
+        Reviewed by Dean Jackson.
+
+        * web-platform-tests/html/dom/interfaces-expected.txt:
+
</ins><span class="cx"> 2016-06-08  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Import new AddEventListenerOptions test from W3C web-platform-tests
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmldominterfacesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -4554,7 +4554,7 @@
</span><span class="cx"> PASS ErrorEvent interface: attribute filename 
</span><span class="cx"> PASS ErrorEvent interface: attribute lineno 
</span><span class="cx"> PASS ErrorEvent interface: attribute colno 
</span><del>-FAIL ErrorEvent interface: attribute error assert_true: The prototype object must have a property &quot;error&quot; expected true got false
</del><ins>+PASS ErrorEvent interface: attribute error 
</ins><span class="cx"> PASS Navigator interface: existence and properties of interface object 
</span><span class="cx"> PASS Navigator interface object length 
</span><span class="cx"> PASS Navigator interface object name 
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomexceptionlinenumberexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/exception-line-number-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/exception-line-number-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/js/dom/exception-line-number-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> PASS result is &quot;LayoutTests/js/dom/script-tests/exception-line-number.js:6,LayoutTests/js/dom/script-tests/exception-line-number.js:11&quot;
</span><del>-PASS result is &quot;LayoutTests/js/dom/script-tests/exception-line-number.js:36&quot;
</del><ins>+PASS result is &quot;LayoutTests/js/dom/script-tests/exception-line-number.js:36:15&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomscripttestsexceptionlinenumberjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/script-tests/exception-line-number.js (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/script-tests/exception-line-number.js        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/js/dom/script-tests/exception-line-number.js        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -25,10 +25,10 @@
</span><span class="cx"> 
</span><span class="cx"> // Test window.onerror:
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line) {
</del><ins>+window.onerror = function(msg, url, line, column, error) {
</ins><span class="cx">     url = String(url.match(/LayoutTests\/[^:]+/g));
</span><del>-    result = url + ':' + line;
-    shouldBe(&quot;result&quot;, '&quot;LayoutTests/js/dom/script-tests/exception-line-number.js:36&quot;');
</del><ins>+    result = url + ':' + line + ':' + column;
+    shouldBe(&quot;result&quot;, '&quot;LayoutTests/js/dom/script-tests/exception-line-number.js:36:15&quot;');
</ins><span class="cx">     return true;  // We handled it.
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/wk2/TestExpectations (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wk2/TestExpectations        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/platform/wk2/TestExpectations        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -528,8 +528,9 @@
</span><span class="cx"> http/tests/navigation/redirect-on-reload-updates-history-item.html
</span><span class="cx"> 
</span><span class="cx"> # Newly added test fails in WebKit2 for mysterious reasons
</span><del>-userscripts/window-onerror-for-isolated-world-1.html
-userscripts/window-onerror-for-isolated-world-2.html
</del><ins>+webkit.org/b/158703 userscripts/window-onerror-for-isolated-world-1.html [ Skip ]
+webkit.org/b/158703 userscripts/window-onerror-for-isolated-world-2.html [ Skip ]
+webkit.org/b/158703 userscripts/window-onerror-for-isolated-world-3.html [ Skip ]
</ins><span class="cx"> 
</span><span class="cx"> # These transition tests are flaky, sometimes it seems like the transition timing
</span><span class="cx"> # is off when the test completes
</span></span></pre></div>
<a id="trunkLayoutTestsuserscriptswindowonerrorforisolatedworld1expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-1-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-1-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-1-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,14 +1,14 @@
</span><span class="cx"> Test that window.onerror and &quot;error&quot; event listeners from main world are invoked for uncaught exceptions in user scripts running in isolate worlds as well as for exceptions in the main world.Bug 8519.
</span><span class="cx"> 
</span><del>-Main world window.onerror: Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:55
-Main world error event listener: Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:55
-Main world window.onerror: Error: Error in user script inline script. at undefined:12
-Main world error event listener: Error: Error in user script inline script. at undefined:12
-Main world window.onerror: Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:51
-Main world error event listener: Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:51
-Main world window.onerror: Error: Error in user script load handler. at undefined:8
-Main world error event listener: Error: Error in user script load handler. at undefined:8
-Main world window.onerror: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:49
-Main world error event listener: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:49
-Main world window.onerror: Error: Error in user script setTimeout callback. at undefined:6
-Main world error event listener: Error: Error in user script setTimeout callback. at undefined:6
</del><ins>+Main world window.onerror: Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:55:68 Error: Error in main world inline script.
+Main world error event listener: Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:55:68 Error: Error in main world inline script.
+Main world window.onerror: Error: Error in user script inline script. at undefined:12:20 null
+Main world error event listener: Error: Error in user script inline script. at undefined:12:20 null
+Main world window.onerror: Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:51:72 Error: Error in main world load handler.
+Main world error event listener: Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:51:72 Error: Error in main world load handler.
+Main world window.onerror: Error: Error in user script load handler. at undefined:8:24 null
+Main world error event listener: Error: Error in user script load handler. at undefined:8:24 null
+Main world window.onerror: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:49:83 Error: Error in main world setTimeout callback.
+Main world error event listener: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:49:83 Error: Error in main world setTimeout callback.
+Main world window.onerror: Error: Error in user script setTimeout callback. at undefined:6:28 null
+Main world error event listener: Error: Error in user script setTimeout callback. at undefined:6:28 null
</ins></span></pre></div>
<a id="trunkLayoutTestsuserscriptswindowonerrorforisolatedworld1html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-1.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-1.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-1.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -28,16 +28,16 @@
</span><span class="cx">     return url ? url.match( /[^\/]+\/?$/ )[0] : url;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.onerror = function(msg, url, line)
</del><ins>+window.onerror = function(msg, url, line, column, error)
</ins><span class="cx"> {
</span><del>-    log(&quot;Main world window.onerror: &quot; + msg + &quot; at &quot; + lastUrlComponent(url) + &quot;:&quot; + line);
</del><ins>+    log(&quot;Main world window.onerror: &quot; + msg + &quot; at &quot; + lastUrlComponent(url) + &quot;:&quot; + line + &quot;:&quot; + column + &quot; &quot; + error);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> window.addEventListener(&quot;error&quot;, function(e)
</span><span class="cx"> {
</span><span class="cx">     var url = lastUrlComponent(e.filename);
</span><del>-    log(&quot;Main world error event listener: &quot; + e.message + &quot; at &quot; + url + &quot;:&quot; + e.lineno);
</del><ins>+    log(&quot;Main world error event listener: &quot; + e.message + &quot; at &quot; + url + &quot;:&quot; + e.lineno + &quot;:&quot; + e.colno + &quot; &quot; + e.error);
</ins><span class="cx">     e.preventDefault();
</span><span class="cx"> }, false);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsuserscriptswindowonerrorforisolatedworld2expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-2-expected.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-2-expected.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-2-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,13 +1,13 @@
</span><span class="cx"> CONSOLE MESSAGE: line 30: Error: Error in main world inline script.
</span><span class="cx"> Test that window.onerror and &quot;error&quot; event listeners from isolated world are invoked for uncaught exceptions in user scripts running in isolate worlds as well as for exceptions in the main world.Bug 8519.
</span><span class="cx"> 
</span><del>-user script window.onerror: Error: Error in user script inline script. at undefined:33
-user script error event listener: Error: Error in user script inline script. at undefined:33
-user script window.onerror: Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:27
-user script error event listener: Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:27
-user script window.onerror: Error: Error in user script load handler. at undefined:30
-user script error event listener: Error: Error in user script load handler. at undefined:30
-user script window.onerror: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:25
-user script error event listener: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:25
-user script window.onerror: Error: Error in user script setTimeout callback. at undefined:28
-user script error event listener: Error: Error in user script setTimeout callback. at undefined:28
</del><ins>+user script window.onerror: Error: Error in user script inline script. at undefined:33:20 Error: Error in user script inline script.
+user script error event listener: Error: Error in user script inline script. at undefined:33:20 Error: Error in user script inline script.
+user script window.onerror: Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:27:72 null
+user script error event listener: Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:27:72 null
+user script window.onerror: Error: Error in user script load handler. at undefined:30:24 Error: Error in user script load handler.
+user script error event listener: Error: Error in user script load handler. at undefined:30:24 Error: Error in user script load handler.
+user script window.onerror: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:25:83 null
+user script error event listener: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:25:83 null
+user script window.onerror: Error: Error in user script setTimeout callback. at undefined:28:28 Error: Error in user script setTimeout callback.
+user script error event listener: Error: Error in user script setTimeout callback. at undefined:28:28 Error: Error in user script setTimeout callback.
</ins></span></pre></div>
<a id="trunkLayoutTestsuserscriptswindowonerrorforisolatedworld2html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-2.html (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-2.html        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-2.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -42,14 +42,14 @@
</span><span class="cx">         document.getElementById(&quot;console&quot;).appendChild(record);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    window.onerror = function(msg, url, line) {
-        log(isolatedWorld + &quot; window.onerror: &quot; + msg + &quot; at &quot; + lastUrlComponent(url) + &quot;:&quot; + line, &quot;*&quot;);
</del><ins>+    window.onerror = function(msg, url, line, column, error) {
+        log(isolatedWorld + &quot; window.onerror: &quot; + msg + &quot; at &quot; + lastUrlComponent(url) + &quot;:&quot; + line + &quot;:&quot; + column + &quot; &quot; + error, &quot;*&quot;);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     window.addEventListener(&quot;error&quot;, function(e) {
</span><span class="cx">         var url = lastUrlComponent(e.filename);
</span><del>-        log(isolatedWorld + &quot; error event listener: &quot; + e.message + &quot; at &quot; + url + &quot;:&quot; + e.lineno, &quot;*&quot;);
</del><ins>+        log(isolatedWorld + &quot; error event listener: &quot; + e.message + &quot; at &quot; + url + &quot;:&quot; + e.lineno + &quot;:&quot; + e.colno + &quot; &quot; + e.error, &quot;*&quot;);
</ins><span class="cx">         e.preventDefault();
</span><span class="cx">     }, false);
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkLayoutTestsuserscriptswindowonerrorforisolatedworld3expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-3-expected.txt (0 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-3-expected.txt                                (rev 0)
+++ trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-3-expected.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Test that window.onerror and &quot;error&quot; event listeners from main world are invoked for uncaught exceptions in the main world, user scripts, isolated worlds. The `error` object in the event is sanitized out across worlds.
+
+
+User Script
+Main world window.onerror: SerializableError from (user script) at :5:59 SerializableError from (user script)
+Main world error event listener: SerializableError from (user script) at :5:59 SerializableError from (user script)
+Main world window.onerror: [object Window] at undefined:0:0 null
+Main world error event listener: [object Window] at undefined:0:0 null
+
+Main World
+Main world window.onerror: SerializableError from (main world) at window-onerror-for-isolated-world-3.html:49:59 SerializableError from (main world)
+Main world error event listener: SerializableError from (main world) at window-onerror-for-isolated-world-3.html:49:59 SerializableError from (main world)
+Main world window.onerror: [object Window] at window-onerror-for-isolated-world-3.html:55:27 [object Window]
+Main world error event listener: [object Window] at window-onerror-for-isolated-world-3.html:55:27 [object Window]
+
+Isolated World
+Main world window.onerror: SerializableError from (isolated script) at window-onerror-for-isolated-world-3.html:5:59 SerializableError from (isolated script)
+Main world error event listener: SerializableError from (isolated script) at window-onerror-for-isolated-world-3.html:5:59 SerializableError from (isolated script)
+Main world window.onerror: [object Window] at window-onerror-for-isolated-world-3.html:11:27 null
+Main world error event listener: [object Window] at window-onerror-for-isolated-world-3.html:11:27 null
</ins></span></pre></div>
<a id="trunkLayoutTestsuserscriptswindowonerrorforisolatedworld3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-3.html (0 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-3.html                                (rev 0)
+++ trunk/LayoutTests/userscripts/window-onerror-for-isolated-world-3.html        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Test that window.onerror and &quot;error&quot; event listeners from main world are
+invoked for uncaught exceptions in the main world, user scripts, isolated worlds.
+The `error` object in the event is sanitized out across worlds.&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+var recordCount = 0;
+var expectedRecordCount = (2 * 2 * 3);
+function checkEnd() {
+    recordCount++;
+    if (recordCount === expectedRecordCount)
+        testRunner.notifyDone();
+}
+
+function log(msg) {
+    var record = document.createElement(&quot;div&quot;);
+    record.textContent = msg;
+    document.getElementById(&quot;console&quot;).appendChild(record);
+}
+
+function header(msg) {
+    document.getElementById(&quot;console&quot;).append(document.createElement(&quot;br&quot;), msg);
+}
+
+function lastUrlComponent(url) {
+    return url ? url.match( /[^\/]+\/?$/ )[0] : url;
+}
+
+window.onerror = function(msg, url, line, column, error) {
+    log(&quot;Main world window.onerror: &quot; + msg + &quot; at &quot; + lastUrlComponent(url) + &quot;:&quot; + line + &quot;:&quot; + column + &quot; &quot; + error);
+    checkEnd();
+    return true;
+}
+
+window.addEventListener(&quot;error&quot;, function(e) {
+    log(&quot;Main world error event listener: &quot; + e.message + &quot; at &quot; + lastUrlComponent(e.filename) + &quot;:&quot; + e.lineno + &quot;:&quot; + e.colno + &quot; &quot; + e.error);
+    checkEnd();
+    e.preventDefault();
+});
+
+function triggerExceptions(worldName)
+{
+    // Serializable error data is fine.
+    setTimeout(function() {
+        throw &quot;SerializableError from (&quot; + worldName + &quot;)&quot;;
+    }, 0);
+
+    // Non-serializable data should be null.
+    setTimeout(function() {
+        var globalObject = (1, eval)('this');
+        throw globalObject;
+    }, 0);
+}
+
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+header(&quot;User Script&quot;);
+testRunner.addUserScript(&quot;(&quot; + triggerExceptions + &quot;)('user script')&quot;, false, true);
+
+setTimeout(function() {
+    header(&quot;Main World&quot;);
+    triggerExceptions(&quot;main world&quot;);
+}, 50);
+
+setTimeout(function() {
+    header(&quot;Isolated World&quot;);
+    testRunner.evaluateScriptInIsolatedWorld(0, &quot;(&quot; + triggerExceptions + &quot;)('isolated script')&quot;);
+}, 100);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1139,6 +1139,7 @@
</span><span class="cx">     bindings/js/JSDocumentFragmentCustom.cpp
</span><span class="cx">     bindings/js/JSDocumentTypeCustom.cpp
</span><span class="cx">     bindings/js/JSElementCustom.cpp
</span><ins>+    bindings/js/JSErrorEventCustom.cpp
</ins><span class="cx">     bindings/js/JSErrorHandler.cpp
</span><span class="cx">     bindings/js/JSEventCustom.cpp
</span><span class="cx">     bindings/js/JSEventListener.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/ChangeLog        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,3 +1,71 @@
</span><ins>+2016-06-13  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        window.onerror should pass the ErrorEvent's 'error' property as the 5th argument to the event handler
+        https://bugs.webkit.org/show_bug.cgi?id=55092
+        &lt;rdar://problem/25731279&gt;
+
+        Reviewed by Dean Jackson.
+
+        This includes the actual Error in window.error / ErrorEvent:
+        https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
+
+        This is useful for scripts to be able to get an error stack
+        from uncaught exceptions, by checking the error itself.
+
+        Tests: fast/events/window-onerror17.html
+               http/tests/security/cross-origin-script-error-event-redirected.html
+               http/tests/security/cross-origin-script-error-event.html
+               http/tests/security/script-crossorigin-error-event-information.html
+               http/tests/security/script-no-crossorigin-error-event-should-be-sanitized.html
+               userscripts/window-onerror-for-isolated-world-3.html
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSBindingsAllInOne.cpp:
+        Add new custom error event file.
+
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::reportException):
+        Include the JSC::Exception when reporting exceptions, so the error value is available.
+        
+        * bindings/js/JSErrorEventCustom.cpp:
+        (WebCore::JSErrorEvent::error):
+        Sanitized access to the ErrorEvent's error property to prevent leaking objects
+        across isolated world boundaries. This is like CustomEvent's data property.
+
+        * bindings/js/JSErrorHandler.cpp:
+        (WebCore::JSErrorHandler::handleEvent):
+        * bindings/js/JSErrorHandler.h:
+        Include the error object as the 4th argument to the window.onerror event handler.
+
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::sanitizeScriptError):
+        (WebCore::ScriptExecutionContext::reportException):
+        (WebCore::ScriptExecutionContext::dispatchErrorEvent):
+        * dom/ScriptExecutionContext.h:
+        Include the error object in the ErrorEvent constructed when dispatching error events.
+
+        * dom/ErrorEvent.cpp:
+        (WebCore::ErrorEvent::ErrorEvent):
+        (WebCore::ErrorEvent::sanitizedErrorValue):
+        (WebCore::ErrorEvent::trySerializeError):
+        * dom/ErrorEvent.h:
+        * dom/ErrorEvent.idl:
+        Include an any &quot;error&quot; property on the ErrorEvent, and allow it in initialization.
+
+        * bindings/js/WorkerScriptController.cpp:
+        (WebCore::WorkerScriptController::evaluate):
+        * workers/WorkerMessagingProxy.cpp:
+        (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
+        Within the Worker world, the error is included in the event.
+        When re-dispatching the error on the world object in the world that spawned the
+        Worker the event does not include an error object. This matches other browsers
+        right now, but could be improved to have the same cross world serialization
+        as isolated worlds have with the error data.
+
+        * dom/CustomEvent.h:
+        Remove unimplemented stale method.
+
</ins><span class="cx"> 2016-06-13  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         SVG elements don't blend correctly into HTML
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -4212,6 +4212,7 @@
</span><span class="cx">                 A55639D21C6F09E700806D8E /* WorkerConsoleClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A55639CF1C6EFD5900806D8E /* WorkerConsoleClient.cpp */; };
</span><span class="cx">                 A56C5B9A189F34570082D13C /* WebConsoleAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A56C5B98189F34570082D13C /* WebConsoleAgent.cpp */; };
</span><span class="cx">                 A56C5B9B189F34570082D13C /* WebConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A56C5B99189F34570082D13C /* WebConsoleAgent.h */; };
</span><ins>+                A56D02A31D0BAD680095E5D3 /* JSErrorEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A56D02A21D0B9AF30095E5D3 /* JSErrorEventCustom.cpp */; };
</ins><span class="cx">                 A5732B0A136A161D005C8D7C /* DateComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5732B08136A161D005C8D7C /* DateComponents.cpp */; };
</span><span class="cx">                 A5732B0B136A161D005C8D7C /* DateComponents.h in Headers */ = {isa = PBXBuildFile; fileRef = A5732B09136A161D005C8D7C /* DateComponents.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A5840E1C187B74D500843B10 /* InspectorInstrumentationCookie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5840E1A187B74D500843B10 /* InspectorInstrumentationCookie.cpp */; };
</span><span class="lines">@@ -11947,6 +11948,7 @@
</span><span class="cx">                 A55639D01C6EFD5900806D8E /* WorkerConsoleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerConsoleClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A56C5B98189F34570082D13C /* WebConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebConsoleAgent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A56C5B99189F34570082D13C /* WebConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebConsoleAgent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A56D02A21D0B9AF30095E5D3 /* JSErrorEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorEventCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A5732B08136A161D005C8D7C /* DateComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateComponents.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5732B09136A161D005C8D7C /* DateComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateComponents.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5840E1A187B74D500843B10 /* InspectorInstrumentationCookie.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorInstrumentationCookie.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -22502,6 +22504,7 @@
</span><span class="cx">                                 652FBBBB0DE27CB60001D386 /* JSDOMWindowCustom.h */,
</span><span class="cx">                                 BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */,
</span><span class="cx">                                 ADEC78F718EE5308001315C2 /* JSElementCustom.h */,
</span><ins>+                                A56D02A21D0B9AF30095E5D3 /* JSErrorEventCustom.cpp */,
</ins><span class="cx">                                 BCEFAF4D0C317E6900FA81F6 /* JSEventCustom.cpp */,
</span><span class="cx">                                 516E54F91CCB27FF0040D954 /* JSFileCustom.cpp */,
</span><span class="cx">                                 2E7582ED12764F260062628B /* JSFileReaderCustom.cpp */,
</span><span class="lines">@@ -30192,6 +30195,7 @@
</span><span class="cx">                                 7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */,
</span><span class="cx">                                 4F6FDD641341DEDD001F8EE3 /* InspectorPageAgent.cpp in Sources */,
</span><span class="cx">                                 99CC0B6618BE9F15006CEBCC /* InspectorReplayAgent.cpp in Sources */,
</span><ins>+                                A56D02A31D0BAD680095E5D3 /* JSErrorEventCustom.cpp in Sources */,
</ins><span class="cx">                                 82AB1773125C826700C5069D /* InspectorStyleSheet.cpp in Sources */,
</span><span class="cx">                                 754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */,
</span><span class="cx">                                 F350B73513F1377D00880C43 /* InstrumentingAgents.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -72,6 +72,7 @@
</span><span class="cx"> #include &quot;JSDocumentFragmentCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSDocumentTypeCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSElementCustom.cpp&quot;
</span><ins>+#include &quot;JSErrorEventCustom.cpp&quot;
</ins><span class="cx"> #include &quot;JSErrorHandler.cpp&quot;
</span><span class="cx"> #include &quot;JSEventCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSEventListener.cpp&quot;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCustomEventCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCustomEventCustom.cpp (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCustomEventCustom.cpp        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/bindings/js/JSCustomEventCustom.cpp        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx">     auto&amp; event = wrapped();
</span><span class="cx"> 
</span><span class="cx">     auto detail = event.detail();
</span><del>-
</del><span class="cx">     if (!detail)
</span><span class="cx">         return jsNull();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -201,7 +201,7 @@
</span><span class="cx">         errorMessage = exceptionBase-&gt;message() + &quot;: &quot;  + exceptionBase-&gt;description();
</span><span class="cx">     else {
</span><span class="cx">         // FIXME: &lt;http://webkit.org/b/115087&gt; Web Inspector: WebCore::reportException should not evaluate JavaScript handling exceptions
</span><del>-        // If this is a custon exception object, call toString on it to try and get a nice string representation for the exception.
</del><ins>+        // If this is a custom exception object, call toString on it to try and get a nice string representation for the exception.
</ins><span class="cx">         errorMessage = exception-&gt;value().toString(exec)-&gt;value(exec);
</span><span class="cx"> 
</span><span class="cx">         // We need to clear any new exception that may be thrown in the toString() call above.
</span><span class="lines">@@ -211,7 +211,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ScriptExecutionContext* scriptExecutionContext = globalObject-&gt;scriptExecutionContext();
</span><del>-    scriptExecutionContext-&gt;reportException(errorMessage, lineNumber, columnNumber, exceptionSourceURL, callStack-&gt;size() ? callStack : 0, cachedScript);
</del><ins>+    scriptExecutionContext-&gt;reportException(errorMessage, lineNumber, columnNumber, exceptionSourceURL, exception, callStack-&gt;size() ? callStack : nullptr, cachedScript);
</ins><span class="cx"> 
</span><span class="cx">     if (exceptionDetails) {
</span><span class="cx">         exceptionDetails-&gt;message = errorMessage;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSErrorEventCustomcppfromrev202022trunkSourceWebCorebindingsjsJSCustomEventCustomcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/js/JSErrorEventCustom.cpp (from rev 202022, trunk/Source/WebCore/bindings/js/JSCustomEventCustom.cpp) (0 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSErrorEventCustom.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSErrorEventCustom.cpp        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;JSErrorEvent.h&quot;
+
+#include &quot;ErrorEvent.h&quot;
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSErrorEvent::error(ExecState&amp; state) const
+{
+    return wrapped().sanitizedErrorValue(state, *globalObject());
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSErrorHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -94,6 +94,7 @@
</span><span class="cx">         args.append(jsStringWithCache(exec, errorEvent.filename()));
</span><span class="cx">         args.append(jsNumber(errorEvent.lineno()));
</span><span class="cx">         args.append(jsNumber(errorEvent.colno()));
</span><ins>+        args.append(errorEvent.sanitizedErrorValue(*exec, *globalObject));
</ins><span class="cx"> 
</span><span class="cx">         VM&amp; vm = globalObject-&gt;vm();
</span><span class="cx">         VMEntryScope entryScope(vm, vm.entryScope ? vm.entryScope-&gt;globalObject() : globalObject);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSErrorHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSErrorHandler.h (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSErrorHandler.h        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/bindings/js/JSErrorHandler.h        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class JSErrorHandler : public JSEventListener {
</del><ins>+class JSErrorHandler final : public JSEventListener {
</ins><span class="cx"> public:
</span><span class="cx">     static Ref&lt;JSErrorHandler&gt; create(JSC::JSObject* listener, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld&amp; world)
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWorkerScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -141,7 +141,8 @@
</span><span class="cx">         int lineNumber = 0;
</span><span class="cx">         int columnNumber = 0;
</span><span class="cx">         String sourceURL = sourceCode.url().string();
</span><del>-        if (m_workerGlobalScope-&gt;sanitizeScriptError(errorMessage, lineNumber, columnNumber, sourceURL, sourceCode.cachedScript())) {
</del><ins>+        Deprecated::ScriptValue error;
+        if (m_workerGlobalScope-&gt;sanitizeScriptError(errorMessage, lineNumber, columnNumber, sourceURL, error, sourceCode.cachedScript())) {
</ins><span class="cx">             vm.throwException(exec, createError(exec, errorMessage.impl()));
</span><span class="cx">             returnedException = vm.exception();
</span><span class="cx">             vm.clearException();
</span></span></pre></div>
<a id="trunkSourceWebCoredomCustomEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CustomEvent.h (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CustomEvent.h        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/dom/CustomEvent.h        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -57,7 +57,6 @@
</span><span class="cx">     JSC::JSValue detail() const { return m_detail.jsValue(); }
</span><span class="cx">     
</span><span class="cx">     RefPtr&lt;SerializedScriptValue&gt; trySerializeDetail(JSC::ExecState&amp;);
</span><del>-    void visitAdditionalChildren(JSC::SlotVisitor&amp;);
</del><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     CustomEvent();
</span></span></pre></div>
<a id="trunkSourceWebCoredomErrorEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ErrorEvent.cpp (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ErrorEvent.cpp        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/dom/ErrorEvent.cpp        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2009 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -31,8 +32,11 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;ErrorEvent.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;DOMWrapperWorld.h&quot;
</ins><span class="cx"> #include &quot;EventNames.h&quot;
</span><span class="cx"> 
</span><ins>+using namespace JSC;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> ErrorEvent::ErrorEvent(const AtomicString&amp; type, const ErrorEventInit&amp; initializer)
</span><span class="lines">@@ -41,15 +45,17 @@
</span><span class="cx">     , m_fileName(initializer.filename)
</span><span class="cx">     , m_lineNumber(initializer.lineno)
</span><span class="cx">     , m_columnNumber(initializer.colno)
</span><ins>+    , m_error(initializer.error)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ErrorEvent::ErrorEvent(const String&amp; message, const String&amp; fileName, unsigned lineNumber, unsigned columnNumber)
</del><ins>+ErrorEvent::ErrorEvent(const String&amp; message, const String&amp; fileName, unsigned lineNumber, unsigned columnNumber, const Deprecated::ScriptValue&amp; error)
</ins><span class="cx">     : Event(eventNames().errorEvent, false, true)
</span><span class="cx">     , m_message(message)
</span><span class="cx">     , m_fileName(fileName)
</span><span class="cx">     , m_lineNumber(lineNumber)
</span><span class="cx">     , m_columnNumber(columnNumber)
</span><ins>+    , m_error(error)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -62,6 +68,33 @@
</span><span class="cx">     return ErrorEventInterfaceType;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSValue ErrorEvent::sanitizedErrorValue(ExecState&amp; exec, JSGlobalObject&amp; globalObject)
+{    
+    auto error = m_error.jsValue();
+    if (!error)
+        return jsNull();
+
+    if (error.isObject() &amp;&amp; &amp;worldForDOMObject(error.getObject()) != &amp;currentWorld(&amp;exec)) {
+        // We need to make sure ErrorEvents do not leak their error property across isolated DOM worlds.
+        // Ideally, we would check that the worlds have different privileges but that's not possible yet.
+        auto serializedError = trySerializeError(exec);
+        if (!serializedError)
+            return jsNull();
+        return serializedError-&gt;deserialize(&amp;exec, &amp;globalObject, nullptr);
+    }
+
+    return error;
+}
+
+RefPtr&lt;SerializedScriptValue&gt; ErrorEvent::trySerializeError(ExecState&amp; exec)
+{
+    if (!m_triedToSerialize) {
+        m_serializedDetail = SerializedScriptValue::create(&amp;exec, m_error, nullptr, nullptr, NonThrowing);
+        m_triedToSerialize = true;
+    }
+    return m_serializedDetail;
+}
+
</ins><span class="cx"> bool ErrorEvent::isErrorEvent() const
</span><span class="cx"> {
</span><span class="cx">     return true;
</span></span></pre></div>
<a id="trunkSourceWebCoredomErrorEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ErrorEvent.h (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ErrorEvent.h        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/dom/ErrorEvent.h        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2009 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -32,6 +33,8 @@
</span><span class="cx"> #define ErrorEvent_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Event.h&quot;
</span><ins>+#include &quot;SerializedScriptValue.h&quot;
+#include &lt;bindings/ScriptValue.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -41,13 +44,14 @@
</span><span class="cx">     String filename;
</span><span class="cx">     unsigned lineno { 0 };
</span><span class="cx">     unsigned colno { 0 };
</span><ins>+    Deprecated::ScriptValue error;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class ErrorEvent final : public Event {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;ErrorEvent&gt; create(const String&amp; message, const String&amp; fileName, unsigned lineNumber, unsigned columnNumber)
</del><ins>+    static Ref&lt;ErrorEvent&gt; create(const String&amp; message, const String&amp; fileName, unsigned lineNumber, unsigned columnNumber, const Deprecated::ScriptValue&amp; error)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new ErrorEvent(message, fileName, lineNumber, columnNumber));
</del><ins>+        return adoptRef(*new ErrorEvent(message, fileName, lineNumber, columnNumber, error));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static Ref&lt;ErrorEvent&gt; createForBindings(const AtomicString&amp; type, const ErrorEventInit&amp; initializer)
</span><span class="lines">@@ -61,19 +65,26 @@
</span><span class="cx">     const String&amp; filename() const { return m_fileName; }
</span><span class="cx">     unsigned lineno() const { return m_lineNumber; }
</span><span class="cx">     unsigned colno() const { return m_columnNumber; }
</span><ins>+    const Deprecated::ScriptValue&amp; error() const { return m_error; }
+    JSC::JSValue sanitizedErrorValue(JSC::ExecState&amp;, JSC::JSGlobalObject&amp;);
</ins><span class="cx"> 
</span><span class="cx">     EventInterface eventInterface() const override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    ErrorEvent(const String&amp; message, const String&amp; fileName, unsigned lineNumber, unsigned columnNumber);
</del><ins>+    ErrorEvent(const String&amp; message, const String&amp; fileName, unsigned lineNumber, unsigned columnNumber, const Deprecated::ScriptValue&amp; error);
</ins><span class="cx">     ErrorEvent(const AtomicString&amp;, const ErrorEventInit&amp;);
</span><span class="cx"> 
</span><ins>+    RefPtr&lt;SerializedScriptValue&gt; trySerializeError(JSC::ExecState&amp;);
+
</ins><span class="cx">     bool isErrorEvent() const override;
</span><span class="cx"> 
</span><span class="cx">     String m_message;
</span><span class="cx">     String m_fileName;
</span><span class="cx">     unsigned m_lineNumber;
</span><span class="cx">     unsigned m_columnNumber;
</span><ins>+    Deprecated::ScriptValue m_error;
+    RefPtr&lt;SerializedScriptValue&gt; m_serializedDetail;
+    bool m_triedToSerialize { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomErrorEventidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ErrorEvent.idl (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ErrorEvent.idl        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/dom/ErrorEvent.idl        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2009 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2016 Apple Inc. All Rights Reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -36,5 +37,6 @@
</span><span class="cx">     [InitializedByEventConstructor] readonly attribute DOMString filename;
</span><span class="cx">     [InitializedByEventConstructor] readonly attribute unsigned long lineno;
</span><span class="cx">     [InitializedByEventConstructor] readonly attribute unsigned long colno;
</span><ins>+    [InitializedByEventConstructor, CustomGetter] readonly attribute any error;
</ins><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptExecutionContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.cpp (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptExecutionContext.cpp        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.cpp        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include &quot;WorkerGlobalScope.h&quot;
</span><span class="cx"> #include &quot;WorkerThread.h&quot;
</span><span class="cx"> #include &lt;inspector/ScriptCallStack.h&gt;
</span><ins>+#include &lt;runtime/Exception.h&gt;
</ins><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -348,7 +349,7 @@
</span><span class="cx">     m_destructionObservers.remove(&amp;observer);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool ScriptExecutionContext::sanitizeScriptError(String&amp; errorMessage, int&amp; lineNumber, int&amp; columnNumber, String&amp; sourceURL, CachedScript* cachedScript)
</del><ins>+bool ScriptExecutionContext::sanitizeScriptError(String&amp; errorMessage, int&amp; lineNumber, int&amp; columnNumber, String&amp; sourceURL, Deprecated::ScriptValue&amp; error, CachedScript* cachedScript)
</ins><span class="cx"> {
</span><span class="cx">     URL targetURL = completeURL(sourceURL);
</span><span class="cx">     if (securityOrigin()-&gt;canRequest(targetURL) || (cachedScript &amp;&amp; cachedScript-&gt;passesAccessControlCheck(*securityOrigin())))
</span><span class="lines">@@ -357,10 +358,11 @@
</span><span class="cx">     sourceURL = String();
</span><span class="cx">     lineNumber = 0;
</span><span class="cx">     columnNumber = 0;
</span><ins>+    error = Deprecated::ScriptValue();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScriptExecutionContext::reportException(const String&amp; errorMessage, int lineNumber, int columnNumber, const String&amp; sourceURL, RefPtr&lt;ScriptCallStack&gt;&amp;&amp; callStack, CachedScript* cachedScript)
</del><ins>+void ScriptExecutionContext::reportException(const String&amp; errorMessage, int lineNumber, int columnNumber, const String&amp; sourceURL, JSC::Exception* exception, RefPtr&lt;ScriptCallStack&gt;&amp;&amp; callStack, CachedScript* cachedScript)
</ins><span class="cx"> {
</span><span class="cx">     if (m_inDispatchErrorEvent) {
</span><span class="cx">         if (!m_pendingExceptions)
</span><span class="lines">@@ -370,7 +372,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // First report the original exception and only then all the nested ones.
</span><del>-    if (!dispatchErrorEvent(errorMessage, lineNumber, columnNumber, sourceURL, cachedScript))
</del><ins>+    if (!dispatchErrorEvent(errorMessage, lineNumber, columnNumber, sourceURL, exception, cachedScript))
</ins><span class="cx">         logExceptionToConsole(errorMessage, sourceURL, lineNumber, columnNumber, callStack.copyRef());
</span><span class="cx"> 
</span><span class="cx">     if (!m_pendingExceptions)
</span><span class="lines">@@ -386,7 +388,7 @@
</span><span class="cx">     addMessage(source, level, message, sourceURL, lineNumber, columnNumber, 0, state, requestIdentifier);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool ScriptExecutionContext::dispatchErrorEvent(const String&amp; errorMessage, int lineNumber, int columnNumber, const String&amp; sourceURL, CachedScript* cachedScript)
</del><ins>+bool ScriptExecutionContext::dispatchErrorEvent(const String&amp; errorMessage, int lineNumber, int columnNumber, const String&amp; sourceURL, JSC::Exception* exception, CachedScript* cachedScript)
</ins><span class="cx"> {
</span><span class="cx">     EventTarget* target = errorEventTarget();
</span><span class="cx">     if (!target)
</span><span class="lines">@@ -404,11 +406,12 @@
</span><span class="cx">     int line = lineNumber;
</span><span class="cx">     int column = columnNumber;
</span><span class="cx">     String sourceName = sourceURL;
</span><del>-    sanitizeScriptError(message, line, column, sourceName, cachedScript);
</del><ins>+    Deprecated::ScriptValue error = exception &amp;&amp; exception-&gt;value() ? Deprecated::ScriptValue(vm(), exception-&gt;value()) : Deprecated::ScriptValue();
+    sanitizeScriptError(message, line, column, sourceName, error, cachedScript);
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(!m_inDispatchErrorEvent);
</span><span class="cx">     m_inDispatchErrorEvent = true;
</span><del>-    Ref&lt;ErrorEvent&gt; errorEvent = ErrorEvent::create(message, sourceName, line, column);
</del><ins>+    Ref&lt;ErrorEvent&gt; errorEvent = ErrorEvent::create(message, sourceName, line, column, error);
</ins><span class="cx">     target-&gt;dispatchEvent(errorEvent);
</span><span class="cx">     m_inDispatchErrorEvent = false;
</span><span class="cx">     return errorEvent-&gt;defaultPrevented();
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptExecutionContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptExecutionContext.h        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -37,7 +37,12 @@
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/NoncopyableFunction.h&gt;
</span><span class="cx"> 
</span><ins>+namespace Deprecated {
+class ScriptValue;
+}
+
</ins><span class="cx"> namespace JSC {
</span><ins>+class Exception;
</ins><span class="cx"> class ExecState;
</span><span class="cx"> class VM;
</span><span class="cx"> }
</span><span class="lines">@@ -83,8 +88,8 @@
</span><span class="cx">     virtual IDBClient::IDBConnectionProxy* idbConnectionProxy() = 0;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    bool sanitizeScriptError(String&amp; errorMessage, int&amp; lineNumber, int&amp; columnNumber, String&amp; sourceURL, CachedScript* = nullptr);
-    void reportException(const String&amp; errorMessage, int lineNumber, int columnNumber, const String&amp; sourceURL, RefPtr&lt;Inspector::ScriptCallStack&gt;&amp;&amp;, CachedScript* = nullptr);
</del><ins>+    bool sanitizeScriptError(String&amp; errorMessage, int&amp; lineNumber, int&amp; columnNumber, String&amp; sourceURL, Deprecated::ScriptValue&amp; error, CachedScript* = nullptr);
+    void reportException(const String&amp; errorMessage, int lineNumber, int columnNumber, const String&amp; sourceURL, JSC::Exception*, RefPtr&lt;Inspector::ScriptCallStack&gt;&amp;&amp;, CachedScript* = nullptr);
</ins><span class="cx"> 
</span><span class="cx">     void addConsoleMessage(MessageSource, MessageLevel, const String&amp; message, const String&amp; sourceURL, unsigned lineNumber, unsigned columnNumber, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0);
</span><span class="cx">     virtual void addConsoleMessage(MessageSource, MessageLevel, const String&amp; message, unsigned long requestIdentifier = 0) = 0;
</span><span class="lines">@@ -226,7 +231,7 @@
</span><span class="cx">     virtual void addMessage(MessageSource, MessageLevel, const String&amp; message, const String&amp; sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr&lt;Inspector::ScriptCallStack&gt;&amp;&amp;, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0) = 0;
</span><span class="cx">     virtual EventTarget* errorEventTarget() = 0;
</span><span class="cx">     virtual void logExceptionToConsole(const String&amp; errorMessage, const String&amp; sourceURL, int lineNumber, int columnNumber, RefPtr&lt;Inspector::ScriptCallStack&gt;&amp;&amp;) = 0;
</span><del>-    bool dispatchErrorEvent(const String&amp; errorMessage, int lineNumber, int columnNumber, const String&amp; sourceURL, CachedScript*);
</del><ins>+    bool dispatchErrorEvent(const String&amp; errorMessage, int lineNumber, int columnNumber, const String&amp; sourceURL, JSC::Exception*, CachedScript*);
</ins><span class="cx"> 
</span><span class="cx">     virtual void refScriptExecutionContext() = 0;
</span><span class="cx">     virtual void derefScriptExecutionContext() = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerMessagingProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp (202022 => 202023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp        2016-06-14 03:05:21 UTC (rev 202022)
+++ trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp        2016-06-14 03:28:10 UTC (rev 202023)
</span><span class="lines">@@ -147,9 +147,9 @@
</span><span class="cx">         // We don't bother checking the askedToTerminate() flag here, because exceptions should *always* be reported even if the thread is terminated.
</span><span class="cx">         // This is intentionally different than the behavior in MessageWorkerTask, because terminated workers no longer deliver messages (section 4.6 of the WebWorker spec), but they do report exceptions.
</span><span class="cx"> 
</span><del>-        bool errorHandled = !workerObject-&gt;dispatchEvent(ErrorEvent::create(errorMessage, sourceURL, lineNumber, columnNumber));
</del><ins>+        bool errorHandled = !workerObject-&gt;dispatchEvent(ErrorEvent::create(errorMessage, sourceURL, lineNumber, columnNumber, Deprecated::ScriptValue()));
</ins><span class="cx">         if (!errorHandled)
</span><del>-            context.reportException(errorMessage, lineNumber, columnNumber, sourceURL, 0);
</del><ins>+            context.reportException(errorMessage, lineNumber, columnNumber, sourceURL, nullptr, nullptr);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>