<!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>[206960] 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/206960">206960</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-10-08 16:01:27 -0700 (Sat, 08 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Next step on moving to modern way to return DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163016
Reviewed by Ryosuke Niwa.
Source/WebCore:
* Modules/fetch/FetchRequest.idl:
Added MayThrowException to initializeWith since it throws an exception.
* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::invokeCallback):
* bindings/js/JSCustomSQLStatementErrorCallback.cpp:
(WebCore::JSSQLStatementErrorCallback::handleEvent):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
(WebCore::reportCurrentException):
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSMutationCallback.cpp:
(WebCore::JSMutationCallback::call):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::executeFunctionInContext):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::evaluate):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::reportException):
Use JSC::Exception explicitly to avoid ambiguity with WebCore::Exception,
or in some cases use auto instead.
* bindings/js/JSDOMBinding.cpp:
(WebCore::hasUnpairedSurrogate): Factored this inline function out of valueToUSVString
for clarity.
(WebCore::createDOMException): Removed unused TRY_TO_CREATE_EXCEPTION macro.
(WebCore::propagateExceptionSlowPath): Added.
(WebCore::propagateException): Added.
(WebCore::setDOMException): Removed overload that takes an exception code and message
string separately; no longer needed.
* bindings/js/JSDOMBinding.h: Include the ExceptionOr header
rather than forward declaring. Added more of the ExceptionOr handling
functions; some just declared and not yet defined. Updated for changes
to ExceptionOr interface. Removed the createDOMException function that takes
only an exception code; not needed outside JSDOMBinding.cpp.
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::send): Rewrote this to use ExceptionOr instead
of ExceptionCode. Added some FIXMEs as well.
(WebCore::JSXMLHttpRequest::responseText): Ditto.
(WebCore::JSXMLHttpRequest::retrieveResponse): Ditto.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Fixed if statements to follow WebKit coding style
rather than using extra braces. Added call to propagateException for SetterMayThrowException.
(GenerateSerializerFunction): Fixed if statements as above.
(GenerateParametersCheck): Ditto. Also added call to propagateException for functions with
void return type and MayThrowException.
(GenerateReturnParameters): Tweaked coding style a bit.
(addIterableProperties): Fixed if statements as above.
(NativeToJSValue): Added code to handle various cases of GetterMayThrowException
and MayThrowException.
(GenerateConstructorDefinition): Used encodedJSValue() instead of
JSValue::encode(JSValue()), a longer way to say the same thing.
* bindings/scripts/IDLAttributes.txt: Added GetterMayThrowException,
MayThrowException, and SetterMayThrowException.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSattribute.cpp:
Regenerated results.
* bindings/scripts/test/TestObj.idl: Added some test cases.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType): Tweaked formatting.
(WebCore::DOMImplementation::createDocument): Ditto.
* dom/DOMImplementation.idl: Added MayThrowException to two functions since
I am abandoning, for now, the ability to throw exceptions without any extended
attribute in the IDL file. This feature may return at some point if we figure
out a way to do it for functions without return values as well as functions with.
* dom/Document.cpp:
(WebCore::Document::exitPointerLock): Rewrote to streamline logic.
(WebCore::Document::pointerLockElement): Ditto.
(WebCore::Document::inputCursor): Added. No need for this to be inlined.
(WebCore::Document::setInputCursor): Changed to take Ref&&.
(WebCore::Document::getSelection): Added. Moved here from TreeScope.
* dom/Document.h: Updated for above changes.
* dom/Document.idl: Tweaked formatting.
* dom/Exception.h: Merged the two constructors into one with a default
argument value, which should be equally efficient. Added releaseMessage function.
Added assertion that this is only created for actual exceptions with non-zero
ExceptionCode. Unlike ExceptionCode, which has a value of 0 which means no
exception, we do not create an Exception if there is no exception.
* dom/ExceptionOr.h: Renamed takeReturnValue to releaseReturnValue. Replaced
exceptionCode and exceptionMessage with releaseException. Added ExceptionOr<void>
specialization.
* dom/TreeScope.cpp:
(WebCore::TreeScope::~TreeScope): Removed code dealing with
m_selection, which is now in Document.
(WebCore::TreeScope::getSelection): Deleted.
* dom/TreeScope.h: Removed DOMSelection.
* page/DOMSelection.cpp:
(WebCore::selectionShadowAncestor): Changed to take a reference rather than
a guaranteed-non-null pointer.
(WebCore::DOMSelection::DOMSelection): Changed to take a Frame& instead of
of a TreeScope*.
(WebCore::DOMSelection::clearTreeScope): Deleted.
(WebCore::DOMSelection::isCollapsed): Updated call to selectionShadowAncestor.
(WebCore::DOMSelection::type): Took out obsolete uneeeded comment. Got rid
of case where this returns a null string. Use ASCIILiteral.
(WebCore::DOMSelection::rangeCount): Streamlined code.
(WebCore::DOMSelection::collapse): Removed redundant check of m_frame for
null which is already handled by the isValidForPosition function.
Removed non-helpful FIXME.
(WebCore::DOMSelection::collapseToEnd): Changed to use ExceptionOr instead of
ExceptionCode.
(WebCore::DOMSelection::collapseToStart): Ditto.
(WebCore::DOMSelection::setBaseAndExtent): Removed redundant check of m_frame
for null which is already handled by the isValidForPosition function. Removed
non-helpful FIXME.
(WebCore::DOMSelection::setPosition): Ditto.
(WebCore::DOMSelection::extend): Changed to use ExceptionOr instead of
ExceptionCode.
(WebCore::DOMSelection::getRangeAt): Ditto.
(WebCore::DOMSelection::isValidForPosition): Changed to return false when
m_frame is null rather than asserting is is non-null and having every caller
check m_frame before calling this.
* page/DOMSelection.h: Use #pragma once. Fix indentation. Removed unneeded
comments. Use ExceptionOr rather than ExceptionCode.
* page/DOMSelection.idl: Move from MayThrowLegacyException to MayThrowException.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::resetDOMWindowProperties): Sorted properties alphabetically
to make it more obvious if any are accidentally omitted or listed twice.
(WebCore::DOMWindow::getSelection): Changed ownership so that the window owns
the selection like all the other objects, rather than having it be owned by the
document instead.
* page/DOMWindow.h: Added m_selection, sorted all the other related properties
alphabetically so it's easy to compare the list here with elsewhere.
* replay/ReplayController.cpp:
(WebCore::ReplayController::frameNavigated): Updated to call setInputCursor
with a reference rather than a pointer.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseText): Use ExceptionOr rather than ExceptionCode.
(WebCore::XMLHttpRequest::responseXML): Ditto.
(WebCore::XMLHttpRequest::setTimeout): Ditto.
(WebCore::XMLHttpRequest::setResponseType): Ditto.
(WebCore::XMLHttpRequest::setWithCredentials): Ditto.
(WebCore::XMLHttpRequest::open): Ditto.
(WebCore::XMLHttpRequest::prepareToSend): Changed to return an
Optional<ExceptionOr> to reflect the three different states: an exception,
a value to return without sending, or "continue with the send algorithm".
The old code did this with a boolean plus an exception code. This sounds
confusing but is easy to read at the call sites, so probably OK to keep.
(WebCore::XMLHttpRequest::send): Use ExceptionOr rather than ExceptionCode.
(WebCore::XMLHttpRequest::sendBytesData): Ditto.
(WebCore::XMLHttpRequest::createRequest): Ditto.
(WebCore::XMLHttpRequest::overrideMimeType): Ditto.
(WebCore::XMLHttpRequest::setRequestHeader): Ditto.
* xml/XMLHttpRequest.h: Updated for changes above.
* xml/XMLHttpRequest.idl: Sorted interface extended attributes alphabetically.
Changed from MayThrowLegacyException to MayThrowException.
Source/WebKit/mac:
* DOM/DOMDOMImplementation.mm:
(-[DOMImplementation createDocumentType:publicId:systemId:]): Updated for
name change from takeReturnValue to releaseReturnValue.
(-[DOMImplementation createDocument:qualifiedName:doctype:]): Ditto.
Source/WebKit2:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
(webkit_dom_dom_implementation_create_document_type): Updated for name change
from takeReturnValue to releaseReturnValue.
(webkit_dom_dom_implementation_create_document): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
(webkit_dom_dom_selection_collapse_to_end): Use ExceptionOr instead of ExceptionCode.
(webkit_dom_dom_selection_collapse_to_start): Ditto.
(webkit_dom_dom_selection_extend): Ditto.
(webkit_dom_dom_selection_get_range_at): Ditto.
Tools:
* Scripts/do-webcore-rename: Add proposed name change of setDOMException
to propagateException, since this function is primarily used to take an
exception already effectively "thrown" by setting an ExceptionCode out
argument and propagate it into the JavaScript engine's exception machinery.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchRequestidl">trunk/Source/WebCore/Modules/fetch/FetchRequest.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCallbackDatacpp">trunk/Source/WebCore/bindings/js/JSCallbackData.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCustomElementInterfacecpp">trunk/Source/WebCore/bindings/js/JSCustomElementInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCustomSQLStatementErrorCallbackcpp">trunk/Source/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCustomXPathNSResolvercpp">trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingcpp">trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSErrorHandlercpp">trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSEventListenercpp">trunk/Source/WebCore/bindings/js/JSEventListener.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMutationCallbackcpp">trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeFilterCustomcpp">trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSXMLHttpRequestCustomcpp">trunk/Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScheduledActioncpp">trunk/Source/WebCore/bindings/js/ScheduledAction.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScriptControllercpp">trunk/Source/WebCore/bindings/js/ScriptController.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWorkerScriptControllercpp">trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLAttributestxt">trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestJSBuiltinConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNodecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministiccpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
<li><a href="#trunkSourceWebCoredomDOMImplementationcpp">trunk/Source/WebCore/dom/DOMImplementation.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDOMImplementationidl">trunk/Source/WebCore/dom/DOMImplementation.idl</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentidl">trunk/Source/WebCore/dom/Document.idl</a></li>
<li><a href="#trunkSourceWebCoredomExceptionh">trunk/Source/WebCore/dom/Exception.h</a></li>
<li><a href="#trunkSourceWebCoredomExceptionOrh">trunk/Source/WebCore/dom/ExceptionOr.h</a></li>
<li><a href="#trunkSourceWebCoredomTreeScopecpp">trunk/Source/WebCore/dom/TreeScope.cpp</a></li>
<li><a href="#trunkSourceWebCoredomTreeScopeh">trunk/Source/WebCore/dom/TreeScope.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageScriptDebugServercpp">trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMSelectioncpp">trunk/Source/WebCore/page/DOMSelection.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMSelectionh">trunk/Source/WebCore/page/DOMSelection.h</a></li>
<li><a href="#trunkSourceWebCorepageDOMSelectionidl">trunk/Source/WebCore/page/DOMSelection.idl</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowh">trunk/Source/WebCore/page/DOMWindow.h</a></li>
<li><a href="#trunkSourceWebCorereplayReplayControllercpp">trunk/Source/WebCore/replay/ReplayController.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequestcpp">trunk/Source/WebCore/xml/XMLHttpRequest.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequesth">trunk/Source/WebCore/xml/XMLHttpRequest.h</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequestidl">trunk/Source/WebCore/xml/XMLHttpRequest.idl</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMDOMImplementationmm">trunk/Source/WebKit/mac/DOM/DOMDOMImplementation.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkDOMWebKitDOMDOMImplementationcpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkDOMWebKitDOMDOMSelectioncpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptsdowebcorerename">trunk/Tools/Scripts/do-webcore-rename</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/ChangeLog        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -1,3 +1,203 @@
</span><ins>+2016-10-06 Darin Adler <darin@apple.com>
+
+ Next step on moving to modern way to return DOM exceptions
+ https://bugs.webkit.org/show_bug.cgi?id=163016
+
+ Reviewed by Ryosuke Niwa.
+
+ * Modules/fetch/FetchRequest.idl:
+ Added MayThrowException to initializeWith since it throws an exception.
+
+ * bindings/js/JSCallbackData.cpp:
+ (WebCore::JSCallbackData::invokeCallback):
+ * bindings/js/JSCustomElementInterface.cpp:
+ (WebCore::JSCustomElementInterface::invokeCallback):
+ * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
+ (WebCore::JSSQLStatementErrorCallback::handleEvent):
+ * bindings/js/JSCustomXPathNSResolver.cpp:
+ (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::reportException):
+ (WebCore::reportCurrentException):
+ * bindings/js/JSErrorHandler.cpp:
+ (WebCore::JSErrorHandler::handleEvent):
+ * bindings/js/JSEventListener.cpp:
+ (WebCore::JSEventListener::handleEvent):
+ * bindings/js/JSMutationCallback.cpp:
+ (WebCore::JSMutationCallback::call):
+ * bindings/js/JSNodeFilterCustom.cpp:
+ (WebCore::JSNodeFilter::acceptNode):
+ * bindings/js/ScheduledAction.cpp:
+ (WebCore::ScheduledAction::executeFunctionInContext):
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::evaluateInWorld):
+ * bindings/js/WorkerScriptController.cpp:
+ (WebCore::WorkerScriptController::evaluate):
+ * inspector/PageScriptDebugServer.cpp:
+ (WebCore::PageScriptDebugServer::reportException):
+ Use JSC::Exception explicitly to avoid ambiguity with WebCore::Exception,
+ or in some cases use auto instead.
+
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::hasUnpairedSurrogate): Factored this inline function out of valueToUSVString
+ for clarity.
+ (WebCore::createDOMException): Removed unused TRY_TO_CREATE_EXCEPTION macro.
+ (WebCore::propagateExceptionSlowPath): Added.
+ (WebCore::propagateException): Added.
+ (WebCore::setDOMException): Removed overload that takes an exception code and message
+ string separately; no longer needed.
+
+ * bindings/js/JSDOMBinding.h: Include the ExceptionOr header
+ rather than forward declaring. Added more of the ExceptionOr handling
+ functions; some just declared and not yet defined. Updated for changes
+ to ExceptionOr interface. Removed the createDOMException function that takes
+ only an exception code; not needed outside JSDOMBinding.cpp.
+
+ * bindings/js/JSXMLHttpRequestCustom.cpp:
+ (WebCore::JSXMLHttpRequest::send): Rewrote this to use ExceptionOr instead
+ of ExceptionCode. Added some FIXMEs as well.
+ (WebCore::JSXMLHttpRequest::responseText): Ditto.
+ (WebCore::JSXMLHttpRequest::retrieveResponse): Ditto.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation): Fixed if statements to follow WebKit coding style
+ rather than using extra braces. Added call to propagateException for SetterMayThrowException.
+ (GenerateSerializerFunction): Fixed if statements as above.
+ (GenerateParametersCheck): Ditto. Also added call to propagateException for functions with
+ void return type and MayThrowException.
+ (GenerateReturnParameters): Tweaked coding style a bit.
+ (addIterableProperties): Fixed if statements as above.
+ (NativeToJSValue): Added code to handle various cases of GetterMayThrowException
+ and MayThrowException.
+ (GenerateConstructorDefinition): Used encodedJSValue() instead of
+ JSValue::encode(JSValue()), a longer way to say the same thing.
+
+ * bindings/scripts/IDLAttributes.txt: Added GetterMayThrowException,
+ MayThrowException, and SetterMayThrowException.
+
+ * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
+ * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
+ * bindings/scripts/test/JS/JSTestException.cpp:
+ * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
+ * bindings/scripts/test/JS/JSTestInterface.cpp:
+ * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
+ * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
+ * bindings/scripts/test/JS/JSTestNode.cpp:
+ * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+ * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+ * bindings/scripts/test/JS/JSattribute.cpp:
+ Regenerated results.
+
+ * bindings/scripts/test/TestObj.idl: Added some test cases.
+
+ * dom/DOMImplementation.cpp:
+ (WebCore::DOMImplementation::createDocumentType): Tweaked formatting.
+ (WebCore::DOMImplementation::createDocument): Ditto.
+
+ * dom/DOMImplementation.idl: Added MayThrowException to two functions since
+ I am abandoning, for now, the ability to throw exceptions without any extended
+ attribute in the IDL file. This feature may return at some point if we figure
+ out a way to do it for functions without return values as well as functions with.
+
+ * dom/Document.cpp:
+ (WebCore::Document::exitPointerLock): Rewrote to streamline logic.
+ (WebCore::Document::pointerLockElement): Ditto.
+ (WebCore::Document::inputCursor): Added. No need for this to be inlined.
+ (WebCore::Document::setInputCursor): Changed to take Ref&&.
+ (WebCore::Document::getSelection): Added. Moved here from TreeScope.
+
+ * dom/Document.h: Updated for above changes.
+
+ * dom/Document.idl: Tweaked formatting.
+
+ * dom/Exception.h: Merged the two constructors into one with a default
+ argument value, which should be equally efficient. Added releaseMessage function.
+ Added assertion that this is only created for actual exceptions with non-zero
+ ExceptionCode. Unlike ExceptionCode, which has a value of 0 which means no
+ exception, we do not create an Exception if there is no exception.
+
+ * dom/ExceptionOr.h: Renamed takeReturnValue to releaseReturnValue. Replaced
+ exceptionCode and exceptionMessage with releaseException. Added ExceptionOr<void>
+ specialization.
+
+ * dom/TreeScope.cpp:
+ (WebCore::TreeScope::~TreeScope): Removed code dealing with
+ m_selection, which is now in Document.
+ (WebCore::TreeScope::getSelection): Deleted.
+
+ * dom/TreeScope.h: Removed DOMSelection.
+
+ * page/DOMSelection.cpp:
+ (WebCore::selectionShadowAncestor): Changed to take a reference rather than
+ a guaranteed-non-null pointer.
+ (WebCore::DOMSelection::DOMSelection): Changed to take a Frame& instead of
+ of a TreeScope*.
+ (WebCore::DOMSelection::clearTreeScope): Deleted.
+ (WebCore::DOMSelection::isCollapsed): Updated call to selectionShadowAncestor.
+ (WebCore::DOMSelection::type): Took out obsolete uneeeded comment. Got rid
+ of case where this returns a null string. Use ASCIILiteral.
+ (WebCore::DOMSelection::rangeCount): Streamlined code.
+ (WebCore::DOMSelection::collapse): Removed redundant check of m_frame for
+ null which is already handled by the isValidForPosition function.
+ Removed non-helpful FIXME.
+ (WebCore::DOMSelection::collapseToEnd): Changed to use ExceptionOr instead of
+ ExceptionCode.
+ (WebCore::DOMSelection::collapseToStart): Ditto.
+ (WebCore::DOMSelection::setBaseAndExtent): Removed redundant check of m_frame
+ for null which is already handled by the isValidForPosition function. Removed
+ non-helpful FIXME.
+ (WebCore::DOMSelection::setPosition): Ditto.
+ (WebCore::DOMSelection::extend): Changed to use ExceptionOr instead of
+ ExceptionCode.
+ (WebCore::DOMSelection::getRangeAt): Ditto.
+ (WebCore::DOMSelection::isValidForPosition): Changed to return false when
+ m_frame is null rather than asserting is is non-null and having every caller
+ check m_frame before calling this.
+
+ * page/DOMSelection.h: Use #pragma once. Fix indentation. Removed unneeded
+ comments. Use ExceptionOr rather than ExceptionCode.
+
+ * page/DOMSelection.idl: Move from MayThrowLegacyException to MayThrowException.
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::resetDOMWindowProperties): Sorted properties alphabetically
+ to make it more obvious if any are accidentally omitted or listed twice.
+ (WebCore::DOMWindow::getSelection): Changed ownership so that the window owns
+ the selection like all the other objects, rather than having it be owned by the
+ document instead.
+
+ * page/DOMWindow.h: Added m_selection, sorted all the other related properties
+ alphabetically so it's easy to compare the list here with elsewhere.
+
+ * replay/ReplayController.cpp:
+ (WebCore::ReplayController::frameNavigated): Updated to call setInputCursor
+ with a reference rather than a pointer.
+
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::responseText): Use ExceptionOr rather than ExceptionCode.
+ (WebCore::XMLHttpRequest::responseXML): Ditto.
+ (WebCore::XMLHttpRequest::setTimeout): Ditto.
+ (WebCore::XMLHttpRequest::setResponseType): Ditto.
+ (WebCore::XMLHttpRequest::setWithCredentials): Ditto.
+ (WebCore::XMLHttpRequest::open): Ditto.
+ (WebCore::XMLHttpRequest::prepareToSend): Changed to return an
+ Optional<ExceptionOr> to reflect the three different states: an exception,
+ a value to return without sending, or "continue with the send algorithm".
+ The old code did this with a boolean plus an exception code. This sounds
+ confusing but is easy to read at the call sites, so probably OK to keep.
+ (WebCore::XMLHttpRequest::send): Use ExceptionOr rather than ExceptionCode.
+ (WebCore::XMLHttpRequest::sendBytesData): Ditto.
+ (WebCore::XMLHttpRequest::createRequest): Ditto.
+ (WebCore::XMLHttpRequest::overrideMimeType): Ditto.
+ (WebCore::XMLHttpRequest::setRequestHeader): Ditto.
+
+ * xml/XMLHttpRequest.h: Updated for changes above.
+
+ * xml/XMLHttpRequest.idl: Sorted interface extended attributes alphabetically.
+ Changed from MayThrowLegacyException to MayThrowException.
+
</ins><span class="cx"> 2016-10-06 Sam Weinig <sam@webkit.org>
</span><span class="cx">
</span><span class="cx"> Autogenerate passing union types as part of a functions variadic arguments
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchRequestidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchRequest.idl (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchRequest.idl        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/Modules/fetch/FetchRequest.idl        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -62,8 +62,8 @@
</span><span class="cx">
</span><span class="cx"> [NewObject, CallWith=ScriptExecutionContext, MayThrowLegacyException] FetchRequest clone();
</span><span class="cx">
</span><del>- [PrivateIdentifier, NewObject] FetchHeaders initializeWith(FetchRequest input, Dictionary init);
- [PrivateIdentifier, NewObject] FetchHeaders initializeWith(DOMString input, Dictionary init);
- [PrivateIdentifier, MayThrowLegacyException, CallWith=ScriptState] void setBody(any body, FetchRequest? request);
</del><ins>+ [MayThrowException, NewObject, PrivateIdentifier] FetchHeaders initializeWith(FetchRequest input, Dictionary init);
+ [MayThrowException, NewObject, PrivateIdentifier] FetchHeaders initializeWith(DOMString input, Dictionary init);
+ [CallWith=ScriptState, MayThrowLegacyException, PrivateIdentifier] void setBody(any body, FetchRequest? request);
</ins><span class="cx"> };
</span><span class="cx"> FetchRequest implements FetchBody;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCallbackDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCallbackData.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCallbackData.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/js/JSCallbackData.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-JSValue JSCallbackData::invokeCallback(JSObject* callback, MarkedArgumentBuffer& args, CallbackType method, PropertyName functionName, NakedPtr<Exception>& returnedException)
</del><ins>+JSValue JSCallbackData::invokeCallback(JSObject* callback, MarkedArgumentBuffer& args, CallbackType method, PropertyName functionName, NakedPtr<JSC::Exception>& returnedException)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(callback);
</span><span class="cx">
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> }
</span><span class="cx"> if (callType == CallType::None) {
</span><span class="cx"> if (method == CallbackType::Function) {
</span><del>- returnedException = Exception::create(exec->vm(), createTypeError(exec));
</del><ins>+ returnedException = JSC::Exception::create(exec->vm(), createTypeError(exec));
</ins><span class="cx"> return JSValue();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> function = callback->get(exec, functionName);
</span><span class="cx"> callType = getCallData(function, callData);
</span><span class="cx"> if (callType == CallType::None) {
</span><del>- returnedException = Exception::create(exec->vm(), createTypeError(exec));
</del><ins>+ returnedException = JSC::Exception::create(exec->vm(), createTypeError(exec));
</ins><span class="cx"> return JSValue();
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCustomElementInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCustomElementInterface.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCustomElementInterface.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/js/JSCustomElementInterface.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -234,7 +234,7 @@
</span><span class="cx">
</span><span class="cx"> InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(context, callType, callData);
</span><span class="cx">
</span><del>- NakedPtr<Exception> exception;
</del><ins>+ NakedPtr<JSC::Exception> exception;
</ins><span class="cx"> JSMainThreadExecState::call(state, callback, callType, callData, jsElement, args, exception);
</span><span class="cx">
</span><span class="cx"> InspectorInstrumentation::didCallFunction(cookie, context);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCustomSQLStatementErrorCallbackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx"> args.append(toJS(exec, m_data->globalObject(), transaction));
</span><span class="cx"> args.append(toJS(exec, m_data->globalObject(), error));
</span><span class="cx">
</span><del>- NakedPtr<Exception> returnedException;
</del><ins>+ NakedPtr<JSC::Exception> returnedException;
</ins><span class="cx"> JSValue result = m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
</span><span class="cx"> if (returnedException) {
</span><span class="cx"> reportException(exec, returnedException);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCustomXPathNSResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx"> MarkedArgumentBuffer args;
</span><span class="cx"> args.append(jsStringWithCache(exec, prefix));
</span><span class="cx">
</span><del>- NakedPtr<Exception> exception;
</del><ins>+ NakedPtr<JSC::Exception> exception;
</ins><span class="cx"> JSValue retval = JSMainThreadExecState::call(exec, function, callType, callData, m_customResolver.get(), args, exception);
</span><span class="cx">
</span><span class="cx"> String result;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -117,6 +117,18 @@
</span><span class="cx"> return value.toString(exec)->value(exec);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static inline bool hasUnpairedSurrogate(StringView string)
+{
+ // Fast path for 8-bit strings; they can't have any surrogates.
+ if (string.is8Bit())
+ return false;
+ for (auto codePoint : string.codePoints()) {
+ if (U_IS_SURROGATE(codePoint))
+ return true;
+ }
+ return false;
+}
+
</ins><span class="cx"> String valueToUSVString(ExecState* exec, JSValue value)
</span><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span><span class="lines">@@ -124,27 +136,16 @@
</span><span class="cx">
</span><span class="cx"> String string = value.toWTFString(exec);
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, { });
</span><del>- StringView view { string };
</del><span class="cx">
</span><del>- // Fast path for 8-bit strings, since they can't have any surrogates.
- if (view.is8Bit())
- return string;
-
</del><span class="cx"> // Fast path for the case where there are no unpaired surrogates.
</span><del>- bool foundUnpairedSurrogate = false;
- for (auto codePoint : view.codePoints()) {
- if (U_IS_SURROGATE(codePoint)) {
- foundUnpairedSurrogate = true;
- break;
- }
- }
- if (!foundUnpairedSurrogate)
</del><ins>+ if (!hasUnpairedSurrogate(string))
</ins><span class="cx"> return string;
</span><span class="cx">
</span><span class="cx"> // Slow path: http://heycam.github.io/webidl/#dfn-obtain-unicode
</span><span class="cx"> // Replaces unpaired surrogates with the replacement character.
</span><span class="cx"> StringBuilder result;
</span><del>- result.reserveCapacity(view.length());
</del><ins>+ result.reserveCapacity(string.length());
+ StringView view { string };
</ins><span class="cx"> for (auto codePoint : view.codePoints()) {
</span><span class="cx"> if (U_IS_SURROGATE(codePoint))
</span><span class="cx"> result.append(replacementCharacter);
</span><span class="lines">@@ -190,17 +191,17 @@
</span><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span><span class="cx"> RELEASE_ASSERT(vm.currentThreadIsHoldingAPILock());
</span><del>- Exception* exception = jsDynamicCast<Exception*>(exceptionValue);
</del><ins>+ auto* exception = jsDynamicCast<JSC::Exception*>(exceptionValue);
</ins><span class="cx"> if (!exception) {
</span><span class="cx"> exception = vm.lastException();
</span><span class="cx"> if (!exception)
</span><del>- exception = Exception::create(exec->vm(), exceptionValue, Exception::DoNotCaptureStack);
</del><ins>+ exception = JSC::Exception::create(exec->vm(), exceptionValue, JSC::Exception::DoNotCaptureStack);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> reportException(exec, exception, cachedScript);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void reportException(ExecState* exec, Exception* exception, CachedScript* cachedScript, ExceptionDetails* exceptionDetails)
</del><ins>+void reportException(ExecState* exec, JSC::Exception* exception, CachedScript* cachedScript, ExceptionDetails* exceptionDetails)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span><span class="cx"> auto scope = DECLARE_CATCH_SCOPE(vm);
</span><span class="lines">@@ -263,17 +264,12 @@
</span><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span><span class="cx"> auto scope = DECLARE_CATCH_SCOPE(vm);
</span><del>- Exception* exception = scope.exception();
</del><ins>+ auto* exception = scope.exception();
</ins><span class="cx"> scope.clearException();
</span><span class="cx"> reportException(exec, exception);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#define TRY_TO_CREATE_EXCEPTION(interfaceName) \
- case interfaceName##Type: \
- errorObject = toJS(exec, globalObject, interfaceName::create(description)); \
- break;
-
-static JSValue createDOMException(ExecState* exec, ExceptionCode ec, const String* message)
</del><ins>+static JSValue createDOMException(ExecState* exec, ExceptionCode ec, const String* message = nullptr)
</ins><span class="cx"> {
</span><span class="cx"> if (!ec)
</span><span class="cx"> return jsUndefined();
</span><span class="lines">@@ -338,11 +334,6 @@
</span><span class="cx"> return createDOMException(exec, ec, &message);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSValue createDOMException(ExecState* exec, ExceptionCode ec)
-{
- return createDOMException(exec, ec, nullptr);
-}
-
</del><span class="cx"> ALWAYS_INLINE static void throwDOMException(ExecState* exec, ThrowScope& throwScope, ExceptionCode ec)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(ec && !throwScope.exception());
</span><span class="lines">@@ -355,6 +346,19 @@
</span><span class="cx"> throwException(exec, throwScope, createDOMException(exec, ec.code, ec.message));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void propagateExceptionSlowPath(JSC::ExecState& state, JSC::ThrowScope& throwScope, Exception&& exception)
+{
+ ASSERT(!throwScope.exception());
+ throwException(&state, throwScope, createDOMException(&state, exception.code(), exception.releaseMessage()));
+}
+
+void propagateException(JSC::ExecState& state, Exception&& exception)
+{
+ auto throwScope = DECLARE_THROW_SCOPE(state.vm());
+ if (!throwScope.exception())
+ propagateExceptionSlowPath(state, throwScope, WTFMove(exception));
+}
+
</ins><span class="cx"> void setDOMExceptionSlow(ExecState* exec, ThrowScope& throwScope, ExceptionCode ec)
</span><span class="cx"> {
</span><span class="cx"> throwDOMException(exec, throwScope, ec);
</span><span class="lines">@@ -376,17 +380,6 @@
</span><span class="cx"> throwDOMException(exec, scope, ec);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void setDOMException(ExecState* exec, ExceptionCode ec, const String& message)
-{
- VM& vm = exec->vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- if (!ec || scope.exception())
- return;
-
- throwException(exec, scope, createDOMException(exec, ec, message));
-}
-
</del><span class="cx"> void setDOMException(ExecState* exec, const ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span><span class="lines">@@ -398,8 +391,6 @@
</span><span class="cx"> throwDOMException(exec, scope, ec);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#undef TRY_TO_CREATE_EXCEPTION
-
</del><span class="cx"> bool hasIteratorMethod(JSC::ExecState& state, JSC::JSValue value)
</span><span class="cx"> {
</span><span class="cx"> auto& vm = state.vm();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx">
</span><span class="cx"> #include "DOMWrapperWorld.h"
</span><span class="cx"> #include "ExceptionCode.h"
</span><ins>+#include "ExceptionOr.h"
</ins><span class="cx"> #include "JSDOMGlobalObject.h"
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "ScriptWrappable.h"
</span><span class="lines">@@ -70,10 +71,6 @@
</span><span class="cx"> class URL;
</span><span class="cx"> class Node;
</span><span class="cx">
</span><del>-template<typename> class ExceptionOr;
-
-using ExceptionCode = int;
-
</del><span class="cx"> struct ExceptionDetails {
</span><span class="cx"> String message;
</span><span class="cx"> int lineNumber { 0 };
</span><span class="lines">@@ -182,34 +179,23 @@
</span><span class="cx"> WEBCORE_EXPORT void reportException(JSC::ExecState*, JSC::Exception*, CachedScript* = nullptr, ExceptionDetails* = nullptr);
</span><span class="cx"> void reportCurrentException(JSC::ExecState*);
</span><span class="cx">
</span><del>-JSC::JSValue createDOMException(JSC::ExecState*, ExceptionCode);
</del><span class="cx"> JSC::JSValue createDOMException(JSC::ExecState*, ExceptionCode, const String&);
</span><span class="cx">
</span><del>-// Convert a DOM implementation exception code into a JavaScript exception in the execution state.
</del><ins>+// Convert a DOM implementation exception into a JavaScript exception in the execution state.
+void propagateException(JSC::ExecState&, JSC::ThrowScope&, Exception&&);
+void setDOMException(JSC::ExecState*, JSC::ThrowScope&, ExceptionCode);
+void setDOMException(JSC::ExecState*, JSC::ThrowScope&, const ExceptionCodeWithMessage&);
+
+// Slower versions of the above for use when the caller doesn't have a ThrowScope.
+void propagateException(JSC::ExecState&, Exception&&);
</ins><span class="cx"> WEBCORE_EXPORT void setDOMException(JSC::ExecState*, ExceptionCode);
</span><del>-void setDOMException(JSC::ExecState*, ExceptionCode, const String&);
</del><span class="cx"> void setDOMException(JSC::ExecState*, const ExceptionCodeWithMessage&);
</span><span class="cx">
</span><ins>+// Implementation details of the above.
</ins><span class="cx"> WEBCORE_EXPORT void setDOMExceptionSlow(JSC::ExecState*, JSC::ThrowScope&, ExceptionCode);
</span><span class="cx"> void setDOMExceptionSlow(JSC::ExecState*, JSC::ThrowScope&, const ExceptionCodeWithMessage&);
</span><ins>+void propagateExceptionSlowPath(JSC::ExecState&, JSC::ThrowScope&, Exception&&);
</ins><span class="cx">
</span><del>-ALWAYS_INLINE void setDOMException(JSC::ExecState* exec, JSC::ThrowScope& throwScope, const ExceptionCodeWithMessage& message)
-{
- if (LIKELY(!message.code || throwScope.exception()))
- return;
- setDOMExceptionSlow(exec, throwScope, message);
-}
-
-ALWAYS_INLINE void setDOMException(JSC::ExecState* exec, JSC::ThrowScope& throwScope, ExceptionCode ec)
-{
- if (LIKELY(!ec || throwScope.exception()))
- return;
- setDOMExceptionSlow(exec, throwScope, ec);
-}
-
-template<typename T> inline JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, ExceptionOr<T>&&);
-template<typename T> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, ExceptionOr<T>&&);
-
</del><span class="cx"> JSC::JSValue jsString(JSC::ExecState*, const URL&); // empty if the URL is null
</span><span class="cx">
</span><span class="cx"> JSC::JSValue jsStringOrNull(JSC::ExecState*, const String&); // null if the string is null
</span><span class="lines">@@ -365,6 +351,18 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+// ExceptionOr handling.
+void propagateException(JSC::ExecState&, JSC::ThrowScope&, ExceptionOr<void>&&);
+template<typename T> JSC::JSValue toJS(JSC::ExecState&, JSDOMGlobalObject&, JSC::ThrowScope&, ExceptionOr<T>&&);
+JSC::JSValue toJSBoolean(JSC::ExecState&, JSC::ThrowScope&, ExceptionOr<bool>&&);
+JSC::JSValue toJSDate(JSC::ExecState&, JSC::ThrowScope&, ExceptionOr<double>&&);
+JSC::JSValue toJSNullableDate(JSC::ExecState&, JSC::ThrowScope&, ExceptionOr<Optional<double>>&&);
+JSC::JSValue toJSNullableString(JSC::ExecState&, JSC::ThrowScope&, ExceptionOr<String>&&);
+template<typename T> JSC::JSValue toJSNewlyCreated(JSC::ExecState&, JSDOMGlobalObject&, JSC::ThrowScope&, ExceptionOr<T>&& value);
+template<typename T> JSC::JSValue toJSNumber(JSC::ExecState&, JSDOMGlobalObject&, JSC::ThrowScope&, ExceptionOr<T>&& value);
+template<typename T> JSC::JSValue toJSNullableNumber(JSC::ExecState&, JSDOMGlobalObject&, JSC::ThrowScope&, ExceptionOr<T>&& value);
+JSC::JSValue toJSString(JSC::ExecState&, JSC::ThrowScope&, ExceptionOr<String>&&);
+
</ins><span class="cx"> // Inline functions and template definitions.
</span><span class="cx">
</span><span class="cx"> inline JSC::Structure* DOMConstructorObject::createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
</span><span class="lines">@@ -886,23 +884,49 @@
</span><span class="cx"> return optionalNumber ? JSC::jsNumber(optionalNumber.value()) : JSC::jsNull();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<typename T> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, ExceptionOr<T>&& value)
</del><ins>+ALWAYS_INLINE void propagateException(JSC::ExecState& state, JSC::ThrowScope& throwScope, Exception&& exception)
</ins><span class="cx"> {
</span><ins>+ if (throwScope.exception())
+ return;
+ propagateExceptionSlowPath(state, throwScope, WTFMove(exception));
+}
+
+ALWAYS_INLINE void setDOMException(JSC::ExecState* exec, JSC::ThrowScope& throwScope, ExceptionCode ec)
+{
+ if (LIKELY(!ec || throwScope.exception()))
+ return;
+ setDOMExceptionSlow(exec, throwScope, ec);
+}
+
+ALWAYS_INLINE void setDOMException(JSC::ExecState* exec, JSC::ThrowScope& throwScope, const ExceptionCodeWithMessage& exception)
+{
+ if (LIKELY(!exception.code || throwScope.exception()))
+ return;
+ setDOMExceptionSlow(exec, throwScope, exception);
+}
+
+inline void propagateException(JSC::ExecState& state, JSC::ThrowScope& throwScope, ExceptionOr<void>&& value)
+{
+ if (UNLIKELY(value.hasException()))
+ propagateException(state, throwScope, value.releaseException());
+}
+
+template<typename T> inline JSC::JSValue toJS(JSC::ExecState& state, JSDOMGlobalObject& globalObject, JSC::ThrowScope& throwScope, ExceptionOr<T>&& value)
+{
</ins><span class="cx"> if (UNLIKELY(value.hasException())) {
</span><del>- setDOMException(state, value.exceptionCode(), value.exceptionMessage());
- return JSC::jsUndefined();
</del><ins>+ propagateException(state, throwScope, value.releaseException());
+ return { };
</ins><span class="cx"> }
</span><del>- return toJS(state, globalObject, value.takeReturnValue());
</del><ins>+ return toJS(&state, &globalObject, value.releaseReturnValue());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-template<typename T> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, ExceptionOr<T>&& value)
</del><ins>+template<typename T> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState& state, JSDOMGlobalObject& globalObject, JSC::ThrowScope& throwScope, ExceptionOr<T>&& value)
</ins><span class="cx"> {
</span><del>- // FIXME: It's really annoying to have two of these functions. Should find a way to combine toJS and toJSNewlyCreated.
</del><span class="cx"> if (UNLIKELY(value.hasException())) {
</span><del>- setDOMException(state, value.exceptionCode(), value.exceptionMessage());
- return JSC::jsUndefined();
</del><ins>+ propagateException(state, throwScope, value.releaseException());
+ return { };
</ins><span class="cx"> }
</span><del>- return toJSNewlyCreated(state, globalObject, value.takeReturnValue());
</del><ins>+ return toJSNewlyCreated(&state, &globalObject, value.releaseReturnValue());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSErrorHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx">
</span><span class="cx"> InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(scriptExecutionContext, callType, callData);
</span><span class="cx">
</span><del>- NakedPtr<Exception> exception;
</del><ins>+ NakedPtr<JSC::Exception> exception;
</ins><span class="cx"> JSValue returnValue = scriptExecutionContext->isDocument()
</span><span class="cx"> ? JSMainThreadExecState::profiledCall(exec, JSC::ProfilingReason::Other, jsFunction, callType, callData, globalObject, args, exception)
</span><span class="cx"> : JSC::profiledCall(exec, JSC::ProfilingReason::Other, jsFunction, callType, callData, globalObject, args, exception);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSEventListenercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSEventListener.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSEventListener.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/js/JSEventListener.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -115,7 +115,7 @@
</span><span class="cx"> if (callType == CallType::None) {
</span><span class="cx"> handleEventFunction = jsFunction->get(exec, Identifier::fromString(exec, "handleEvent"));
</span><span class="cx"> if (UNLIKELY(scope.exception())) {
</span><del>- Exception* exception = scope.exception();
</del><ins>+ auto* exception = scope.exception();
</ins><span class="cx"> scope.clearException();
</span><span class="cx">
</span><span class="cx"> event->target()->uncaughtExceptionInEventHandler();
</span><span class="lines">@@ -139,7 +139,7 @@
</span><span class="cx"> InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(scriptExecutionContext, callType, callData);
</span><span class="cx">
</span><span class="cx"> JSValue thisValue = handleEventFunction == jsFunction ? toJS(exec, globalObject, event->currentTarget()) : jsFunction;
</span><del>- NakedPtr<Exception> exception;
</del><ins>+ NakedPtr<JSC::Exception> exception;
</ins><span class="cx"> JSValue retval = scriptExecutionContext->isDocument()
</span><span class="cx"> ? JSMainThreadExecState::profiledCall(exec, JSC::ProfilingReason::Other, handleEventFunction, callType, callData, thisValue, args, exception)
</span><span class="cx"> : JSC::profiledCall(exec, JSC::ProfilingReason::Other, handleEventFunction, callType, callData, thisValue, args, exception);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMutationCallbackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">
</span><span class="cx"> InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(context, callType, callData);
</span><span class="cx">
</span><del>- NakedPtr<Exception> exception;
</del><ins>+ NakedPtr<JSC::Exception> exception;
</ins><span class="cx"> JSMainThreadExecState::profiledCall(exec, JSC::ProfilingReason::Other, callback, callType, callData, jsObserver, args, exception);
</span><span class="cx">
</span><span class="cx"> InspectorInstrumentation::didCallFunction(cookie, context);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeFilterCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> args.append(toJS(state, m_data->globalObject(), node));
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, NodeFilter::FILTER_REJECT);
</span><span class="cx">
</span><del>- NakedPtr<Exception> returnedException;
</del><ins>+ NakedPtr<JSC::Exception> returnedException;
</ins><span class="cx"> JSValue value = m_data->invokeCallback(args, JSCallbackData::CallbackType::FunctionOrObject, Identifier::fromString(state, "acceptNode"), returnedException);
</span><span class="cx"> ASSERT(!scope.exception() || returnedException);
</span><span class="cx"> if (returnedException) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSXMLHttpRequestCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -105,44 +105,52 @@
</span><span class="cx"> {
</span><span class="cx"> InspectorInstrumentation::willSendXMLHttpRequest(wrapped().scriptExecutionContext(), wrapped().url());
</span><span class="cx">
</span><del>- ExceptionCode ec = 0;
- JSValue val = state.argument(0);
- if (val.isUndefinedOrNull())
- wrapped().send(ec);
- else if (val.inherits(JSDocument::info()))
- wrapped().send(JSDocument::toWrapped(val), ec);
- else if (val.inherits(JSBlob::info()))
- wrapped().send(JSBlob::toWrapped(val), ec);
- else if (val.inherits(JSDOMFormData::info()))
- wrapped().send(JSDOMFormData::toWrapped(val), ec);
- else if (val.inherits(JSArrayBuffer::info()))
- wrapped().send(toArrayBuffer(val), ec);
- else if (val.inherits(JSArrayBufferView::info())) {
- RefPtr<ArrayBufferView> view = toArrayBufferView(val);
- wrapped().send(view.get(), ec);
- } else
- wrapped().send(val.toString(&state)->value(&state), ec);
</del><ins>+ JSValue value = state.argument(0);
+ ExceptionOr<void> result;
+ if (value.isUndefinedOrNull())
+ result = wrapped().send();
+ else if (value.inherits(JSDocument::info()))
+ result = wrapped().send(*JSDocument::toWrapped(value));
+ else if (value.inherits(JSBlob::info()))
+ result = wrapped().send(*JSBlob::toWrapped(value));
+ else if (value.inherits(JSDOMFormData::info()))
+ result = wrapped().send(*JSDOMFormData::toWrapped(value));
+ else if (value.inherits(JSArrayBuffer::info()))
+ result = wrapped().send(*toArrayBuffer(value));
+ else if (value.inherits(JSArrayBufferView::info()))
+ result = wrapped().send(*toArrayBufferView(value).get());
+ else {
+ // FIXME: If toString raises an exception, should we exit before calling willSendXMLHttpRequest?
+ // FIXME: If toString raises an exception, should we exit before calling send?
+ result = wrapped().send(value.toString(&state)->value(&state));
+ }
</ins><span class="cx">
</span><del>- // FIXME: This should probably use ShadowChicken so that we get the right frame even when it did
- // a tail call.
</del><ins>+ // FIXME: This should probably use ShadowChicken so that we get the right frame even when it did a tail call.
</ins><span class="cx"> // https://bugs.webkit.org/show_bug.cgi?id=155688
</span><span class="cx"> SendFunctor functor;
</span><span class="cx"> state.iterate(functor);
</span><span class="cx"> wrapped().setLastSendLineAndColumnNumber(functor.line(), functor.column());
</span><span class="cx"> wrapped().setLastSendURL(functor.url());
</span><del>- setDOMException(&state, ec);
</del><ins>+
+ // FIXME: Is it correct to do this only after the paragraph code of code just above, or should we exit earlier?
+ if (UNLIKELY(result.hasException())) {
+ propagateException(state, result.releaseException());
+ return { };
+ }
+
</ins><span class="cx"> return jsUndefined();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> JSValue JSXMLHttpRequest::responseText(ExecState& state) const
</span><span class="cx"> {
</span><del>- ExceptionCode ec = 0;
- String text = wrapped().responseText(ec);
- if (ec) {
- setDOMException(&state, ec);
- return jsUndefined();
</del><ins>+ auto result = wrapped().responseText();
+
+ if (UNLIKELY(result.hasException())) {
+ propagateException(state, result.releaseException());
+ return { };
</ins><span class="cx"> }
</span><del>- return jsOwnedStringOrNull(&state, text);
</del><ins>+
+ return jsOwnedStringOrNull(&state, result.releaseReturnValue());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> JSValue JSXMLHttpRequest::retrieveResponse(ExecState& state)
</span><span class="lines">@@ -174,12 +182,12 @@
</span><span class="cx"> break;
</span><span class="cx">
</span><span class="cx"> case XMLHttpRequest::ResponseType::Document: {
</span><del>- ExceptionCode ec = 0;
- auto document = wrapped().responseXML(ec);
- ASSERT(!ec);
- value = toJS(&state, globalObject(), document);
</del><ins>+ auto document = wrapped().responseXML();
+ ASSERT(!document.hasException());
+ value = toJS(&state, globalObject(), document.releaseReturnValue());
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> case XMLHttpRequest::ResponseType::Blob:
</span><span class="cx"> value = toJSNewlyCreated(&state, globalObject(), wrapped().createResponseBlob());
</span><span class="cx"> break;
</span><span class="lines">@@ -188,6 +196,7 @@
</span><span class="cx"> value = toJS(&state, globalObject(), wrapped().createResponseArrayBuffer());
</span><span class="cx"> break;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> wrapped().didCacheResponse();
</span><span class="cx"> return value;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScheduledActioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScheduledAction.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScheduledAction.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/js/ScheduledAction.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx">
</span><span class="cx"> InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(&context, callType, callData);
</span><span class="cx">
</span><del>- NakedPtr<Exception> exception;
</del><ins>+ NakedPtr<JSC::Exception> exception;
</ins><span class="cx"> if (is<Document>(context))
</span><span class="cx"> JSMainThreadExecState::profiledCall(exec, JSC::ProfilingReason::Other, m_function.get(), callType, callData, thisValue, args, exception);
</span><span class="cx"> else
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScriptController.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScriptController.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/js/ScriptController.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx">
</span><span class="cx"> InspectorInstrumentationCookie cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, sourceCode.startLine());
</span><span class="cx">
</span><del>- NakedPtr<Exception> evaluationException;
</del><ins>+ NakedPtr<JSC::Exception> evaluationException;
</ins><span class="cx"> JSValue returnValue = JSMainThreadExecState::profiledEvaluate(exec, JSC::ProfilingReason::Other, jsSourceCode, shell, evaluationException);
</span><span class="cx">
</span><span class="cx"> InspectorInstrumentation::didEvaluateScript(cookie, m_frame);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWorkerScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx"> if (isExecutionForbidden())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- NakedPtr<Exception> exception;
</del><ins>+ NakedPtr<JSC::Exception> exception;
</ins><span class="cx"> evaluate(sourceCode, exception);
</span><span class="cx"> if (exception) {
</span><span class="cx"> JSLockHolder lock(vm());
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx"> String sourceURL = sourceCode.url().string();
</span><span class="cx"> Deprecated::ScriptValue error;
</span><span class="cx"> if (m_workerGlobalScope->sanitizeScriptError(errorMessage, lineNumber, columnNumber, sourceURL, error, sourceCode.cachedScript()))
</span><del>- returnedException = Exception::create(vm, createError(exec, errorMessage.impl()));
</del><ins>+ returnedException = JSC::Exception::create(vm, createError(exec, errorMessage.impl()));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -2330,9 +2330,7 @@
</span><span class="cx"> sub GetIndexedGetterExpression
</span><span class="cx"> {
</span><span class="cx"> my $indexedGetterFunction = shift;
</span><del>- if ($indexedGetterFunction->signature->type eq "DOMString") {
- return "jsStringOrUndefined(state, thisObject->wrapped().item(index))";
- }
</del><ins>+ return "jsStringOrUndefined(state, thisObject->wrapped().item(index))" if $indexedGetterFunction->signature->type eq "DOMString";
</ins><span class="cx"> return "toJS(state, thisObject->globalObject(), thisObject->wrapped().item(index))";
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3229,13 +3227,12 @@
</span><span class="cx"> } else {
</span><span class="cx"> push(@implContent, " ${className}* castedThis = " . GetCastingHelperForThisObject($interface) . "(JSValue::decode(thisValue));\n");
</span><span class="cx"> }
</span><del>- push(@implContent, " if (UNLIKELY(!castedThis)) {\n");
</del><ins>+ push(@implContent, " if (UNLIKELY(!castedThis))\n");
</ins><span class="cx"> if ($attribute->signature->extendedAttributes->{LenientThis}) {
</span><span class="cx"> push(@implContent, " return false;\n");
</span><span class="cx"> } else {
</span><span class="cx"> push(@implContent, " return throwSetterTypeError(*state, throwScope, \"$visibleInterfaceName\", \"$name\");\n");
</span><span class="cx"> }
</span><del>- push(@implContent, " }\n");
</del><span class="cx"> }
</span><span class="cx"> if ($interface->extendedAttributes->{CheckSecurity} && !$attribute->signature->extendedAttributes->{DoNotCheckSecurity} && !$attribute->signature->extendedAttributes->{DoNotCheckSecurityOnSetter}) {
</span><span class="cx"> if ($interfaceName eq "DOMWindow") {
</span><span class="lines">@@ -3371,6 +3368,7 @@
</span><span class="cx"> push(@implContent, " return true;\n");
</span><span class="cx"> } else {
</span><span class="cx"> my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute);
</span><ins>+
</ins><span class="cx"> if ($codeGenerator->IsTypedArrayType($type) and not $type eq "ArrayBuffer") {
</span><span class="cx"> push(@arguments, "nativeValue.get()");
</span><span class="cx"> } elsif ($codeGenerator->IsEnumType($type)) {
</span><span class="lines">@@ -3393,7 +3391,11 @@
</span><span class="cx"> unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{CallWith}, \@implContent, "false"));
</span><span class="cx">
</span><span class="cx"> push(@arguments, "ec") if $setterMayThrowLegacyException;
</span><del>- push(@implContent, " ${functionName}(" . join(", ", @arguments) . ");\n");
</del><ins>+
+ my $functionString = "$functionName(" . join(", ", @arguments) . ")";
+ $functionString = "propagateException(*state, throwScope, $functionString)" if $attribute->signature->extendedAttributes->{SetterMayThrowException};
+
+ push(@implContent, " $functionString;\n");
</ins><span class="cx"> push(@implContent, " setDOMException(state, throwScope, ec);\n") if $setterMayThrowLegacyException;
</span><span class="cx"> push(@implContent, " return true;\n");
</span><span class="cx"> }
</span><span class="lines">@@ -3833,9 +3835,8 @@
</span><span class="cx"> push(@implContent, " auto castedThis = jsDynamicCast<JS$interfaceName*>(thisValue);\n");
</span><span class="cx"> push(@implContent, " VM& vm = state->vm();\n");
</span><span class="cx"> push(@implContent, " auto throwScope = DECLARE_THROW_SCOPE(vm);\n");
</span><del>- push(@implContent, " if (UNLIKELY(!castedThis)){\n");
</del><ins>+ push(@implContent, " if (UNLIKELY(!castedThis))\n");
</ins><span class="cx"> push(@implContent, " return throwThisTypeError(*state, throwScope, \"$interfaceName\", \"$serializerFunctionName\");\n");
</span><del>- push(@implContent, " }\n");
</del><span class="cx"> push(@implContent, " ASSERT_GC_OBJECT_INHERITS(castedThis, ${className}::info());\n\n") unless $interfaceName eq "EventTarget";
</span><span class="cx"> push(@implContent, " auto* result = constructEmptyObject(state);\n");
</span><span class="cx"> foreach my $attribute (@{$interface->attributes}) {
</span><span class="lines">@@ -4129,9 +4130,9 @@
</span><span class="cx"> if (!defined $parameter->default) {
</span><span class="cx"> push(@$outputArray, " if (!${name}Value.isUndefined()) {\n");
</span><span class="cx"> } else {
</span><del>- push(@$outputArray, " if (${name}Value.isUndefined()) {\n");
</del><ins>+ push(@$outputArray, " if (${name}Value.isUndefined())\n");
</ins><span class="cx"> push(@$outputArray, " $name = " . GenerateDefaultValue($interface, $parameter) . ";\n");
</span><del>- push(@$outputArray, " } else {\n");
</del><ins>+ push(@$outputArray, " else {\n");
</ins><span class="cx"> }
</span><span class="cx"> $indent = " ";
</span><span class="cx"> }
</span><span class="lines">@@ -4222,18 +4223,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> push @arguments, GenerateReturnParameters($function);
</span><ins>+ my $functionString = "$functionName(" . join(", ", @arguments) . ")";
+ $functionString = "propagateException(*state, throwScope, $functionString)" if $function->signature->type && $function->signature->type eq "void" && $function->signature->extendedAttributes->{MayThrowException};
</ins><span class="cx">
</span><del>- return ("$functionName(" . join(", ", @arguments) . ")", scalar @arguments);
</del><ins>+ return ($functionString, scalar @arguments);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub GenerateReturnParameters
</span><span class="cx"> {
</span><span class="cx"> my $function = shift;
</span><ins>+
</ins><span class="cx"> my @arguments;
</span><del>-
- if (IsReturningPromise($function)) {
- push(@arguments, "WTFMove(promise)");
- }
</del><ins>+ push(@arguments, "WTFMove(promise)") if IsReturningPromise($function);
</ins><span class="cx"> push(@arguments, "ec") if $function->signature->extendedAttributes->{MayThrowLegacyException} || $function->signature->extendedAttributes->{MayThrowLegacyExceptionWithMessage};
</span><span class="cx"> return @arguments;
</span><span class="cx"> }
</span><span class="lines">@@ -4592,6 +4593,7 @@
</span><span class="cx"> } else {
</span><span class="cx"> push(@implContent, $indent . "JSValue result = " . NativeToJSValue($function->signature, 1, $interface, $functionString, $thisObject) . ";\n");
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> push(@implContent, "\n" . $indent . "setDOMException(state, throwScope, ec);\n") if $mayThrowLegacyException;
</span><span class="cx">
</span><span class="cx"> if ($codeGenerator->ExtendedAttributeContains($function->signature->extendedAttributes->{CallWith}, "ScriptState")) {
</span><span class="lines">@@ -4680,7 +4682,7 @@
</span><span class="cx"> if ($interface->iterable->extendedAttributes->{EnabledAtRuntime}) {
</span><span class="cx"> AddToImplIncludes("RuntimeEnabledFeatures.h");
</span><span class="cx"> my $enable_function = GetRuntimeEnableFunctionName($interface->iterable);
</span><del>- push(@implContent, " if (${enable_function}()) {\n ");
</del><ins>+ push(@implContent, " if (${enable_function}())\n ");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (IsKeyValueIterableInterface($interface)) {
</span><span class="lines">@@ -4689,11 +4691,6 @@
</span><span class="cx"> } else {
</span><span class="cx"> push(@implContent, " addValueIterableMethods(*globalObject(), *this);\n");
</span><span class="cx"> }
</span><del>-
- if ($interface->iterable->extendedAttributes->{EnabledAtRuntime}) {
- push(@implContent, " }\n");
- }
-
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub GetNativeTypeFromSignature
</span><span class="lines">@@ -4928,25 +4925,29 @@
</span><span class="cx">
</span><span class="cx"> my $conditional = $signature->extendedAttributes->{Conditional};
</span><span class="cx"> my $type = $signature->type;
</span><ins>+ my $isNullable = $signature->isNullable;
+ my $mayThrowException = $signature->extendedAttributes->{GetterMayThrowException} || $signature->extendedAttributes->{MayThrowException};
</ins><span class="cx">
</span><span class="cx"> my $globalObject = $thisValue ? "$thisValue->globalObject()" : "jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())";
</span><span class="cx">
</span><ins>+ return "toJSBoolean(*state, throwScope, $value)" if $type eq "boolean" && $mayThrowException;
</ins><span class="cx"> return "jsBoolean($value)" if $type eq "boolean";
</span><ins>+ return "toJSNullableDate(*state, throwScope, $value)" if $type eq "Date" && $isNullable && $mayThrowException;
+ return "jsDateOrNull(state, $value)" if $type eq "Date" && $isNullable;
+ return "toJSDate(*state, throwScope, $value)" if $type eq "Date" && $mayThrowException;
+ return "jsDate(state, $value)" if $type eq "Date";
</ins><span class="cx">
</span><del>- if ($type eq "Date") {
- return "jsDateOrNull(state, $value)" if $signature->isNullable;
- return "jsDate(state, $value)";
- }
-
</del><span class="cx"> if ($codeGenerator->IsNumericType($type) or $type eq "DOMTimeStamp") {
</span><span class="cx"> # We could instead overload a function to work with optional as well as non-optional numbers, but this
</span><span class="cx"> # is slightly better because it guarantees we will fail to compile if the IDL file doesn't match the C++.
</span><del>- my $function = $signature->isNullable ? "toNullableJSNumber" : "jsNumber";
</del><span class="cx"> if ($signature->extendedAttributes->{Reflect} and ($type eq "unsigned long" or $type eq "unsigned short")) {
</span><span class="cx"> $value =~ s/getUnsignedIntegralAttribute/getIntegralAttribute/g;
</span><span class="cx"> $value = "std::max(0, $value)";
</span><span class="cx"> }
</span><del>- return "$function($value)";
</del><ins>+ return "toJSNullableNumber(*state, throwScope, $value)" if $isNullable && $mayThrowException;
+ return "toNullableJSNumber($value)" if $isNullable;
+ return "toJSNumber(*state, throwScope, $value)" if $mayThrowException;
+ return "jsNumber($value)";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($codeGenerator->IsEnumType($type)) {
</span><span class="lines">@@ -4956,7 +4957,7 @@
</span><span class="cx">
</span><span class="cx"> if ($codeGenerator->IsStringType($type)) {
</span><span class="cx"> AddToImplIncludes("URL.h", $conditional);
</span><del>- return "jsStringOrNull(state, $value)" if $signature->isNullable;
</del><ins>+ return "jsStringOrNull(state, $value)" if $isNullable;
</ins><span class="cx"> AddToImplIncludes("<runtime/JSString.h>", $conditional);
</span><span class="cx"> return "jsStringWithCache(state, $value)";
</span><span class="cx"> }
</span><span class="lines">@@ -4963,10 +4964,7 @@
</span><span class="cx">
</span><span class="cx"> if ($codeGenerator->IsSequenceOrFrozenArrayType($type)) {
</span><span class="cx"> my $innerType = $codeGenerator->GetSequenceOrFrozenArrayInnerType($type);
</span><del>- if ($codeGenerator->IsRefPtrType($innerType)) {
- AddToImplIncludes("JS${innerType}.h", $conditional);
- }
-
</del><ins>+ AddToImplIncludes("JS${innerType}.h", $conditional) if $codeGenerator->IsRefPtrType($innerType);
</ins><span class="cx"> return "jsArray(state, $globalObject, $value)" if $codeGenerator->IsSequenceType($type);
</span><span class="cx"> return "jsFrozenArray(state, $globalObject, $value)" if $codeGenerator->IsFrozenArrayType($type);
</span><span class="cx"> }
</span><span class="lines">@@ -5024,8 +5022,13 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- my $function = $signature->extendedAttributes->{NewObject} ? "toJSNewlyCreated" : "toJS";
- return "$function(state, $globalObject, $value)";
</del><ins>+ my $functionName = "toJS";
+ $functionName = "toJSNewlyCreated" if $signature->extendedAttributes->{NewObject};
+
+ my $arguments = "state, $globalObject, $value";
+ $arguments = "*state, *$globalObject, throwScope, $value" if $mayThrowException;
+
+ return "$functionName($arguments)";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub ceilingToPowerOf2
</span><span class="lines">@@ -5568,7 +5571,7 @@
</span><span class="cx"> if ($interface->extendedAttributes->{ConstructorMayThrowLegacyException}) {
</span><span class="cx"> push(@$outputArray, " if (UNLIKELY(ec)) {\n");
</span><span class="cx"> push(@$outputArray, " setDOMException(state, throwScope, ec);\n");
</span><del>- push(@$outputArray, " return JSValue::encode(JSValue());\n");
</del><ins>+ push(@$outputArray, " return encodedJSValue();\n");
</ins><span class="cx"> push(@$outputArray, " }\n");
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLAttributestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx"> Exposed=*
</span><span class="cx"> ForwardDeclareInHeader
</span><span class="cx"> GenerateIsReachable=|Impl|ImplWebGLRenderingContext|ImplDocument|ImplElementRoot|ImplFrame|ImplOwnerNodeRoot|ImplScriptExecutionContext
</span><ins>+GetterMayThrowException
</ins><span class="cx"> GetterMayThrowLegacyException
</span><span class="cx"> GetterMayThrowLegacyExceptionWithMessage
</span><span class="cx"> Immutable
</span><span class="lines">@@ -95,6 +96,7 @@
</span><span class="cx"> JSLegacyParent=*
</span><span class="cx"> LenientThis
</span><span class="cx"> MasqueradesAsUndefined
</span><ins>+MayThrowException
</ins><span class="cx"> MayThrowLegacyException
</span><span class="cx"> MayThrowLegacyExceptionWithMessage
</span><span class="cx"> NamedConstructor=*
</span><span class="lines">@@ -114,6 +116,7 @@
</span><span class="cx"> ReportExternalMemoryCost
</span><span class="cx"> RequiresExistingAtomicString
</span><span class="cx"> SetterCallWith=ScriptExecutionContext|ScriptState|ScriptArguments|CallStack|ActiveWindow|FirstWindow
</span><ins>+SetterMayThrowException
</ins><span class="cx"> SetterMayThrowLegacyException
</span><span class="cx"> SetterMayThrowLegacyExceptionWithMessage
</span><span class="cx"> SkipVTableValidation
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -284,9 +284,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestGlobalObject* castedThis = jsDynamicCast<JSTestGlobalObject*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestGlobalObject", "regularAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -303,9 +302,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestGlobalObject* castedThis = jsDynamicCast<JSTestGlobalObject*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestGlobalObject", "publicAndPrivateAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -323,9 +321,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestGlobalObject* castedThis = jsDynamicCast<JSTestGlobalObject*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestGlobalObject", "publicAndPrivateConditionalAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -344,9 +341,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestGlobalObject* castedThis = jsDynamicCast<JSTestGlobalObject*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestGlobalObject", "enabledAtRuntimeAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx"> auto object = TestInterface::create(*context, WTFMove(str1), WTFMove(str2), ec);
</span><span class="cx"> if (UNLIKELY(ec)) {
</span><span class="cx"> setDOMException(state, throwScope, ec);
</span><del>- return JSValue::encode(JSValue());
</del><ins>+ return encodedJSValue();
</ins><span class="cx"> }
</span><span class="cx"> return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
</span><span class="cx"> }
</span><span class="lines">@@ -701,9 +701,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestInterface", "implementsStr2");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -722,9 +721,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestInterface", "implementsStr3");
</span><del>- }
</del><span class="cx"> castedThis->setImplementsStr3(*state, value);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -740,9 +738,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestInterface", "implementsNode");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSNode::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="lines">@@ -779,9 +776,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestInterface", "supplementalStr2");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -800,9 +796,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestInterface", "supplementalStr3");
</span><del>- }
</del><span class="cx"> castedThis->setSupplementalStr3(*state, value);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -818,9 +813,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestInterface", "supplementalNode");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSNode::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestJSBuiltinConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -197,9 +197,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestJSBuiltinConstructor* castedThis = jsDynamicCast<JSTestJSBuiltinConstructor*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestJSBuiltinConstructor", "testAttributeRWCustom");
</span><del>- }
</del><span class="cx"> castedThis->setTestAttributeRWCustom(*state, value);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx"> auto object = TestNamedConstructor::createForJSConstructor(*castedThis->document(), WTFMove(str1), WTFMove(str2), WTFMove(str3), ec);
</span><span class="cx"> if (UNLIKELY(ec)) {
</span><span class="cx"> setDOMException(state, throwScope, ec);
</span><del>- return JSValue::encode(JSValue());
</del><ins>+ return encodedJSValue();
</ins><span class="cx"> }
</span><span class="cx"> return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -146,9 +146,8 @@
</span><span class="cx"> VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
</span><span class="cx"> JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
</span><span class="cx"> }
</span><del>- if (RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) {
</del><ins>+ if (RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled())
</ins><span class="cx"> putDirect(vm, vm.propertyNames->iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral("[Symbol.Iterator]"), jsTestNodePrototypeFunctionSymbolIterator), DontEnum);
</span><del>- }
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const ClassInfo JSTestNode::s_info = { "TestNode", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestNode) };
</span><span class="lines">@@ -221,9 +220,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestNode* castedThis = jsDynamicCast<JSTestNode*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestNode", "name");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -301,9 +299,8 @@
</span><span class="cx"> auto castedThis = jsDynamicCast<JSTestNode*>(thisValue);
</span><span class="cx"> VM& vm = state->vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>- if (UNLIKELY(!castedThis)){
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwThisTypeError(*state, throwScope, "TestNode", "toJSON");
</span><del>- }
</del><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestNode::info());
</span><span class="cx">
</span><span class="cx"> auto* result = constructEmptyObject(state);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministiccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -364,9 +364,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestNondeterministic", "nondeterministicWriteableAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -383,9 +382,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestNondeterministic", "nondeterministicExceptionAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -402,9 +400,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestNondeterministic", "nondeterministicGetterExceptionAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -421,9 +418,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestNondeterministic", "nondeterministicSetterExceptionAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> ExceptionCode ec = 0;
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -894,6 +894,9 @@
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSerializedValue(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOptionsObject(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithException(JSC::ExecState*);
</span><ins>+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithExceptionReturningLong(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithExceptionReturningObject(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithLegacyException(JSC::ExecState*);
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithExceptionWithMessage(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethod(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(JSC::ExecState*);
</span><span class="lines">@@ -1085,12 +1088,16 @@
</span><span class="cx"> #endif
</span><span class="cx"> JSC::EncodedJSValue jsTestObjTypedArrayAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> bool setJSTestObjTypedArrayAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><del>-JSC::EncodedJSValue jsTestObjAttrWithGetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
-bool setJSTestObjAttrWithGetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</del><ins>+JSC::EncodedJSValue jsTestObjAttributeWithGetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestObjAttributeWithGetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestObjAttributeWithGetterLegacyException(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestObjAttributeWithGetterLegacyException(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</ins><span class="cx"> JSC::EncodedJSValue jsTestObjAttrWithGetterExceptionWithMessage(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> bool setJSTestObjAttrWithGetterExceptionWithMessage(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><del>-JSC::EncodedJSValue jsTestObjAttrWithSetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
-bool setJSTestObjAttrWithSetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</del><ins>+JSC::EncodedJSValue jsTestObjAttributeWithSetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestObjAttributeWithSetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestObjAttributeWithSetterLegacyException(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestObjAttributeWithSetterLegacyException(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</ins><span class="cx"> JSC::EncodedJSValue jsTestObjAttrWithSetterExceptionWithMessage(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> bool setJSTestObjAttrWithSetterExceptionWithMessage(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><span class="cx"> JSC::EncodedJSValue jsTestObjStringAttrWithGetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="lines">@@ -1399,9 +1406,11 @@
</span><span class="cx"> { 0, 0, NoIntrinsic, { 0, 0 } },
</span><span class="cx"> #endif
</span><span class="cx"> { "typedArrayAttr", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTypedArrayAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjTypedArrayAttr) } },
</span><del>- { "attrWithGetterException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttrWithGetterException) } },
</del><ins>+ { "attributeWithGetterException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttributeWithGetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttributeWithGetterException) } },
+ { "attributeWithGetterLegacyException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttributeWithGetterLegacyException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttributeWithGetterLegacyException) } },
</ins><span class="cx"> { "attrWithGetterExceptionWithMessage", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterExceptionWithMessage), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttrWithGetterExceptionWithMessage) } },
</span><del>- { "attrWithSetterException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttrWithSetterException) } },
</del><ins>+ { "attributeWithSetterException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttributeWithSetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttributeWithSetterException) } },
+ { "attributeWithSetterLegacyException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttributeWithSetterLegacyException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttributeWithSetterLegacyException) } },
</ins><span class="cx"> { "attrWithSetterExceptionWithMessage", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterExceptionWithMessage), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttrWithSetterExceptionWithMessage) } },
</span><span class="cx"> { "stringAttrWithGetterException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithGetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringAttrWithGetterException) } },
</span><span class="cx"> { "stringAttrWithSetterException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithSetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringAttrWithSetterException) } },
</span><span class="lines">@@ -1495,6 +1504,9 @@
</span><span class="cx"> { "serializedValue", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionSerializedValue), (intptr_t) (1) } },
</span><span class="cx"> { "optionsObject", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOptionsObject), (intptr_t) (1) } },
</span><span class="cx"> { "methodWithException", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithException), (intptr_t) (0) } },
</span><ins>+ { "methodWithExceptionReturningLong", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithExceptionReturningLong), (intptr_t) (0) } },
+ { "methodWithExceptionReturningObject", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithExceptionReturningObject), (intptr_t) (0) } },
+ { "methodWithLegacyException", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithLegacyException), (intptr_t) (0) } },
</ins><span class="cx"> { "methodWithExceptionWithMessage", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithExceptionWithMessage), (intptr_t) (0) } },
</span><span class="cx"> { "customMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethod), (intptr_t) (0) } },
</span><span class="cx"> { "customMethodWithArgs", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t) (3) } },
</span><span class="lines">@@ -1654,9 +1666,8 @@
</span><span class="cx"> JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);
</span><span class="cx"> putDirect(vm, clientData.builtinNames().privateMethodPrivateName(), JSFunction::create(vm, globalObject(), 0, String(), jsTestObjPrototypeFunctionPrivateMethod), ReadOnly | DontEnum);
</span><span class="cx"> putDirect(vm, clientData.builtinNames().publicAndPrivateMethodPrivateName(), JSFunction::create(vm, globalObject(), 0, String(), jsTestObjPrototypeFunctionPublicAndPrivateMethod), ReadOnly | DontEnum);
</span><del>- if (RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) {
</del><ins>+ if (RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled())
</ins><span class="cx"> addValueIterableMethods(*globalObject(), *this);
</span><del>- }
</del><span class="cx"> JSObject& unscopables = *constructEmptyObject(globalObject()->globalExec(), globalObject()->nullPrototypeObjectStructure());
</span><span class="cx"> unscopables.putDirect(vm, Identifier::fromString(&vm, "voidMethod"), jsBoolean(true));
</span><span class="cx"> unscopables.putDirect(vm, Identifier::fromString(&vm, "shortAttr"), jsBoolean(true));
</span><span class="lines">@@ -2375,20 +2386,36 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline JSValue jsTestObjAttrWithGetterExceptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
</del><ins>+static inline JSValue jsTestObjAttributeWithGetterExceptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
</ins><span class="cx">
</span><del>-EncodedJSValue jsTestObjAttrWithGetterException(ExecState* state, EncodedJSValue thisValue, PropertyName)
</del><ins>+EncodedJSValue jsTestObjAttributeWithGetterException(ExecState* state, EncodedJSValue thisValue, PropertyName)
</ins><span class="cx"> {
</span><del>- return BindingCaller<JSTestObj>::attribute<jsTestObjAttrWithGetterExceptionGetter>(state, thisValue, "attrWithGetterException");
</del><ins>+ return BindingCaller<JSTestObj>::attribute<jsTestObjAttributeWithGetterExceptionGetter>(state, thisValue, "attributeWithGetterException");
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static inline JSValue jsTestObjAttrWithGetterExceptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
</del><ins>+static inline JSValue jsTestObjAttributeWithGetterExceptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
</ins><span class="cx"> {
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> UNUSED_PARAM(state);
</span><ins>+ auto& impl = thisObject->wrapped();
+ JSValue result = toJSNumber(*state, throwScope, impl.attributeWithGetterException());
+ return result;
+}
+
+static inline JSValue jsTestObjAttributeWithGetterLegacyExceptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
+
+EncodedJSValue jsTestObjAttributeWithGetterLegacyException(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+ return BindingCaller<JSTestObj>::attribute<jsTestObjAttributeWithGetterLegacyExceptionGetter>(state, thisValue, "attributeWithGetterLegacyException");
+}
+
+static inline JSValue jsTestObjAttributeWithGetterLegacyExceptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
+ UNUSED_PARAM(throwScope);
+ UNUSED_PARAM(state);
</ins><span class="cx"> ExceptionCode ec = 0;
</span><span class="cx"> auto& impl = thisObject->wrapped();
</span><del>- JSValue result = jsNumber(impl.attrWithGetterException(ec));
</del><ins>+ JSValue result = jsNumber(impl.attributeWithGetterLegacyException(ec));
</ins><span class="cx"> setDOMException(state, throwScope, ec);
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="lines">@@ -2411,22 +2438,38 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline JSValue jsTestObjAttrWithSetterExceptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
</del><ins>+static inline JSValue jsTestObjAttributeWithSetterExceptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
</ins><span class="cx">
</span><del>-EncodedJSValue jsTestObjAttrWithSetterException(ExecState* state, EncodedJSValue thisValue, PropertyName)
</del><ins>+EncodedJSValue jsTestObjAttributeWithSetterException(ExecState* state, EncodedJSValue thisValue, PropertyName)
</ins><span class="cx"> {
</span><del>- return BindingCaller<JSTestObj>::attribute<jsTestObjAttrWithSetterExceptionGetter>(state, thisValue, "attrWithSetterException");
</del><ins>+ return BindingCaller<JSTestObj>::attribute<jsTestObjAttributeWithSetterExceptionGetter>(state, thisValue, "attributeWithSetterException");
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static inline JSValue jsTestObjAttrWithSetterExceptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
</del><ins>+static inline JSValue jsTestObjAttributeWithSetterExceptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
</ins><span class="cx"> {
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> auto& impl = thisObject->wrapped();
</span><del>- JSValue result = jsNumber(impl.attrWithSetterException());
</del><ins>+ JSValue result = jsNumber(impl.attributeWithSetterException());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static inline JSValue jsTestObjAttributeWithSetterLegacyExceptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
+
+EncodedJSValue jsTestObjAttributeWithSetterLegacyException(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+ return BindingCaller<JSTestObj>::attribute<jsTestObjAttributeWithSetterLegacyExceptionGetter>(state, thisValue, "attributeWithSetterLegacyException");
+}
+
+static inline JSValue jsTestObjAttributeWithSetterLegacyExceptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
+ UNUSED_PARAM(throwScope);
+ UNUSED_PARAM(state);
+ auto& impl = thisObject->wrapped();
+ JSValue result = jsNumber(impl.attributeWithSetterLegacyException());
+ return result;
+}
+
</ins><span class="cx"> static inline JSValue jsTestObjAttrWithSetterExceptionWithMessageGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
</span><span class="cx">
</span><span class="cx"> EncodedJSValue jsTestObjAttrWithSetterExceptionWithMessage(ExecState* state, EncodedJSValue thisValue, PropertyName)
</span><span class="lines">@@ -3228,9 +3271,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "TestSubObjEnabledBySetting");
</span><del>- }
</del><span class="cx"> // Shadowing a built-in constructor.
</span><span class="cx"> return castedThis->putDirect(state->vm(), Identifier::fromString(state, "TestSubObjEnabledBySetting"), value);
</span><span class="cx"> }
</span><span class="lines">@@ -3244,9 +3286,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "enumAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = parse<TestObj::EnumType>(*state, value);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3265,9 +3306,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "byteAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int8_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3284,9 +3324,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "octetAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<uint8_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3303,9 +3342,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "shortAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int16_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3322,9 +3360,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "clampedShortAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int16_t>(*state, value, Clamp);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3341,9 +3378,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "enforceRangeShortAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int16_t>(*state, value, EnforceRange);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3360,9 +3396,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "unsignedShortAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<uint16_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3379,9 +3414,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "longAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3398,9 +3432,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "longLongAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int64_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3417,9 +3450,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "unsignedLongLongAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<uint64_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3436,9 +3468,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "stringAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3455,9 +3486,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "usvstringAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = valueToUSVString(state, value);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3474,9 +3504,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "testObjAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="lines">@@ -3496,9 +3525,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "testNullableObjAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> TestObj* nativeValue = nullptr;
</span><span class="cx"> if (!value.isUndefinedOrNull()) {
</span><span class="lines">@@ -3521,9 +3549,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return false;
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="lines">@@ -3543,9 +3570,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "stringAttrTreatingNullAsEmptyString");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = valueToStringTreatingNullAsEmptyString(state, value);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3562,9 +3588,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "usvstringAttrTreatingNullAsEmptyString");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = valueToUSVStringTreatingNullAsEmptyString(state, value);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3581,9 +3606,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "implementationEnumAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = parse<AlternateEnumName>(*state, value);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3602,9 +3626,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "XMLObjAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="lines">@@ -3624,9 +3647,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "create");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toBoolean(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3643,9 +3665,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "reflectedStringAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3662,9 +3683,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "reflectedUSVStringAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = valueToUSVString(state, value);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3681,9 +3701,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "reflectedIntegralAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3700,9 +3719,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "reflectedUnsignedIntegralAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<uint32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3719,9 +3737,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "reflectedBooleanAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toBoolean(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3738,9 +3755,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "reflectedURLAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3757,9 +3773,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "reflectedUSVURLAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = valueToUSVString(state, value);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3776,9 +3791,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "reflectedStringAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3795,9 +3809,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "reflectedCustomIntegralAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3814,9 +3827,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "reflectedCustomBooleanAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toBoolean(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3833,9 +3845,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "reflectedCustomURLAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3853,9 +3864,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "enabledAtRuntimeAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3873,9 +3883,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "typedArrayAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = toFloat32Array(value);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3888,7 +3897,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-bool setJSTestObjAttrWithGetterException(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
</del><ins>+bool setJSTestObjAttributeWithGetterException(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = state->vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><span class="lines">@@ -3896,17 +3905,34 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
- return throwSetterTypeError(*state, throwScope, "TestObject", "attrWithGetterException");
- }
</del><ins>+ if (UNLIKELY(!castedThis))
+ return throwSetterTypeError(*state, throwScope, "TestObject", "attributeWithGetterException");
</ins><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><del>- impl.setAttrWithGetterException(WTFMove(nativeValue));
</del><ins>+ impl.setAttributeWithGetterException(WTFMove(nativeValue));
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+bool setJSTestObjAttributeWithGetterLegacyException(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ VM& vm = state->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ UNUSED_PARAM(throwScope);
+ JSValue value = JSValue::decode(encodedValue);
+ UNUSED_PARAM(thisValue);
+ JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThis))
+ return throwSetterTypeError(*state, throwScope, "TestObject", "attributeWithGetterLegacyException");
+ auto& impl = castedThis->wrapped();
+ auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
+ RETURN_IF_EXCEPTION(throwScope, false);
+ impl.setAttributeWithGetterLegacyException(WTFMove(nativeValue));
+ return true;
+}
+
+
</ins><span class="cx"> bool setJSTestObjAttrWithGetterExceptionWithMessage(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
</span><span class="cx"> {
</span><span class="cx"> VM& vm = state->vm();
</span><span class="lines">@@ -3915,9 +3941,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "attrWithGetterExceptionWithMessage");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3926,7 +3951,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-bool setJSTestObjAttrWithSetterException(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
</del><ins>+bool setJSTestObjAttributeWithSetterException(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = state->vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><span class="lines">@@ -3934,14 +3959,31 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
- return throwSetterTypeError(*state, throwScope, "TestObject", "attrWithSetterException");
- }
</del><ins>+ if (UNLIKELY(!castedThis))
+ return throwSetterTypeError(*state, throwScope, "TestObject", "attributeWithSetterException");
</ins><span class="cx"> auto& impl = castedThis->wrapped();
</span><ins>+ auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
+ RETURN_IF_EXCEPTION(throwScope, false);
+ propagateException(*state, throwScope, impl.setAttributeWithSetterException(WTFMove(nativeValue)));
+ return true;
+}
+
+
+bool setJSTestObjAttributeWithSetterLegacyException(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ VM& vm = state->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ UNUSED_PARAM(throwScope);
+ JSValue value = JSValue::decode(encodedValue);
+ UNUSED_PARAM(thisValue);
+ JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThis))
+ return throwSetterTypeError(*state, throwScope, "TestObject", "attributeWithSetterLegacyException");
+ auto& impl = castedThis->wrapped();
</ins><span class="cx"> ExceptionCode ec = 0;
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><del>- impl.setAttrWithSetterException(WTFMove(nativeValue), ec);
</del><ins>+ impl.setAttributeWithSetterLegacyException(WTFMove(nativeValue), ec);
</ins><span class="cx"> setDOMException(state, throwScope, ec);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -3955,9 +3997,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "attrWithSetterExceptionWithMessage");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> ExceptionCodeWithMessage ec;
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="lines">@@ -3976,9 +4017,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "stringAttrWithGetterException");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -3995,9 +4035,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "stringAttrWithSetterException");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> ExceptionCode ec = 0;
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="lines">@@ -4016,9 +4055,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "customAttr");
</span><del>- }
</del><span class="cx"> castedThis->setCustomAttr(*state, value);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -4032,9 +4070,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "onfoo");
</span><del>- }
</del><span class="cx"> setEventHandlerAttribute(*state, *castedThis, castedThis->wrapped(), eventNames().fooEvent, value);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -4048,9 +4085,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "onwebkitfoo");
</span><del>- }
</del><span class="cx"> setEventHandlerAttribute(*state, *castedThis, castedThis->wrapped(), eventNames().fooEvent, value);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -4064,9 +4100,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "withScriptStateAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -4083,9 +4118,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "withCallWithAndSetterCallWithAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -4102,9 +4136,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="lines">@@ -4127,9 +4160,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "withScriptStateAttributeRaises");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="lines">@@ -4149,9 +4181,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAttributeRaises");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="lines">@@ -4174,9 +4205,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAndScriptStateAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="lines">@@ -4199,9 +4229,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAndScriptStateAttributeRaises");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="lines">@@ -4224,9 +4253,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAndScriptStateWithSpacesAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="lines">@@ -4249,9 +4277,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "withScriptArgumentsAndCallStackAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="lines">@@ -4272,9 +4299,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "conditionalAttr1");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -4293,9 +4319,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "conditionalAttr2");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -4314,9 +4339,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "conditionalAttr3");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -4335,9 +4359,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "conditionalAttr4");
</span><del>- }
</del><span class="cx"> // Shadowing a built-in constructor.
</span><span class="cx"> return castedThis->putDirect(state->vm(), Identifier::fromString(state, "conditionalAttr4"), value);
</span><span class="cx"> }
</span><span class="lines">@@ -4353,9 +4376,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "conditionalAttr5");
</span><del>- }
</del><span class="cx"> // Shadowing a built-in constructor.
</span><span class="cx"> return castedThis->putDirect(state->vm(), Identifier::fromString(state, "conditionalAttr5"), value);
</span><span class="cx"> }
</span><span class="lines">@@ -4371,9 +4393,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "conditionalAttr6");
</span><del>- }
</del><span class="cx"> // Shadowing a built-in constructor.
</span><span class="cx"> return castedThis->putDirect(state->vm(), Identifier::fromString(state, "conditionalAttr6"), value);
</span><span class="cx"> }
</span><span class="lines">@@ -4388,9 +4409,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "anyAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value;
</span><span class="cx"> impl.setAnyAttribute(WTFMove(nativeValue));
</span><span class="lines">@@ -4406,9 +4426,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "mutablePoint");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> SVGPropertyTearOff<SVGPoint>* nativeValue = nullptr;
</span><span class="cx"> if (!value.isUndefinedOrNull()) {
</span><span class="lines">@@ -4431,9 +4450,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "immutablePoint");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> SVGPropertyTearOff<SVGPoint>* nativeValue = nullptr;
</span><span class="cx"> if (!value.isUndefinedOrNull()) {
</span><span class="lines">@@ -4456,9 +4474,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "strawberry");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -4475,9 +4492,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "id");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -4494,9 +4510,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "replaceableAttribute");
</span><del>- }
</del><span class="cx"> // Shadowing a built-in property.
</span><span class="cx"> return castedThis->putDirect(state->vm(), Identifier::fromString(state, "replaceableAttribute"), value);
</span><span class="cx"> }
</span><span class="lines">@@ -4510,9 +4525,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "nullableLongSettableAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -4529,9 +4543,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "nullableStringSettableAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = valueToStringWithUndefinedOrNullCheck(state, value);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -4548,9 +4561,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "nullableUSVStringSettableAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = valueToUSVStringWithUndefinedOrNullCheck(state, value);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -4567,9 +4579,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "nullableStringValue");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -4586,9 +4597,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "attributeWithReservedEnumType");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = parse<TestObj::Optional>(*state, value);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -4607,9 +4617,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "putForwardsAttribute");
</span><del>- }
</del><span class="cx"> Ref<TestNode> forwardedImpl = castedThis->wrapped().putForwardsAttribute();
</span><span class="cx"> auto& impl = forwardedImpl.get();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="lines">@@ -4627,9 +4636,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "putForwardsNullableAttribute");
</span><del>- }
</del><span class="cx"> RefPtr<TestNode> forwardedImpl = castedThis->wrapped().putForwardsNullableAttribute();
</span><span class="cx"> if (!forwardedImpl)
</span><span class="cx"> return false;
</span><span class="lines">@@ -4649,9 +4657,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestObject", "stringifierAttribute");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = valueToUSVString(state, value);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -5092,9 +5099,9 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto enumArgValue = state->argument(0);
</span><span class="cx"> TestObj::EnumType enumArg;
</span><del>- if (enumArgValue.isUndefined()) {
</del><ins>+ if (enumArgValue.isUndefined())
</ins><span class="cx"> enumArg = TestObj::EnumType::EnumValue1;
</span><del>- } else {
</del><ins>+ else {
</ins><span class="cx"> auto optionalValue = parse<TestObj::EnumType>(*state, enumArgValue);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> if (UNLIKELY(!optionalValue))
</span><span class="lines">@@ -5236,8 +5243,53 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "methodWithException");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><ins>+ propagateException(*state, throwScope, impl.methodWithException());
+ return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithExceptionReturningLong(ExecState* state)
+{
+ VM& vm = state->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ UNUSED_PARAM(throwScope);
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, throwScope, "TestObject", "methodWithExceptionReturningLong");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+ auto& impl = castedThis->wrapped();
+ JSValue result = toJSNumber(*state, throwScope, impl.methodWithExceptionReturningLong());
+ return JSValue::encode(result);
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithExceptionReturningObject(ExecState* state)
+{
+ VM& vm = state->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ UNUSED_PARAM(throwScope);
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, throwScope, "TestObject", "methodWithExceptionReturningObject");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+ auto& impl = castedThis->wrapped();
+ JSValue result = toJS(*state, *castedThis->globalObject(), throwScope, impl.methodWithExceptionReturningObject());
+ return JSValue::encode(result);
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithLegacyException(ExecState* state)
+{
+ VM& vm = state->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ UNUSED_PARAM(throwScope);
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, throwScope, "TestObject", "methodWithLegacyException");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+ auto& impl = castedThis->wrapped();
</ins><span class="cx"> ExceptionCode ec = 0;
</span><del>- impl.methodWithException(ec);
</del><ins>+ impl.methodWithLegacyException(ec);
</ins><span class="cx"> setDOMException(state, throwScope, ec);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -7596,9 +7648,8 @@
</span><span class="cx"> auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
</span><span class="cx"> VM& vm = state->vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>- if (UNLIKELY(!castedThis)){
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObj", "toJSON");
</span><del>- }
</del><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">
</span><span class="cx"> auto* result = constructEmptyObject(state);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -255,9 +255,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestSerializedScriptValueInterface* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestSerializedScriptValueInterface", "value");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = SerializedScriptValue::create(state, value, 0, 0);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -274,9 +273,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestSerializedScriptValueInterface* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestSerializedScriptValueInterface", "cachedValue");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = SerializedScriptValue::create(state, value, 0, 0);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -361,9 +361,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestTypedefs* castedThis = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestTypedefs", "unsignedLongLongAttr");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<uint64_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -380,9 +379,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestTypedefs* castedThis = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestTypedefs", "immutableSerializedScriptValue");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = SerializedScriptValue::create(state, value, 0, 0);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -399,9 +397,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestTypedefs* castedThis = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestTypedefs", "attrWithGetterException");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -418,9 +415,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestTypedefs* castedThis = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestTypedefs", "attrWithSetterException");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> ExceptionCode ec = 0;
</span><span class="cx"> auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</span><span class="lines">@@ -439,9 +435,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestTypedefs* castedThis = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestTypedefs", "stringAttrWithGetterException");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="lines">@@ -458,9 +453,8 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx"> UNUSED_PARAM(thisValue);
</span><span class="cx"> JSTestTypedefs* castedThis = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue));
</span><del>- if (UNLIKELY(!castedThis)) {
</del><ins>+ if (UNLIKELY(!castedThis))
</ins><span class="cx"> return throwSetterTypeError(*state, throwScope, "TestTypedefs", "stringAttrWithSetterException");
</span><del>- }
</del><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> ExceptionCode ec = 0;
</span><span class="cx"> auto nativeValue = value.toWTFString(state);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -115,14 +115,14 @@
</span><span class="cx"> [EnabledAtRuntime=DOMIterator] iterable<DOMString>;
</span><span class="cx">
</span><span class="cx"> // Methods
</span><del>- [Unscopable] void voidMethod();
- void voidMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
- byte byteMethod();
- byte byteMethodWithArgs(byte byteArg, DOMString strArg, TestObj objArg);
- octet octetMethod();
- octet octetMethodWithArgs(octet octetArg, DOMString strArg, TestObj objArg);
- long longMethod();
- long longMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
</del><ins>+ [Unscopable] void voidMethod();
+ void voidMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
+ byte byteMethod();
+ byte byteMethodWithArgs(byte byteArg, DOMString strArg, TestObj objArg);
+ octet octetMethod();
+ octet octetMethodWithArgs(octet octetArg, DOMString strArg, TestObj objArg);
+ long longMethod();
+ long longMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
</ins><span class="cx"> TestObj objMethod();
</span><span class="cx"> TestObj objMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
</span><span class="cx"> [Unforgeable] long unforgeableMethod();
</span><span class="lines">@@ -149,11 +149,16 @@
</span><span class="cx"> void optionsObject(Dictionary oo, optional Dictionary ooo);
</span><span class="cx">
</span><span class="cx"> // Exceptions
</span><del>- [MayThrowLegacyException] void methodWithException();
</del><ins>+ [MayThrowException] void methodWithException();
+ [MayThrowException] long methodWithExceptionReturningLong();
+ [MayThrowException] TestObj methodWithExceptionReturningObject();
+ [MayThrowLegacyException] void methodWithLegacyException();
</ins><span class="cx"> [MayThrowLegacyExceptionWithMessage] void methodWithExceptionWithMessage();
</span><del>- [GetterMayThrowLegacyException] attribute long attrWithGetterException;
</del><ins>+ [GetterMayThrowException] attribute long attributeWithGetterException;
+ [GetterMayThrowLegacyException] attribute long attributeWithGetterLegacyException;
</ins><span class="cx"> [GetterMayThrowLegacyExceptionWithMessage] attribute long attrWithGetterExceptionWithMessage;
</span><del>- [SetterMayThrowLegacyException] attribute long attrWithSetterException;
</del><ins>+ [SetterMayThrowException] attribute long attributeWithSetterException;
+ [SetterMayThrowLegacyException] attribute long attributeWithSetterLegacyException;
</ins><span class="cx"> [SetterMayThrowLegacyExceptionWithMessage] attribute long attrWithSetterExceptionWithMessage;
</span><span class="cx"> [GetterMayThrowLegacyException] attribute DOMString stringAttrWithGetterException;
</span><span class="cx"> [SetterMayThrowLegacyException] attribute DOMString stringAttrWithSetterException;
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMImplementationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMImplementation.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMImplementation.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/dom/DOMImplementation.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx"> String localName;
</span><span class="cx"> Document::parseQualifiedName(qualifiedName, prefix, localName, ec);
</span><span class="cx"> if (ec)
</span><del>- return Exception(ec);
</del><ins>+ return Exception { ec };
</ins><span class="cx">
</span><span class="cx"> return DocumentType::create(m_document, qualifiedName, publicId, systemId);
</span><span class="cx"> }
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx"> ExceptionCode ec = 0;
</span><span class="cx"> documentElement = document->createElementNS(namespaceURI, qualifiedName, ec);
</span><span class="cx"> if (ec)
</span><del>- return Exception(ec);
</del><ins>+ return Exception { ec };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (documentType)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMImplementationidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMImplementation.idl (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMImplementation.idl        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/dom/DOMImplementation.idl        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -23,8 +23,8 @@
</span><span class="cx"> GenerateIsReachable=ImplDocument,
</span><span class="cx"> ImplementationLacksVTable,
</span><span class="cx"> ] interface DOMImplementation {
</span><del>- [NewObject] DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId);
- [NewObject] XMLDocument createDocument(DOMString? namespaceURI, [TreatNullAs=EmptyString] DOMString qualifiedName, optional DocumentType? doctype = null);
</del><ins>+ [NewObject, MayThrowException] DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId);
+ [NewObject, MayThrowException] XMLDocument createDocument(DOMString? namespaceURI, [TreatNullAs=EmptyString] DOMString qualifiedName, optional DocumentType? doctype = null);
</ins><span class="cx"> [NewObject] HTMLDocument createHTMLDocument(optional DOMString title);
</span><span class="cx">
</span><span class="cx"> boolean hasFeature();
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -564,6 +564,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><ins>+
</ins><span class="cx"> static bool isAttributeOnAllOwners(const WebCore::QualifiedName& attribute, const WebCore::QualifiedName& prefixedAttribute, const HTMLFrameOwnerElement* owner)
</span><span class="cx"> {
</span><span class="cx"> if (!owner)
</span><span class="lines">@@ -574,14 +575,14 @@
</span><span class="cx"> } while ((owner = owner->document().ownerElement()));
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> Ref<Document> Document::create(Document& contextDocument)
</span><span class="cx"> {
</span><del>- Ref<Document> document = adoptRef(*new Document(nullptr, URL()));
</del><ins>+ auto document = adoptRef(*new Document(nullptr, URL()));
</ins><span class="cx"> document->setContextDocument(contextDocument);
</span><span class="cx"> document->setSecurityOriginPolicy(contextDocument.securityOriginPolicy());
</span><del>-
</del><span class="cx"> return document;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -867,6 +868,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CUSTOM_ELEMENTS)
</span><ins>+
</ins><span class="cx"> static ALWAYS_INLINE RefPtr<HTMLElement> createUpgradeCandidateElement(Document& document, const QualifiedName& name)
</span><span class="cx"> {
</span><span class="cx"> if (!RuntimeEnabledFeatures::sharedFeatures().customElementsEnabled())
</span><span class="lines">@@ -879,17 +881,17 @@
</span><span class="cx"> element->setIsCustomElementUpgradeCandidate();
</span><span class="cx"> return WTFMove(element);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> static RefPtr<Element> createHTMLElementWithNameValidation(Document& document, const AtomicString& localName, ExceptionCode& ec)
</span><span class="cx"> {
</span><del>- RefPtr<HTMLElement> element = HTMLElementFactory::createKnownElement(localName, document);
</del><ins>+ auto element = HTMLElementFactory::createKnownElement(localName, document);
</ins><span class="cx"> if (LIKELY(element))
</span><span class="cx"> return element;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CUSTOM_ELEMENTS)
</span><del>- auto* window = document.domWindow();
- if (window) {
</del><ins>+ if (auto* window = document.domWindow()) {
</ins><span class="cx"> auto* registry = window->customElementRegistry();
</span><span class="cx"> if (UNLIKELY(registry)) {
</span><span class="cx"> if (auto* elementInterface = registry->findInterface(localName))
</span><span class="lines">@@ -1071,8 +1073,7 @@
</span><span class="cx"> static Ref<HTMLElement> createFallbackHTMLElement(Document& document, const QualifiedName& name)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CUSTOM_ELEMENTS)
</span><del>- auto* window = document.domWindow();
- if (window) {
</del><ins>+ if (auto* window = document.domWindow()) {
</ins><span class="cx"> auto* registry = window->customElementRegistry();
</span><span class="cx"> if (UNLIKELY(registry)) {
</span><span class="cx"> if (auto* elementInterface = registry->findInterface(name)) {
</span><span class="lines">@@ -1151,13 +1152,16 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><ins>+
</ins><span class="cx"> bool Document::isCSSGridLayoutEnabled() const
</span><span class="cx"> {
</span><span class="cx"> return RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_REGIONS)
</span><ins>+
</ins><span class="cx"> RefPtr<DOMNamedFlowCollection> Document::webkitGetNamedFlows()
</span><span class="cx"> {
</span><span class="cx"> if (!renderView())
</span><span class="lines">@@ -1167,6 +1171,7 @@
</span><span class="cx">
</span><span class="cx"> return namedFlows().createCSSOMSnapshot();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> NamedFlowCollection& Document::namedFlows()
</span><span class="lines">@@ -1665,8 +1670,8 @@
</span><span class="cx"> return pageVisibilityState() != PageVisibilityStateVisible;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(VIDEO)
</ins><span class="cx">
</span><del>-#if ENABLE(VIDEO)
</del><span class="cx"> void Document::registerForAllowsMediaDocumentInlinePlaybackChangedCallbacks(HTMLMediaElement& element)
</span><span class="cx"> {
</span><span class="cx"> m_allowsMediaDocumentInlinePlaybackElements.add(&element);
</span><span class="lines">@@ -1682,6 +1687,7 @@
</span><span class="cx"> for (auto* element : m_allowsMediaDocumentInlinePlaybackElements)
</span><span class="cx"> element->allowsMediaDocumentInlinePlaybackChanged();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> String Document::nodeName() const
</span><span class="lines">@@ -2976,6 +2982,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><ins>+
</ins><span class="cx"> IDBClient::IDBConnectionProxy* Document::idbConnectionProxy()
</span><span class="cx"> {
</span><span class="cx"> if (!m_idbConnectionProxy) {
</span><span class="lines">@@ -2982,19 +2989,20 @@
</span><span class="cx"> Page* currentPage = page();
</span><span class="cx"> if (!currentPage)
</span><span class="cx"> return nullptr;
</span><del>-
</del><span class="cx"> m_idbConnectionProxy = &currentPage->idbConnection().proxy();
</span><span class="cx"> }
</span><del>-
</del><span class="cx"> return m_idbConnectionProxy.get();
</span><span class="cx"> }
</span><del>-#endif // ENABLE(INDEXED_DATABASE)
</del><span class="cx">
</span><ins>+#endif
+
</ins><span class="cx"> #if ENABLE(WEB_SOCKETS)
</span><ins>+
</ins><span class="cx"> SocketProvider* Document::socketProvider()
</span><span class="cx"> {
</span><span class="cx"> return m_socketProvider.get();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> bool Document::canNavigate(Frame* targetFrame)
</span><span class="lines">@@ -3596,6 +3604,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><ins>+
</ins><span class="cx"> const Vector<AnnotatedRegionValue>& Document::annotatedRegions() const
</span><span class="cx"> {
</span><span class="cx"> return m_annotatedRegions;
</span><span class="lines">@@ -3606,6 +3615,7 @@
</span><span class="cx"> m_annotatedRegions = regions;
</span><span class="cx"> setAnnotatedRegionsDirty(false);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> bool Document::setFocusedElement(Element* element, FocusDirection direction, FocusRemovalEventsMode eventsMode)
</span><span class="lines">@@ -4366,7 +4376,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // http://www.whatwg.org/specs/web-apps/current-work/#dom-document-lastmodified
</span><del>-String Document::lastModified() const
</del><ins>+String Document::lastModified()
</ins><span class="cx"> {
</span><span class="cx"> using namespace std::chrono;
</span><span class="cx"> Optional<system_clock::time_point> dateTime;
</span><span class="lines">@@ -4379,11 +4389,11 @@
</span><span class="cx"> if (!dateTime) {
</span><span class="cx"> dateTime = system_clock::now();
</span><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><del>- InputCursor& cursor = inputCursor();
</del><ins>+ auto& cursor = inputCursor();
</ins><span class="cx"> if (cursor.isCapturing())
</span><span class="cx"> cursor.appendInput<DocumentLastModifiedDate>(duration_cast<milliseconds>(dateTime.value().time_since_epoch()).count());
</span><span class="cx"> else if (cursor.isReplaying()) {
</span><del>- if (DocumentLastModifiedDate* input = cursor.fetchInput<DocumentLastModifiedDate>())
</del><ins>+ if (auto* input = cursor.fetchInput<DocumentLastModifiedDate>())
</ins><span class="cx"> dateTime = system_clock::time_point(milliseconds(static_cast<long long>(input->fallbackValue())));
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -4713,6 +4723,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><ins>+
</ins><span class="cx"> void Document::registerForCaptionPreferencesChangedCallbacks(Element* e)
</span><span class="cx"> {
</span><span class="cx"> if (page())
</span><span class="lines">@@ -4731,9 +4742,11 @@
</span><span class="cx"> for (auto* element : m_captionPreferencesChangedElements)
</span><span class="cx"> element->captionPreferencesChanged();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(MEDIA_CONTROLS_SCRIPT)
</span><ins>+
</ins><span class="cx"> void Document::registerForPageScaleFactorChangedCallbacks(HTMLMediaElement* element)
</span><span class="cx"> {
</span><span class="cx"> m_pageScaleFactorChangedElements.add(element);
</span><span class="lines">@@ -4765,6 +4778,7 @@
</span><span class="cx"> for (auto* mediaElement : m_userInterfaceLayoutDirectionChangedElements)
</span><span class="cx"> mediaElement->userInterfaceLayoutDirectionChanged();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void Document::setShouldCreateRenderers(bool f)
</span><span class="lines">@@ -5074,7 +5088,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(TELEPHONE_NUMBER_DETECTION)
</span><del>-// FIXME: Find a better place for this functionality.
</del><ins>+
+// FIXME: Find a better place for this code.
+
</ins><span class="cx"> bool Document::isTelephoneNumberParsingEnabled() const
</span><span class="cx"> {
</span><span class="cx"> Settings* settings = this->settings();
</span><span class="lines">@@ -5090,6 +5106,7 @@
</span><span class="cx"> {
</span><span class="cx"> return m_isTelephoneNumberParsingAllowed;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> RefPtr<XPathExpression> Document::createExpression(const String& expression, RefPtr<XPathNSResolver>&& resolver, ExceptionCode& ec)
</span><span class="lines">@@ -5565,6 +5582,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS)
</span><ins>+
</ins><span class="cx"> DeviceMotionController* Document::deviceMotionController() const
</span><span class="cx"> {
</span><span class="cx"> return m_deviceMotionController.get();
</span><span class="lines">@@ -5574,9 +5592,11 @@
</span><span class="cx"> {
</span><span class="cx"> return m_deviceOrientationController.get();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><ins>+
</ins><span class="cx"> bool Document::fullScreenIsAllowedForElement(Element* element) const
</span><span class="cx"> {
</span><span class="cx"> ASSERT(element);
</span><span class="lines">@@ -6035,30 +6055,34 @@
</span><span class="cx"> target = doc;
</span><span class="cx"> m_fullScreenChangeEventTargetQueue.append(target);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><ins>+
</ins><span class="cx"> void Document::exitPointerLock()
</span><span class="cx"> {
</span><del>- if (!page())
</del><ins>+ Page* page = this>page();
+ if (!page)
</ins><span class="cx"> return;
</span><del>- if (Element* target = page()->pointerLockController().element()) {
</del><ins>+ if (auto* target = page->pointerLockController().element()) {
</ins><span class="cx"> if (&target->document() != this)
</span><span class="cx"> return;
</span><span class="cx"> }
</span><del>- page()->pointerLockController().requestPointerUnlock();
</del><ins>+ page->pointerLockController().requestPointerUnlock();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Element* Document::pointerLockElement() const
</span><span class="cx"> {
</span><del>- if (!page() || page()->pointerLockController().lockPending())
</del><ins>+ Page* page = this>page();
+ if (!page || page->pointerLockController().lockPending())
</ins><span class="cx"> return nullptr;
</span><del>- if (Element* element = page()->pointerLockController().element()) {
- if (&element->document() == this)
- return element;
- }
- return nullptr;
</del><ins>+ auto* element = page()->pointerLockController().element();
+ if (!element || &element->document() != this)
+ return nullptr;
+ return element;
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void Document::decrementLoadEventDelayCount()
</span><span class="lines">@@ -6083,6 +6107,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME)
</span><ins>+
</ins><span class="cx"> int Document::requestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> callback)
</span><span class="cx"> {
</span><span class="cx"> if (!m_scriptedAnimationController) {
</span><span class="lines">@@ -6122,6 +6147,7 @@
</span><span class="cx"> m_scriptedAnimationController->clearDocumentPointer();
</span><span class="cx"> m_scriptedAnimationController = nullptr;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void Document::sendWillRevealEdgeEventsIfNeeded(const IntPoint& oldPosition, const IntPoint& newPosition, const IntRect& visibleRect, const IntSize& contentsSize, Element* target)
</span><span class="lines">@@ -6195,8 +6221,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if !PLATFORM(IOS)
-#if ENABLE(TOUCH_EVENTS)
</del><ins>+#if ENABLE(TOUCH_EVENTS) && !PLATFORM(IOS)
+
</ins><span class="cx"> RefPtr<Touch> Document::createTouch(DOMWindow* window, EventTarget* target, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, float force, ExceptionCode&) const
</span><span class="cx"> {
</span><span class="cx"> // FIXME: It's not clear from the documentation at
</span><span class="lines">@@ -6206,8 +6232,8 @@
</span><span class="cx"> Frame* frame = window ? window->frame() : this->frame();
</span><span class="cx"> return Touch::create(frame, target, identifier, screenX, screenY, pageX, pageY, radiusX, radiusY, rotationAngle, force);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><del>-#endif // !PLATFORM(IOS)
</del><span class="cx">
</span><span class="cx"> void Document::wheelEventHandlersChanged()
</span><span class="cx"> {
</span><span class="lines">@@ -6446,6 +6472,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_DEVICE_ADAPTATION)
</span><ins>+
</ins><span class="cx"> IntSize Document::initialViewportSize() const
</span><span class="cx"> {
</span><span class="cx"> if (!view())
</span><span class="lines">@@ -6452,6 +6479,7 @@
</span><span class="cx"> return IntSize();
</span><span class="cx"> return view()->initialViewportSize();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> Element* eventTargetElementForDocument(Document* document)
</span><span class="lines">@@ -6759,6 +6787,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><ins>+
</ins><span class="cx"> bool Document::wrapCryptoKey(const Vector<uint8_t>& key, Vector<uint8_t>& wrappedKey)
</span><span class="cx"> {
</span><span class="cx"> Page* page = this->page();
</span><span class="lines">@@ -6774,6 +6803,7 @@
</span><span class="cx"> return false;
</span><span class="cx"> return page->chrome().client().unwrapCryptoKey(wrappedKey, key);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif // ENABLE(SUBTLE_CRYPTO)
</span><span class="cx">
</span><span class="cx"> Element* Document::activeElement()
</span><span class="lines">@@ -6796,13 +6826,21 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><del>-void Document::setInputCursor(PassRefPtr<InputCursor> cursor)
</del><ins>+
+JSC::InputCursor& Document::inputCursor()
</ins><span class="cx"> {
</span><ins>+ return m_inputCursor;
+}
+
+void Document::setInputCursor(Ref<InputCursor>&& cursor)
+{
</ins><span class="cx"> m_inputCursor = WTFMove(cursor);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><ins>+
</ins><span class="cx"> static uint64_t nextPlaybackTargetClientContextId()
</span><span class="cx"> {
</span><span class="cx"> static uint64_t contextId = 0;
</span><span class="lines">@@ -6893,16 +6931,18 @@
</span><span class="cx">
</span><span class="cx"> it->value->setShouldPlayToPlaybackTarget(shouldPlay);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif // ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><span class="cx">
</span><span class="cx"> #if ENABLE(MEDIA_SESSION)
</span><ins>+
</ins><span class="cx"> MediaSession& Document::defaultMediaSession()
</span><span class="cx"> {
</span><span class="cx"> if (!m_defaultMediaSession)
</span><span class="cx"> m_defaultMediaSession = MediaSession::create(*scriptExecutionContext());
</span><del>-
</del><span class="cx"> return *m_defaultMediaSession;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> ShouldOpenExternalURLsPolicy Document::shouldOpenExternalURLsPolicyToPropagate() const
</span><span class="lines">@@ -6962,4 +7002,9 @@
</span><span class="cx"> downcast<HTMLHtmlElement>(*documentElement).setDir(value);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+DOMSelection* Document::getSelection()
+{
+ return m_domWindow ? m_domWindow->getSelection() : nullptr;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/dom/Document.h        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -443,8 +443,8 @@
</span><span class="cx"> WEBCORE_EXPORT void setDocumentURI(const String&);
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><del>- JSC::InputCursor& inputCursor() const { return *m_inputCursor; }
- void setInputCursor(PassRefPtr<JSC::InputCursor>);
</del><ins>+ JSC::InputCursor& inputCursor();
+ void setInputCursor(Ref<JSC::InputCursor>&&);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void visibilityStateChanged();
</span><span class="lines">@@ -852,7 +852,7 @@
</span><span class="cx"> WEBCORE_EXPORT String domain() const;
</span><span class="cx"> void setDomain(const String& newDomain, ExceptionCode&);
</span><span class="cx">
</span><del>- WEBCORE_EXPORT String lastModified() const;
</del><ins>+ WEBCORE_EXPORT String lastModified();
</ins><span class="cx">
</span><span class="cx"> // The cookieURL is used to query the cookie database for this document's
</span><span class="cx"> // cookies. For example, if the cookie URL is http://example.com, we'll
</span><span class="lines">@@ -1292,6 +1292,8 @@
</span><span class="cx"> using ContainerNode::setAttributeEventListener;
</span><span class="cx"> void setAttributeEventListener(const AtomicString& eventType, const QualifiedName& attributeName, const AtomicString& value);
</span><span class="cx">
</span><ins>+ DOMSelection* getSelection();
+
</ins><span class="cx"> protected:
</span><span class="cx"> enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 };
</span><span class="cx"> Document(Frame*, const URL&, unsigned = DefaultDocumentClass, unsigned constructionFlags = 0);
</span><span class="lines">@@ -1711,7 +1713,7 @@
</span><span class="cx"> Ref<CSSFontSelector> m_fontSelector;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><del>- RefPtr<JSC::InputCursor> m_inputCursor;
</del><ins>+ Ref<JSC::InputCursor> m_inputCursor;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> Timer m_didAssociateFormControlsTimer;
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.idl (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.idl        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/dom/Document.idl        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> readonly attribute Element? documentElement;
</span><span class="cx">
</span><span class="cx"> [NewObject, MayThrowLegacyException, ImplementedAs=createElementForBindings] Element createElement(DOMString tagName);
</span><del>- [NewObject] DocumentFragment createDocumentFragment();
</del><ins>+ [NewObject] DocumentFragment createDocumentFragment();
</ins><span class="cx">
</span><span class="cx"> [NewObject] Text createTextNode(DOMString data);
</span><span class="cx"> [NewObject] Comment createComment(DOMString data);
</span><span class="lines">@@ -63,12 +63,8 @@
</span><span class="cx">
</span><span class="cx"> [NewObject] Range createRange();
</span><span class="cx">
</span><del>- [NewObject] NodeIterator createNodeIterator(Node root,
- optional unsigned long whatToShow = 0xFFFFFFFF,
- optional NodeFilter? filter = null);
- [NewObject] TreeWalker createTreeWalker(Node root,
- optional unsigned long whatToShow = 0xFFFFFFFF,
- optional NodeFilter? filter = null);
</del><ins>+ [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
+ [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
</ins><span class="cx">
</span><span class="cx"> readonly attribute DOMWindow defaultView;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomExceptionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Exception.h (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Exception.h        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/dom/Exception.h        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -34,11 +34,11 @@
</span><span class="cx">
</span><span class="cx"> class Exception {
</span><span class="cx"> public:
</span><del>- explicit Exception(ExceptionCode);
- explicit Exception(ExceptionCode, const String&);
</del><ins>+ explicit Exception(ExceptionCode, String&& = { });
</ins><span class="cx">
</span><span class="cx"> ExceptionCode code() const { return m_code; }
</span><span class="cx"> const String& message() const { return m_message; }
</span><ins>+ String&& releaseMessage() { return WTFMove(m_message); }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> ExceptionCode m_code;
</span><span class="lines">@@ -45,15 +45,11 @@
</span><span class="cx"> String m_message;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-inline Exception::Exception(ExceptionCode code)
</del><ins>+inline Exception::Exception(ExceptionCode code, String&& message)
</ins><span class="cx"> : m_code(code)
</span><ins>+ , m_message(WTFMove(message))
</ins><span class="cx"> {
</span><ins>+ ASSERT(code);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-inline Exception::Exception(ExceptionCode code, const String& message)
- : m_code(code)
- , m_message(message)
-{
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoredomExceptionOrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ExceptionOr.h (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ExceptionOr.h        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/dom/ExceptionOr.h        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><span class="cx"> #include "Exception.h"
</span><ins>+#include <wtf/Optional.h>
</ins><span class="cx"> #include <wtf/Variant.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -37,14 +38,25 @@
</span><span class="cx"> ExceptionOr(ReturnType&&);
</span><span class="cx">
</span><span class="cx"> bool hasException() const;
</span><del>- ExceptionCode exceptionCode() const;
- const String& exceptionMessage() const;
- ReturnType&& takeReturnValue();
</del><ins>+ Exception&& releaseException();
+ ReturnType&& releaseReturnValue();
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> std::experimental::variant<Exception, ReturnType> m_value;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+template<> class ExceptionOr<void> {
+public:
+ ExceptionOr(Exception&&);
+ ExceptionOr() = default;
+
+ bool hasException() const;
+ Exception&& releaseException();
+
+private:
+ Optional<Exception> m_exception;
+};
+
</ins><span class="cx"> template<typename ReturnType> inline ExceptionOr<ReturnType>::ExceptionOr(Exception&& exception)
</span><span class="cx"> : m_value(WTFMove(exception))
</span><span class="cx"> {
</span><span class="lines">@@ -60,19 +72,29 @@
</span><span class="cx"> return std::experimental::holds_alternative<Exception>(m_value);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<typename ReturnType> inline ExceptionCode ExceptionOr<ReturnType>::exceptionCode() const
</del><ins>+template<typename ReturnType> inline Exception&& ExceptionOr<ReturnType>::releaseException()
</ins><span class="cx"> {
</span><del>- return std::experimental::get<Exception>(m_value).code();
</del><ins>+ return std::experimental::get<Exception>(WTFMove(m_value));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-template<typename ReturnType> inline const String& ExceptionOr<ReturnType>::exceptionMessage() const
</del><ins>+template<typename ReturnType> inline ReturnType&& ExceptionOr<ReturnType>::releaseReturnValue()
</ins><span class="cx"> {
</span><del>- return std::experimental::get<Exception>(m_value).message();
</del><ins>+ return std::experimental::get<ReturnType>(WTFMove(m_value));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-template<typename ReturnType> inline ReturnType&& ExceptionOr<ReturnType>::takeReturnValue()
</del><ins>+inline ExceptionOr<void>::ExceptionOr(Exception&& exception)
+ : m_exception(WTFMove(exception))
</ins><span class="cx"> {
</span><del>- return std::experimental::get<ReturnType>(WTFMove(m_value));
</del><span class="cx"> }
</span><span class="cx">
</span><ins>+inline bool ExceptionOr<void>::hasException() const
+{
+ return !!m_exception;
</ins><span class="cx"> }
</span><ins>+
+inline Exception&& ExceptionOr<void>::releaseException()
+{
+ return WTFMove(m_exception.value());
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoredomTreeScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/TreeScope.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/TreeScope.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/dom/TreeScope.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "TreeScope.h"
</span><span class="cx">
</span><del>-#include "DOMSelection.h"
</del><span class="cx"> #include "DOMWindow.h"
</span><span class="cx"> #include "ElementIterator.h"
</span><span class="cx"> #include "FocusController.h"
</span><span class="lines">@@ -49,7 +48,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> struct SameSizeAsTreeScope {
</span><del>- void* pointers[9];
</del><ins>+ void* pointers[8];
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> COMPILE_ASSERT(sizeof(TreeScope) == sizeof(SameSizeAsTreeScope), treescope_should_stay_small);
</span><span class="lines">@@ -76,10 +75,6 @@
</span><span class="cx">
</span><span class="cx"> TreeScope::~TreeScope()
</span><span class="cx"> {
</span><del>- if (m_selection) {
- m_selection->clearTreeScope();
- m_selection = nullptr;
- }
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void TreeScope::destroyTreeScopeData()
</span><span class="lines">@@ -331,21 +326,6 @@
</span><span class="cx"> return downcast<Element>(node);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-DOMSelection* TreeScope::getSelection() const
-{
- if (!m_rootNode.document().frame())
- return nullptr;
-
- if (m_selection)
- return m_selection.get();
-
- if (this != &m_rootNode.document())
- return m_rootNode.document().getSelection();
-
- m_selection = DOMSelection::create(&m_rootNode.document());
- return m_selection.get();
-}
-
</del><span class="cx"> Element* TreeScope::findAnchor(const String& name)
</span><span class="cx"> {
</span><span class="cx"> if (name.isEmpty())
</span></span></pre></div>
<a id="trunkSourceWebCoredomTreeScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/TreeScope.h (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/TreeScope.h        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/dom/TreeScope.h        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class ContainerNode;
</span><del>-class DOMSelection;
</del><span class="cx"> class Document;
</span><span class="cx"> class Element;
</span><span class="cx"> class HTMLLabelElement;
</span><span class="lines">@@ -88,8 +87,6 @@
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT Element* elementFromPoint(int x, int y);
</span><span class="cx">
</span><del>- DOMSelection* getSelection() const;
-
</del><span class="cx"> // Find first anchor with the given name.
</span><span class="cx"> // First searches for an element with the given ID, but if that fails, then looks
</span><span class="cx"> // for an anchor with the given name. ID matching is always case sensitive, but
</span><span class="lines">@@ -129,8 +126,6 @@
</span><span class="cx"> std::unique_ptr<DocumentOrderedMap> m_labelsByForAttribute;
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<IdTargetObserverRegistry> m_idTargetObserverRegistry;
</span><del>-
- mutable RefPtr<DOMSelection> m_selection;
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> inline bool TreeScope::hasElementWithId(const AtomicStringImpl& id) const
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx"> return &currentWorld(exec) != &mainThreadNormalWorld();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void PageScriptDebugServer::reportException(ExecState* exec, Exception* exception) const
</del><ins>+void PageScriptDebugServer::reportException(ExecState* exec, JSC::Exception* exception) const
</ins><span class="cx"> {
</span><span class="cx"> WebCore::reportException(exec, exception);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMSelection.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMSelection.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/page/DOMSelection.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -41,29 +41,22 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-static Node* selectionShadowAncestor(Frame* frame)
</del><ins>+static Node* selectionShadowAncestor(Frame& frame)
</ins><span class="cx"> {
</span><del>- Node* node = frame->selection().selection().base().anchorNode();
</del><ins>+ auto* node = frame.selection().selection().base().anchorNode();
</ins><span class="cx"> if (!node)
</span><del>- return 0;
-
</del><ins>+ return nullptr;
</ins><span class="cx"> if (!node->isInShadowTree())
</span><del>- return 0;
-
- return frame->document()->ancestorInThisScope(node);
</del><ins>+ return nullptr;
+ // FIXME: Unclear on why this needs to be the possibly null frame.document() instead of the never null node->document().
+ return frame.document()->ancestorInThisScope(node);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-DOMSelection::DOMSelection(const TreeScope* treeScope)
- : DOMWindowProperty(treeScope->rootNode().document().frame())
- , m_treeScope(treeScope)
</del><ins>+DOMSelection::DOMSelection(Frame& frame)
+ : DOMWindowProperty(&frame)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void DOMSelection::clearTreeScope()
-{
- m_treeScope = nullptr;
-}
-
</del><span class="cx"> const VisibleSelection& DOMSelection::visibleSelection() const
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_frame);
</span><span class="lines">@@ -72,13 +65,13 @@
</span><span class="cx">
</span><span class="cx"> static Position anchorPosition(const VisibleSelection& selection)
</span><span class="cx"> {
</span><del>- Position anchor = selection.isBaseFirst() ? selection.start() : selection.end();
</del><ins>+ auto anchor = selection.isBaseFirst() ? selection.start() : selection.end();
</ins><span class="cx"> return anchor.parentAnchoredEquivalent();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static Position focusPosition(const VisibleSelection& selection)
</span><span class="cx"> {
</span><del>- Position focus = selection.isBaseFirst() ? selection.end() : selection.start();
</del><ins>+ auto focus = selection.isBaseFirst() ? selection.end() : selection.start();
</ins><span class="cx"> return focus.parentAnchoredEquivalent();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -96,7 +89,6 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_frame)
</span><span class="cx"> return 0;
</span><del>-
</del><span class="cx"> return shadowAdjustedNode(anchorPosition(visibleSelection()));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -104,7 +96,6 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_frame)
</span><span class="cx"> return 0;
</span><del>-
</del><span class="cx"> return shadowAdjustedOffset(anchorPosition(visibleSelection()));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -111,8 +102,7 @@
</span><span class="cx"> Node* DOMSelection::focusNode() const
</span><span class="cx"> {
</span><span class="cx"> if (!m_frame)
</span><del>- return 0;
-
</del><ins>+ return nullptr;
</ins><span class="cx"> return shadowAdjustedNode(focusPosition(visibleSelection()));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -120,7 +110,6 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_frame)
</span><span class="cx"> return 0;
</span><del>-
</del><span class="cx"> return shadowAdjustedOffset(focusPosition(visibleSelection()));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -128,7 +117,6 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_frame)
</span><span class="cx"> return 0;
</span><del>-
</del><span class="cx"> return shadowAdjustedNode(basePosition(visibleSelection()));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -136,7 +124,6 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_frame)
</span><span class="cx"> return 0;
</span><del>-
</del><span class="cx"> return shadowAdjustedOffset(basePosition(visibleSelection()));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -144,7 +131,6 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_frame)
</span><span class="cx"> return 0;
</span><del>-
</del><span class="cx"> return shadowAdjustedNode(extentPosition(visibleSelection()));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -152,13 +138,12 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_frame)
</span><span class="cx"> return 0;
</span><del>-
</del><span class="cx"> return shadowAdjustedOffset(extentPosition(visibleSelection()));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool DOMSelection::isCollapsed() const
</span><span class="cx"> {
</span><del>- if (!m_frame || selectionShadowAncestor(m_frame))
</del><ins>+ if (!m_frame || selectionShadowAncestor(*m_frame))
</ins><span class="cx"> return true;
</span><span class="cx"> return !m_frame->selection().isRange();
</span><span class="cx"> }
</span><span class="lines">@@ -166,67 +151,47 @@
</span><span class="cx"> String DOMSelection::type() const
</span><span class="cx"> {
</span><span class="cx"> if (!m_frame)
</span><del>- return String();
-
- FrameSelection& selection = m_frame->selection();
-
- // This is a WebKit DOM extension, incompatible with an IE extension
- // IE has this same attribute, but returns "none", "text" and "control"
- // http://msdn.microsoft.com/en-us/library/ms534692(VS.85).aspx
</del><ins>+ return ASCIILiteral("None");
+ auto& selection = m_frame->selection();
</ins><span class="cx"> if (selection.isNone())
</span><del>- return "None";
</del><ins>+ return ASCIILiteral("None");
</ins><span class="cx"> if (selection.isCaret())
</span><del>- return "Caret";
- return "Range";
</del><ins>+ return ASCIILiteral("Caret");
+ return ASCIILiteral("Range");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> unsigned DOMSelection::rangeCount() const
</span><span class="cx"> {
</span><del>- if (!m_frame)
- return 0;
- return m_frame->selection().isNone() ? 0 : 1;
</del><ins>+ return !m_frame || m_frame->selection().isNone() ? 0 : 1;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void DOMSelection::collapse(Node* node, unsigned offset)
</span><span class="cx"> {
</span><del>- if (!m_frame)
- return;
-
</del><span class="cx"> if (!isValidForPosition(node))
</span><span class="cx"> return;
</span><del>-
- // FIXME: Eliminate legacy editing positions
</del><span class="cx"> m_frame->selection().moveTo(createLegacyEditingPosition(node, offset), DOWNSTREAM);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void DOMSelection::collapseToEnd(ExceptionCode& ec)
</del><ins>+ExceptionOr<void> DOMSelection::collapseToEnd()
</ins><span class="cx"> {
</span><span class="cx"> if (!m_frame)
</span><del>- return;
-
- const VisibleSelection& selection = m_frame->selection().selection();
-
- if (selection.isNone()) {
- ec = INVALID_STATE_ERR;
- return;
- }
-
- m_frame->selection().moveTo(selection.end(), DOWNSTREAM);
</del><ins>+ return { };
+ auto& selection = m_frame->selection();
+ if (selection.isNone())
+ return Exception { INVALID_STATE_ERR };
+ selection.moveTo(selection.selection().end(), DOWNSTREAM);
+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void DOMSelection::collapseToStart(ExceptionCode& ec)
</del><ins>+ExceptionOr<void> DOMSelection::collapseToStart()
</ins><span class="cx"> {
</span><span class="cx"> if (!m_frame)
</span><del>- return;
-
- const VisibleSelection& selection = m_frame->selection().selection();
-
- if (selection.isNone()) {
- ec = INVALID_STATE_ERR;
- return;
- }
-
- m_frame->selection().moveTo(selection.start(), DOWNSTREAM);
</del><ins>+ return { };
+ auto& selection = m_frame->selection();
+ if (selection.isNone())
+ return Exception { INVALID_STATE_ERR };
+ selection.moveTo(selection.selection().start(), DOWNSTREAM);
+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void DOMSelection::empty()
</span><span class="lines">@@ -238,25 +203,15 @@
</span><span class="cx">
</span><span class="cx"> void DOMSelection::setBaseAndExtent(Node* baseNode, unsigned baseOffset, Node* extentNode, unsigned extentOffset)
</span><span class="cx"> {
</span><del>- if (!m_frame)
- return;
-
</del><span class="cx"> if (!isValidForPosition(baseNode) || !isValidForPosition(extentNode))
</span><span class="cx"> return;
</span><del>-
- // FIXME: Eliminate legacy editing positions
</del><span class="cx"> m_frame->selection().moveTo(createLegacyEditingPosition(baseNode, baseOffset), createLegacyEditingPosition(extentNode, extentOffset), DOWNSTREAM);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void DOMSelection::setPosition(Node* node, unsigned offset)
</span><span class="cx"> {
</span><del>- if (!m_frame)
- return;
-
</del><span class="cx"> if (!isValidForPosition(node))
</span><span class="cx"> return;
</span><del>-
- // FIXME: Eliminate legacy editing positions
</del><span class="cx"> m_frame->selection().moveTo(createLegacyEditingPosition(node, offset), DOWNSTREAM);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -310,43 +265,33 @@
</span><span class="cx"> m_frame->selection().modify(alter, direction, granularity);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void DOMSelection::extend(Node& node, unsigned offset, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> DOMSelection::extend(Node& node, unsigned offset)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_frame)
</span><del>- return;
-
- if (offset > (node.offsetInCharacters() ? caretMaxOffset(node) : node.countChildNodes())) {
- ec = INDEX_SIZE_ERR;
- return;
- }
-
</del><ins>+ return { };
+ if (offset > (node.offsetInCharacters() ? caretMaxOffset(node) : node.countChildNodes()))
+ return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> if (!isValidForPosition(&node))
</span><del>- return;
-
- // FIXME: Eliminate legacy editing positions
</del><ins>+ return { };
</ins><span class="cx"> m_frame->selection().setExtent(createLegacyEditingPosition(&node, offset), DOWNSTREAM);
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<Range> DOMSelection::getRangeAt(unsigned index, ExceptionCode& ec)
</del><ins>+ExceptionOr<Ref<Range>> DOMSelection::getRangeAt(unsigned index)
</ins><span class="cx"> {
</span><del>- if (!m_frame)
- return nullptr;
</del><ins>+ if (index >= rangeCount())
+ return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">
</span><del>- if (index >= rangeCount()) {
- ec = INDEX_SIZE_ERR;
- return nullptr;
- }
-
- // If you're hitting this, you've added broken multi-range selection support
</del><ins>+ // If you're hitting this, you've added broken multi-range selection support.
</ins><span class="cx"> ASSERT(rangeCount() == 1);
</span><span class="cx">
</span><del>- if (Node* shadowAncestor = selectionShadowAncestor(m_frame)) {
- ContainerNode* container = shadowAncestor->parentNodeGuaranteedHostFree();
</del><ins>+ if (auto* shadowAncestor = selectionShadowAncestor(*m_frame)) {
+ auto* container = shadowAncestor->parentNodeGuaranteedHostFree();
</ins><span class="cx"> unsigned offset = shadowAncestor->computeNodeIndex();
</span><span class="cx"> return Range::create(shadowAncestor->document(), container, offset, container, offset);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return m_frame->selection().selection().firstRange();
</del><ins>+ return m_frame->selection().selection().firstRange().releaseNonNull();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void DOMSelection::removeAllRanges()
</span><span class="lines">@@ -361,13 +306,13 @@
</span><span class="cx"> if (!m_frame)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- FrameSelection& selection = m_frame->selection();
</del><ins>+ auto& selection = m_frame->selection();
</ins><span class="cx"> if (selection.isNone()) {
</span><span class="cx"> selection.moveTo(&range);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RefPtr<Range> normalizedRange = selection.selection().toNormalizedRange();
</del><ins>+ auto normalizedRange = selection.selection().toNormalizedRange();
</ins><span class="cx"> if (!normalizedRange)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -402,17 +347,15 @@
</span><span class="cx"> if (!m_frame)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- FrameSelection& selection = m_frame->selection();
-
</del><ins>+ auto& selection = m_frame->selection();
</ins><span class="cx"> if (selection.isNone())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- RefPtr<Range> selectedRange = selection.selection().toNormalizedRange();
</del><ins>+ auto selectedRange = selection.selection().toNormalizedRange();
</ins><span class="cx"> if (!selectedRange)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> selectedRange->deleteContents(ASSERT_NO_EXCEPTION);
</span><del>-
</del><span class="cx"> setBaseAndExtent(&selectedRange->startContainer(), selectedRange->startOffset(), &selectedRange->startContainer(), selectedRange->startOffset());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -421,13 +364,12 @@
</span><span class="cx"> if (!m_frame)
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- FrameSelection& selection = m_frame->selection();
-
</del><ins>+ auto& selection = m_frame->selection();
</ins><span class="cx"> if (m_frame->document() != &node.document() || selection.isNone())
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> Ref<Node> protectedNode(node);
</span><del>- RefPtr<Range> selectedRange = selection.selection().toNormalizedRange();
</del><ins>+ auto selectedRange = selection.selection().toNormalizedRange();
</ins><span class="cx">
</span><span class="cx"> ContainerNode* parentNode = node.parentNode();
</span><span class="cx"> if (!parentNode || !parentNode->inDocument())
</span><span class="lines">@@ -460,7 +402,6 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_frame)
</span><span class="cx"> return String();
</span><del>-
</del><span class="cx"> return plainText(m_frame->selection().selection().toNormalizedRange().get());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -467,13 +408,12 @@
</span><span class="cx"> Node* DOMSelection::shadowAdjustedNode(const Position& position) const
</span><span class="cx"> {
</span><span class="cx"> if (position.isNull())
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><del>- Node* containerNode = position.containerNode();
- Node* adjustedNode = m_treeScope->ancestorInThisScope(containerNode);
-
</del><ins>+ auto* containerNode = position.containerNode();
+ auto* adjustedNode = m_frame->document()->ancestorInThisScope(containerNode);
</ins><span class="cx"> if (!adjustedNode)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> if (containerNode == adjustedNode)
</span><span class="cx"> return containerNode;
</span><span class="lines">@@ -486,9 +426,8 @@
</span><span class="cx"> if (position.isNull())
</span><span class="cx"> return 0;
</span><span class="cx">
</span><del>- Node* containerNode = position.containerNode();
- Node* adjustedNode = m_treeScope->ancestorInThisScope(containerNode);
-
</del><ins>+ auto* containerNode = position.containerNode();
+ auto* adjustedNode = m_frame->document()->ancestorInThisScope(containerNode);
</ins><span class="cx"> if (!adjustedNode)
</span><span class="cx"> return 0;
</span><span class="cx">
</span><span class="lines">@@ -500,7 +439,8 @@
</span><span class="cx">
</span><span class="cx"> bool DOMSelection::isValidForPosition(Node* node) const
</span><span class="cx"> {
</span><del>- ASSERT(m_frame);
</del><ins>+ if (!m_frame)
+ return false;
</ins><span class="cx"> if (!node)
</span><span class="cx"> return true;
</span><span class="cx"> return &node->document() == m_frame->document();
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMSelectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMSelection.h (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMSelection.h        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/page/DOMSelection.h        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007 Apple Inc. All rights reserved.
- * Copyright (C) 2012 Google Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Google 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
</span><span class="lines">@@ -27,11 +27,10 @@
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><ins>+#pragma once
</ins><span class="cx">
</span><del>-#ifndef DOMSelection_h
-#define DOMSelection_h
-
</del><span class="cx"> #include "DOMWindowProperty.h"
</span><ins>+#include "ExceptionOr.h"
</ins><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="lines">@@ -38,74 +37,58 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>- class Frame;
- class Node;
- class Position;
- class Range;
- class TreeScope;
- class VisibleSelection;
</del><ins>+class Node;
+class Position;
+class Range;
+class VisibleSelection;
</ins><span class="cx">
</span><del>- typedef int ExceptionCode;
</del><ins>+class DOMSelection : public RefCounted<DOMSelection>, public DOMWindowProperty {
+public:
+ static Ref<DOMSelection> create(Frame& frame) { return adoptRef(*new DOMSelection(frame)); }
</ins><span class="cx">
</span><del>- class DOMSelection : public RefCounted<DOMSelection>, public DOMWindowProperty {
- public:
- static Ref<DOMSelection> create(const TreeScope* treeScope) { return adoptRef(*new DOMSelection(treeScope)); }
</del><ins>+ Node* baseNode() const;
+ Node* extentNode() const;
+ unsigned baseOffset() const;
+ unsigned extentOffset() const;
+ String type() const;
+ void setBaseAndExtent(Node* baseNode, unsigned baseOffset, Node* extentNode, unsigned extentOffset);
+ void setPosition(Node*, unsigned offset);
+ void modify(const String& alter, const String& direction, const String& granularity);
</ins><span class="cx">
</span><del>- void clearTreeScope();
</del><ins>+ // The anchor and focus are the start and end of the selection, and
+ // reflect the direction in which the selection was made by the user.
+ // The base and extent are different, because they don't reflect expansion.
+ Node* anchorNode() const;
+ unsigned anchorOffset() const;
+ Node* focusNode() const;
+ unsigned focusOffset() const;
+ bool isCollapsed() const;
+ unsigned rangeCount() const;
+ void collapse(Node*, unsigned offset);
+ ExceptionOr<void> collapseToEnd();
+ ExceptionOr<void> collapseToStart();
+ ExceptionOr<void> extend(Node&, unsigned offset);
+ ExceptionOr<Ref<Range>> getRangeAt(unsigned);
+ void removeAllRanges();
+ void addRange(Range&);
+ void deleteFromDocument();
+ bool containsNode(Node&, bool partlyContained) const;
+ void selectAllChildren(Node&);
</ins><span class="cx">
</span><del>- // Safari Selection Object API
- // These methods return the valid equivalents of internal editing positions.
- Node* baseNode() const;
- Node* extentNode() const;
- unsigned baseOffset() const;
- unsigned extentOffset() const;
- String type() const;
- void setBaseAndExtent(Node* baseNode, unsigned baseOffset, Node* extentNode, unsigned extentOffset);
- void setPosition(Node*, unsigned offset);
- void modify(const String& alter, const String& direction, const String& granularity);
</del><ins>+ String toString();
</ins><span class="cx">
</span><del>- // Mozilla Selection Object API
- // In Firefox, anchor/focus are the equal to the start/end of the selection,
- // but reflect the direction in which the selection was made by the user. That does
- // not mean that they are base/extent, since the base/extent don't reflect
- // expansion.
- // These methods return the valid equivalents of internal editing positions.
- Node* anchorNode() const;
- unsigned anchorOffset() const;
- Node* focusNode() const;
- unsigned focusOffset() const;
- bool isCollapsed() const;
- unsigned rangeCount() const;
- void collapse(Node*, unsigned offset);
- void collapseToEnd(ExceptionCode&);
- void collapseToStart(ExceptionCode&);
- void extend(Node&, unsigned offset, ExceptionCode&);
- RefPtr<Range> getRangeAt(unsigned, ExceptionCode&);
- void removeAllRanges();
- void addRange(Range&);
- void deleteFromDocument();
- bool containsNode(Node&, bool partlyContained) const;
- void selectAllChildren(Node&);
</del><ins>+ void empty();
</ins><span class="cx">
</span><del>- String toString();
</del><ins>+private:
+ explicit DOMSelection(Frame&);
</ins><span class="cx">
</span><del>- // Microsoft Selection Object API
- void empty();
</del><ins>+ // Convenience method for accessors, caller must null-check m_frame.
+ const VisibleSelection& visibleSelection() const;
</ins><span class="cx">
</span><del>- private:
- const TreeScope* m_treeScope;
</del><ins>+ Node* shadowAdjustedNode(const Position&) const;
+ unsigned shadowAdjustedOffset(const Position&) const;
</ins><span class="cx">
</span><del>- explicit DOMSelection(const TreeScope*);
</del><ins>+ bool isValidForPosition(Node*) const;
+};
</ins><span class="cx">
</span><del>- // Convenience method for accessors, does not NULL check m_frame.
- const VisibleSelection& visibleSelection() const;
-
- Node* shadowAdjustedNode(const Position&) const;
- unsigned shadowAdjustedOffset(const Position&) const;
-
- bool isValidForPosition(Node*) const;
- };
-
</del><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // DOMSelection_h
</del></span></pre></div>
<a id="trunkSourceWebCorepageDOMSelectionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMSelection.idl (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMSelection.idl        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/page/DOMSelection.idl        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Google Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Google 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
</span><span class="lines">@@ -41,16 +41,16 @@
</span><span class="cx"> readonly attribute unsigned long rangeCount;
</span><span class="cx">
</span><span class="cx"> void collapse(Node? node, optional unsigned long offset = 0);
</span><del>- [MayThrowLegacyException] void collapseToEnd();
- [MayThrowLegacyException] void collapseToStart();
</del><ins>+ [MayThrowException] void collapseToEnd();
+ [MayThrowException] void collapseToStart();
</ins><span class="cx">
</span><span class="cx"> void deleteFromDocument();
</span><span class="cx"> boolean containsNode(Node node, optional boolean allowPartial = false);
</span><span class="cx"> void selectAllChildren(Node node);
</span><span class="cx">
</span><del>- [MayThrowLegacyException] void extend(Node node, optional unsigned long offset = 0);
</del><ins>+ [MayThrowException] void extend(Node node, optional unsigned long offset = 0);
</ins><span class="cx">
</span><del>- [MayThrowLegacyException] Range getRangeAt(unsigned long index);
</del><ins>+ [MayThrowException] Range getRangeAt(unsigned long index);
</ins><span class="cx"> void removeAllRanges();
</span><span class="cx"> void addRange(Range range);
</span><span class="cx">
</span><span class="lines">@@ -66,14 +66,11 @@
</span><span class="cx"> // FIXME: The following operation should be implemented.
</span><span class="cx"> // void removeRange(Range range);
</span><span class="cx">
</span><del>- // WebKit extensions.
-
</del><span class="cx"> // FIXME: Using "undefined" as default parameter value is wrong.
</span><span class="cx"> void modify(optional DOMString alter = "undefined", optional DOMString direction = "undefined", optional DOMString granularity = "undefined");
</span><span class="cx">
</span><del>- readonly attribute Node baseNode;
</del><ins>+ readonly attribute Node? baseNode;
</ins><span class="cx"> readonly attribute unsigned long baseOffset;
</span><del>- readonly attribute Node extentNode;
</del><ins>+ readonly attribute Node? extentNode;
</ins><span class="cx"> readonly attribute unsigned long extentOffset;
</span><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -597,24 +597,26 @@
</span><span class="cx"> {
</span><span class="cx"> m_properties.clear();
</span><span class="cx">
</span><del>- m_screen = nullptr;
</del><ins>+ m_applicationCache = nullptr;
+ m_crypto = nullptr;
</ins><span class="cx"> m_history = nullptr;
</span><del>- m_crypto = nullptr;
</del><ins>+ m_localStorage = nullptr;
+ m_location = nullptr;
</ins><span class="cx"> m_locationbar = nullptr;
</span><ins>+ m_media = nullptr;
</ins><span class="cx"> m_menubar = nullptr;
</span><ins>+ m_navigator = nullptr;
</ins><span class="cx"> m_personalbar = nullptr;
</span><ins>+ m_screen = nullptr;
</ins><span class="cx"> m_scrollbars = nullptr;
</span><ins>+ m_selection = nullptr;
+ m_sessionStorage = nullptr;
</ins><span class="cx"> m_statusbar = nullptr;
</span><span class="cx"> m_toolbar = nullptr;
</span><del>- m_navigator = nullptr;
</del><ins>+
</ins><span class="cx"> #if ENABLE(WEB_TIMING)
</span><span class="cx"> m_performance = nullptr;
</span><span class="cx"> #endif
</span><del>- m_location = nullptr;
- m_media = nullptr;
- m_sessionStorage = nullptr;
- m_localStorage = nullptr;
- m_applicationCache = nullptr;
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool DOMWindow::isCurrentlyDisplayedInFrame() const
</span><span class="lines">@@ -653,7 +655,7 @@
</span><span class="cx"> History* DOMWindow::history() const
</span><span class="cx"> {
</span><span class="cx"> if (!isCurrentlyDisplayedInFrame())
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> if (!m_history)
</span><span class="cx"> m_history = History::create(m_frame);
</span><span class="cx"> return m_history.get();
</span><span class="lines">@@ -964,10 +966,11 @@
</span><span class="cx">
</span><span class="cx"> DOMSelection* DOMWindow::getSelection()
</span><span class="cx"> {
</span><del>- if (!isCurrentlyDisplayedInFrame() || !m_frame)
- return 0;
-
- return m_frame->document()->getSelection();
</del><ins>+ if (!isCurrentlyDisplayedInFrame())
+ return nullptr;
+ if (!m_selection)
+ m_selection = DOMSelection::create(*m_frame);
+ return m_selection.get();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Element* DOMWindow::frameElement() const
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.h (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.h        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/page/DOMWindow.h        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -141,8 +141,6 @@
</span><span class="cx"> static bool canShowModalDialog(const Frame*);
</span><span class="cx"> WEBCORE_EXPORT void setCanShowModalDialogOverride(bool);
</span><span class="cx">
</span><del>- // DOM Level 0
-
</del><span class="cx"> Screen* screen() const;
</span><span class="cx"> History* history() const;
</span><span class="cx"> Crypto* crypto() const;
</span><span class="lines">@@ -380,18 +378,19 @@
</span><span class="cx">
</span><span class="cx"> HashSet<DOMWindowProperty*> m_properties;
</span><span class="cx">
</span><del>- mutable RefPtr<Screen> m_screen;
</del><ins>+ mutable RefPtr<Crypto> m_crypto;
</ins><span class="cx"> mutable RefPtr<History> m_history;
</span><del>- mutable RefPtr<Crypto> m_crypto;
</del><span class="cx"> mutable RefPtr<BarProp> m_locationbar;
</span><ins>+ mutable RefPtr<StyleMedia> m_media;
</ins><span class="cx"> mutable RefPtr<BarProp> m_menubar;
</span><ins>+ mutable RefPtr<Navigator> m_navigator;
</ins><span class="cx"> mutable RefPtr<BarProp> m_personalbar;
</span><ins>+ mutable RefPtr<Screen> m_screen;
</ins><span class="cx"> mutable RefPtr<BarProp> m_scrollbars;
</span><ins>+ mutable RefPtr<DOMSelection> m_selection;
</ins><span class="cx"> mutable RefPtr<BarProp> m_statusbar;
</span><span class="cx"> mutable RefPtr<BarProp> m_toolbar;
</span><del>- mutable RefPtr<Navigator> m_navigator;
</del><span class="cx"> mutable RefPtr<Location> m_location;
</span><del>- mutable RefPtr<StyleMedia> m_media;
</del><span class="cx">
</span><span class="cx"> String m_status;
</span><span class="cx"> String m_defaultStatus;
</span></span></pre></div>
<a id="trunkSourceWebCorereplayReplayControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/ReplayController.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/ReplayController.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/replay/ReplayController.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -421,7 +421,7 @@
</span><span class="cx">
</span><span class="cx"> // We store the input cursor in both Document and JSDOMWindow, so that
</span><span class="cx"> // replay state is accessible from JavaScriptCore and script-free layout code.
</span><del>- loader->frame()->document()->setInputCursor(m_activeCursor.get());
</del><ins>+ loader->frame()->document()->setInputCursor(*m_activeCursor);
</ins><span class="cx"> loader->frame()->script().globalObject(mainThreadNormalWorld())->setInputCursor(m_activeCursor.get());
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -157,12 +157,10 @@
</span><span class="cx"> return m_state;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String XMLHttpRequest::responseText(ExceptionCode& ec)
</del><ins>+ExceptionOr<String> XMLHttpRequest::responseText()
</ins><span class="cx"> {
</span><del>- if (m_responseType != ResponseType::EmptyString && m_responseType != ResponseType::Text) {
- ec = INVALID_STATE_ERR;
- return { };
- }
</del><ins>+ if (m_responseType != ResponseType::EmptyString && m_responseType != ResponseType::Text)
+ return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> return responseTextIgnoringResponseType();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -173,12 +171,10 @@
</span><span class="cx"> m_responseBuilder.clear();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Document* XMLHttpRequest::responseXML(ExceptionCode& ec)
</del><ins>+ExceptionOr<Document*> XMLHttpRequest::responseXML()
</ins><span class="cx"> {
</span><del>- if (m_responseType != ResponseType::EmptyString && m_responseType != ResponseType::Document) {
- ec = INVALID_STATE_ERR;
- return nullptr;
- }
</del><ins>+ if (m_responseType != ResponseType::EmptyString && m_responseType != ResponseType::Document)
+ return Exception { INVALID_STATE_ERR };
</ins><span class="cx">
</span><span class="cx"> if (!doneWithoutErrors())
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -239,30 +235,28 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::setTimeout(unsigned timeout, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::setTimeout(unsigned timeout)
</ins><span class="cx"> {
</span><span class="cx"> if (scriptExecutionContext()->isDocument() && !m_async) {
</span><span class="cx"> logConsoleError(scriptExecutionContext(), "XMLHttpRequest.timeout cannot be set for synchronous HTTP(S) requests made from the window context.");
</span><del>- ec = INVALID_ACCESS_ERR;
- return;
</del><ins>+ return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx"> }
</span><span class="cx"> m_timeoutMilliseconds = timeout;
</span><span class="cx"> if (!m_timeoutTimer.isActive())
</span><del>- return;
</del><ins>+ return { };
</ins><span class="cx"> if (!m_timeoutMilliseconds) {
</span><span class="cx"> m_timeoutTimer.stop();
</span><del>- return;
</del><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx"> std::chrono::duration<double> interval = std::chrono::milliseconds { m_timeoutMilliseconds } - (std::chrono::steady_clock::now() - m_sendingTime);
</span><span class="cx"> m_timeoutTimer.startOneShot(std::max(0.0, interval.count()));
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::setResponseType(ResponseType type, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::setResponseType(ResponseType type)
</ins><span class="cx"> {
</span><del>- if (m_state >= LOADING) {
- ec = INVALID_STATE_ERR;
- return;
- }
</del><ins>+ if (m_state >= LOADING)
+ return Exception { INVALID_STATE_ERR };
</ins><span class="cx">
</span><span class="cx"> // Newer functionality is not available to synchronous requests in window contexts, as a spec-mandated
</span><span class="cx"> // attempt to discourage synchronous XHR use. responseType is one such piece of functionality.
</span><span class="lines">@@ -270,11 +264,11 @@
</span><span class="cx"> // such as file: and data: still make sense to allow.
</span><span class="cx"> if (!m_async && scriptExecutionContext()->isDocument() && m_url.protocolIsInHTTPFamily()) {
</span><span class="cx"> logConsoleError(scriptExecutionContext(), "XMLHttpRequest.responseType cannot be changed for synchronous HTTP(S) requests made from the window context.");
</span><del>- ec = INVALID_ACCESS_ERR;
- return;
</del><ins>+ return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_responseType = type;
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String XMLHttpRequest::responseURL() const
</span><span class="lines">@@ -323,14 +317,13 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::setWithCredentials(bool value, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::setWithCredentials(bool value)
</ins><span class="cx"> {
</span><del>- if (m_state > OPENED || m_sendFlag) {
- ec = INVALID_STATE_ERR;
- return;
- }
</del><ins>+ if (m_state > OPENED || m_sendFlag)
+ return Exception { INVALID_STATE_ERR };
</ins><span class="cx">
</span><span class="cx"> m_includeCredentials = value;
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool XMLHttpRequest::isAllowedHTTPMethod(const String& method)
</span><span class="lines">@@ -404,16 +397,16 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::open(const String& method, const String& url, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::open(const String& method, const String& url)
</ins><span class="cx"> {
</span><span class="cx"> // If the async argument is omitted, set async to true.
</span><del>- return open(method, scriptExecutionContext()->completeURL(url), true, ec);
</del><ins>+ return open(method, scriptExecutionContext()->completeURL(url), true);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::open(const String& method, const URL& url, bool async, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::open(const String& method, const URL& url, bool async)
</ins><span class="cx"> {
</span><span class="cx"> if (!internalAbort())
</span><del>- return;
</del><ins>+ return { };
</ins><span class="cx">
</span><span class="cx"> State previousState = m_state;
</span><span class="cx"> m_state = UNSENT;
</span><span class="lines">@@ -427,21 +420,16 @@
</span><span class="cx">
</span><span class="cx"> ASSERT(m_state == UNSENT);
</span><span class="cx">
</span><del>- if (!isValidHTTPToken(method)) {
- ec = SYNTAX_ERR;
- return;
- }
</del><ins>+ if (!isValidHTTPToken(method))
+ return Exception { SYNTAX_ERR };
</ins><span class="cx">
</span><del>- if (!isAllowedHTTPMethod(method)) {
- ec = SECURITY_ERR;
- return;
- }
</del><ins>+ if (!isAllowedHTTPMethod(method))
+ return Exception { SECURITY_ERR };
</ins><span class="cx">
</span><span class="cx"> if (!async && scriptExecutionContext()->isDocument()) {
</span><span class="cx"> if (document()->settings() && !document()->settings()->syncXHRInDocumentsEnabled()) {
</span><span class="cx"> logConsoleError(scriptExecutionContext(), "Synchronous XMLHttpRequests are disabled for this page.");
</span><del>- ec = INVALID_ACCESS_ERR;
- return;
</del><ins>+ return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Newer functionality is not available to synchronous requests in window contexts, as a spec-mandated
</span><span class="lines">@@ -450,15 +438,13 @@
</span><span class="cx"> // such as file: and data: still make sense to allow.
</span><span class="cx"> if (url.protocolIsInHTTPFamily() && m_responseType != ResponseType::EmptyString) {
</span><span class="cx"> logConsoleError(scriptExecutionContext(), "Synchronous HTTP(S) requests made from the window context cannot have XMLHttpRequest.responseType set.");
</span><del>- ec = INVALID_ACCESS_ERR;
- return;
</del><ins>+ return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Similarly, timeouts are disabled for synchronous requests as well.
</span><span class="cx"> if (m_timeoutMilliseconds > 0) {
</span><span class="cx"> logConsoleError(scriptExecutionContext(), "Synchronous XMLHttpRequests must not have a timeout value set.");
</span><del>- ec = INVALID_ACCESS_ERR;
- return;
</del><ins>+ return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -477,9 +463,11 @@
</span><span class="cx"> changeState(OPENED);
</span><span class="cx"> else
</span><span class="cx"> m_state = OPENED;
</span><ins>+
+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::open(const String& method, const String& url, bool async, const String& user, const String& password, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::open(const String& method, const String& url, bool async, const String& user, const String& password)
</ins><span class="cx"> {
</span><span class="cx"> URL urlWithCredentials = scriptExecutionContext()->completeURL(url);
</span><span class="cx"> if (!user.isNull()) {
</span><span class="lines">@@ -488,49 +476,42 @@
</span><span class="cx"> urlWithCredentials.setPass(password);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- open(method, urlWithCredentials, async, ec);
</del><ins>+ return open(method, urlWithCredentials, async);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool XMLHttpRequest::initSend(ExceptionCode& ec)
</del><ins>+Optional<ExceptionOr<void>> XMLHttpRequest::prepareToSend()
</ins><span class="cx"> {
</span><ins>+ // A return value other than Nullopt means we should not try to send, and we should return that value to the caller.
+ // Nullopt means we are ready to send and should continue with the send algorithm.
+
</ins><span class="cx"> if (!scriptExecutionContext())
</span><del>- return false;
</del><ins>+ return ExceptionOr<void> { };
</ins><span class="cx">
</span><span class="cx"> auto& context = *scriptExecutionContext();
</span><span class="cx">
</span><del>- if (m_state != OPENED || m_sendFlag) {
- ec = INVALID_STATE_ERR;
- return false;
- }
</del><ins>+ if (m_state != OPENED || m_sendFlag)
+ return ExceptionOr<void> { Exception { INVALID_STATE_ERR } };
</ins><span class="cx"> ASSERT(!m_loader);
</span><span class="cx">
</span><span class="cx"> // FIXME: Convert this to check the isolated world's Content Security Policy once webkit.org/b/104520 is solved.
</span><span class="cx"> if (!context.shouldBypassMainWorldContentSecurityPolicy() && !context.contentSecurityPolicy()->allowConnectToSource(m_url)) {
</span><del>- if (m_async) {
- setPendingActivity(this);
- m_timeoutTimer.stop();
- m_networkErrorTimer.startOneShot(0);
- } else
- ec = NETWORK_ERR;
- return false;
</del><ins>+ if (!m_async)
+ return ExceptionOr<void> { Exception { NETWORK_ERR } };
+ setPendingActivity(this);
+ m_timeoutTimer.stop();
+ m_networkErrorTimer.startOneShot(0);
+ return ExceptionOr<void> { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_error = false;
</span><del>- return true;
</del><ins>+ return Nullopt;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::send(ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::send(Document& document)
</ins><span class="cx"> {
</span><del>- send(String(), ec);
-}
</del><ins>+ if (auto result = prepareToSend())
+ return WTFMove(result.value());
</ins><span class="cx">
</span><del>-void XMLHttpRequest::send(Document* document, ExceptionCode& ec)
-{
- ASSERT(document);
-
- if (!initSend(ec))
- return;
-
</del><span class="cx"> if (m_method != "GET" && m_method != "HEAD" && m_url.protocolIsInHTTPFamily()) {
</span><span class="cx"> if (!m_requestHeaders.contains(HTTPHeaderName::ContentType)) {
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><span class="lines">@@ -539,25 +520,23 @@
</span><span class="cx"> else
</span><span class="cx"> #endif
</span><span class="cx"> // FIXME: this should include the charset used for encoding.
</span><del>- m_requestHeaders.set(HTTPHeaderName::ContentType, document->isHTMLDocument() ? ASCIILiteral("text/html;charset=UTF-8") : ASCIILiteral("application/xml;charset=UTF-8"));
</del><ins>+ m_requestHeaders.set(HTTPHeaderName::ContentType, document.isHTMLDocument() ? ASCIILiteral("text/html;charset=UTF-8") : ASCIILiteral("application/xml;charset=UTF-8"));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // FIXME: According to XMLHttpRequest Level 2, this should use the Document.innerHTML algorithm
</span><span class="cx"> // from the HTML5 specification to serialize the document.
</span><del>- String body = createMarkup(*document);
-
- m_requestEntityBody = FormData::create(UTF8Encoding().encode(body, EntitiesForUnencodables));
</del><ins>+ m_requestEntityBody = FormData::create(UTF8Encoding().encode(createMarkup(document), EntitiesForUnencodables));
</ins><span class="cx"> if (m_upload)
</span><span class="cx"> m_requestEntityBody->setAlwaysStream(true);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- createRequest(ec);
</del><ins>+ return createRequest();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::send(const String& body, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::send(const String& body)
</ins><span class="cx"> {
</span><del>- if (!initSend(ec))
- return;
</del><ins>+ if (auto result = prepareToSend())
+ return WTFMove(result.value());
</ins><span class="cx">
</span><span class="cx"> if (!body.isNull() && m_method != "GET" && m_method != "HEAD" && m_url.protocolIsInHTTPFamily()) {
</span><span class="cx"> String contentType = m_requestHeaders.get(HTTPHeaderName::ContentType);
</span><span class="lines">@@ -578,17 +557,17 @@
</span><span class="cx"> m_requestEntityBody->setAlwaysStream(true);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- createRequest(ec);
</del><ins>+ return createRequest();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::send(Blob* body, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::send(Blob& body)
</ins><span class="cx"> {
</span><del>- if (!initSend(ec))
- return;
</del><ins>+ if (auto result = prepareToSend())
+ return WTFMove(result.value());
</ins><span class="cx">
</span><span class="cx"> if (m_method != "GET" && m_method != "HEAD" && m_url.protocolIsInHTTPFamily()) {
</span><span class="cx"> if (!m_requestHeaders.contains(HTTPHeaderName::ContentType)) {
</span><del>- const String& blobType = body->type();
</del><ins>+ const String& blobType = body.type();
</ins><span class="cx"> if (!blobType.isEmpty() && isValidContentType(blobType))
</span><span class="cx"> m_requestHeaders.set(HTTPHeaderName::ContentType, blobType);
</span><span class="cx"> else {
</span><span class="lines">@@ -598,46 +577,43 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_requestEntityBody = FormData::create();
</span><del>- m_requestEntityBody->appendBlob(body->url());
</del><ins>+ m_requestEntityBody->appendBlob(body.url());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- createRequest(ec);
</del><ins>+ return createRequest();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::send(DOMFormData* body, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::send(DOMFormData& body)
</ins><span class="cx"> {
</span><del>- if (!initSend(ec))
- return;
</del><ins>+ if (auto result = prepareToSend())
+ return WTFMove(result.value());
</ins><span class="cx">
</span><span class="cx"> if (m_method != "GET" && m_method != "HEAD" && m_url.protocolIsInHTTPFamily()) {
</span><del>- m_requestEntityBody = FormData::createMultiPart(*(static_cast<FormDataList*>(body)), body->encoding(), document());
-
</del><ins>+ m_requestEntityBody = FormData::createMultiPart(body, body.encoding(), document());
</ins><span class="cx"> m_requestEntityBody->generateFiles(document());
</span><del>-
</del><span class="cx"> if (!m_requestHeaders.contains(HTTPHeaderName::ContentType))
</span><span class="cx"> m_requestHeaders.set(HTTPHeaderName::ContentType, makeString("multipart/form-data; boundary=", m_requestEntityBody->boundary().data()));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- createRequest(ec);
</del><ins>+ return createRequest();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::send(ArrayBuffer* body, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::send(ArrayBuffer& body)
</ins><span class="cx"> {
</span><del>- String consoleMessage("ArrayBuffer is deprecated in XMLHttpRequest.send(). Use ArrayBufferView instead.");
</del><ins>+ ASCIILiteral consoleMessage("ArrayBuffer is deprecated in XMLHttpRequest.send(). Use ArrayBufferView instead.");
</ins><span class="cx"> scriptExecutionContext()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, consoleMessage);
</span><del>-
- sendBytesData(body->data(), body->byteLength(), ec);
</del><ins>+ return sendBytesData(body.data(), body.byteLength());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::send(ArrayBufferView* body, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::send(ArrayBufferView& body)
</ins><span class="cx"> {
</span><del>- sendBytesData(body->baseAddress(), body->byteLength(), ec);
</del><ins>+ return sendBytesData(body.baseAddress(), body.byteLength());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::sendBytesData(const void* data, size_t length, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::sendBytesData(const void* data, size_t length)
</ins><span class="cx"> {
</span><del>- if (!initSend(ec))
- return;
</del><ins>+ if (auto result = prepareToSend())
+ return WTFMove(result.value());
</ins><span class="cx">
</span><span class="cx"> if (m_method != "GET" && m_method != "HEAD" && m_url.protocolIsInHTTPFamily()) {
</span><span class="cx"> m_requestEntityBody = FormData::create(data, length);
</span><span class="lines">@@ -645,16 +621,14 @@
</span><span class="cx"> m_requestEntityBody->setAlwaysStream(true);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- createRequest(ec);
</del><ins>+ return createRequest();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::createRequest(ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::createRequest()
</ins><span class="cx"> {
</span><span class="cx"> // Only GET request is supported for blob URL.
</span><del>- if (!m_async && m_url.protocolIsBlob() && m_method != "GET") {
- ec = NETWORK_ERR;
- return;
- }
</del><ins>+ if (!m_async && m_url.protocolIsBlob() && m_method != "GET")
+ return Exception { NETWORK_ERR };
</ins><span class="cx">
</span><span class="cx"> m_sendFlag = true;
</span><span class="cx">
</span><span class="lines">@@ -733,9 +707,11 @@
</span><span class="cx"> InspectorInstrumentation::didLoadXHRSynchronously(scriptExecutionContext());
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (!m_exceptionCode && m_error)
- m_exceptionCode = NETWORK_ERR;
- ec = m_exceptionCode;
</del><ins>+ if (m_exceptionCode)
+ return Exception { m_exceptionCode };
+ if (m_error)
+ return Exception { NETWORK_ERR };
+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void XMLHttpRequest::abort()
</span><span class="lines">@@ -858,41 +834,37 @@
</span><span class="cx"> unsetPendingActivity(this);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::overrideMimeType(const String& override, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::overrideMimeType(const String& override)
</ins><span class="cx"> {
</span><del>- if (m_state == LOADING || m_state == DONE) {
- ec = INVALID_STATE_ERR;
- return;
- }
</del><ins>+ if (m_state == LOADING || m_state == DONE)
+ return Exception { INVALID_STATE_ERR };
</ins><span class="cx">
</span><span class="cx"> m_mimeTypeOverride = override;
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::setRequestHeader(const String& name, const String& value, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> XMLHttpRequest::setRequestHeader(const String& name, const String& value)
</ins><span class="cx"> {
</span><span class="cx"> if (m_state != OPENED || m_sendFlag) {
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><span class="cx"> if (usesDashboardBackwardCompatibilityMode())
</span><del>- return;
</del><ins>+ return { };
</ins><span class="cx"> #endif
</span><del>-
- ec = INVALID_STATE_ERR;
- return;
</del><ins>+ return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String normalizedValue = stripLeadingAndTrailingHTTPSpaces(value);
</span><del>- if (!isValidHTTPToken(name) || !isValidHTTPHeaderValue(normalizedValue)) {
- ec = SYNTAX_ERR;
- return;
- }
</del><ins>+ if (!isValidHTTPToken(name) || !isValidHTTPHeaderValue(normalizedValue))
+ return Exception { SYNTAX_ERR };
</ins><span class="cx">
</span><span class="cx"> // A privileged script (e.g. a Dashboard widget) can set any headers.
</span><span class="cx"> if (!securityOrigin()->canLoadLocalResources() && !isAllowedHTTPHeader(name)) {
</span><span class="cx"> logConsoleError(scriptExecutionContext(), "Refused to set unsafe header \"" + name + "\"");
</span><del>- return;
</del><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_requestHeaders.add(name, normalizedValue);
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String XMLHttpRequest::getAllResponseHeaders() const
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.h (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.h        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.h        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><span class="cx"> #include "ActiveDOMObject.h"
</span><ins>+#include "ExceptionOr.h"
</ins><span class="cx"> #include "FormData.h"
</span><span class="cx"> #include "ResourceResponse.h"
</span><span class="cx"> #include "ThreadableLoaderClient.h"
</span><span class="lines">@@ -57,7 +58,7 @@
</span><span class="cx"> LOADING = 3,
</span><span class="cx"> DONE = 4
</span><span class="cx"> };
</span><del>-
</del><ins>+
</ins><span class="cx"> virtual void didReachTimeout();
</span><span class="cx">
</span><span class="cx"> EventTargetInterface eventTargetInterface() const override { return XMLHttpRequestEventTargetInterfaceType; }
</span><span class="lines">@@ -68,35 +69,34 @@
</span><span class="cx"> int status() const;
</span><span class="cx"> State readyState() const;
</span><span class="cx"> bool withCredentials() const { return m_includeCredentials; }
</span><del>- void setWithCredentials(bool, ExceptionCode&);
- void open(const String& method, const String& url, ExceptionCode&);
- void open(const String& method, const URL&, bool async, ExceptionCode&);
- void open(const String& method, const String&, bool async, const String& user, const String& password, ExceptionCode&);
- void send(ExceptionCode&);
- void send(Document*, ExceptionCode&);
- void send(const String&, ExceptionCode&);
- void send(Blob*, ExceptionCode&);
- void send(DOMFormData*, ExceptionCode&);
- void send(JSC::ArrayBuffer*, ExceptionCode&);
- void send(JSC::ArrayBufferView*, ExceptionCode&);
</del><ins>+ ExceptionOr<void> setWithCredentials(bool);
+ ExceptionOr<void> open(const String& method, const String& url);
+ ExceptionOr<void> open(const String& method, const URL&, bool async);
+ ExceptionOr<void> open(const String& method, const String&, bool async, const String& user, const String& password);
+ ExceptionOr<void> send(Document&);
+ ExceptionOr<void> send(const String& = { });
+ ExceptionOr<void> send(Blob&);
+ ExceptionOr<void> send(DOMFormData&);
+ ExceptionOr<void> send(JSC::ArrayBuffer&);
+ ExceptionOr<void> send(JSC::ArrayBufferView&);
</ins><span class="cx"> void abort();
</span><del>- void setRequestHeader(const String& name, const String& value, ExceptionCode&);
- void overrideMimeType(const String& override, ExceptionCode&);
</del><ins>+ ExceptionOr<void> setRequestHeader(const String& name, const String& value);
+ ExceptionOr<void> overrideMimeType(const String& override);
</ins><span class="cx"> bool doneWithoutErrors() const { return !m_error && m_state == DONE; }
</span><span class="cx"> String getAllResponseHeaders() const;
</span><span class="cx"> String getResponseHeader(const String& name) const;
</span><del>- String responseText(ExceptionCode&);
</del><ins>+ ExceptionOr<String> responseText();
</ins><span class="cx"> String responseTextIgnoringResponseType() const { return m_responseBuilder.toStringPreserveCapacity(); }
</span><span class="cx"> String responseMIMEType() const;
</span><span class="cx">
</span><span class="cx"> Document* optionalResponseXML() const { return m_responseDocument.get(); }
</span><del>- Document* responseXML(ExceptionCode&);
</del><ins>+ ExceptionOr<Document*> responseXML();
</ins><span class="cx">
</span><span class="cx"> Ref<Blob> createResponseBlob();
</span><span class="cx"> RefPtr<JSC::ArrayBuffer> createResponseArrayBuffer();
</span><span class="cx">
</span><span class="cx"> unsigned timeout() const { return m_timeoutMilliseconds; }
</span><del>- void setTimeout(unsigned timeout, ExceptionCode&);
</del><ins>+ ExceptionOr<void> setTimeout(unsigned);
</ins><span class="cx">
</span><span class="cx"> bool responseCacheIsValid() const { return m_responseCacheIsValid; }
</span><span class="cx"> void didCacheResponse();
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx"> static bool isAllowedHTTPHeader(const String&);
</span><span class="cx">
</span><span class="cx"> enum class ResponseType { EmptyString, Arraybuffer, Blob, Document, Json, Text };
</span><del>- void setResponseType(ResponseType, ExceptionCode&);
</del><ins>+ ExceptionOr<void> setResponseType(ResponseType);
</ins><span class="cx"> ResponseType responseType() const;
</span><span class="cx">
</span><span class="cx"> String responseURL() const;
</span><span class="lines">@@ -152,10 +152,10 @@
</span><span class="cx">
</span><span class="cx"> bool responseIsXML() const;
</span><span class="cx">
</span><del>- bool initSend(ExceptionCode&);
- void sendBytesData(const void*, size_t, ExceptionCode&);
</del><ins>+ Optional<ExceptionOr<void>> prepareToSend();
+ ExceptionOr<void> sendBytesData(const void*, size_t);
</ins><span class="cx">
</span><del>- void changeState(State newState);
</del><ins>+ void changeState(State);
</ins><span class="cx"> void callReadyStateChangeListener();
</span><span class="cx"> void dropProtection();
</span><span class="cx">
</span><span class="lines">@@ -167,7 +167,7 @@
</span><span class="cx"> void clearResponseBuffers();
</span><span class="cx"> void clearRequest();
</span><span class="cx">
</span><del>- void createRequest(ExceptionCode&);
</del><ins>+ ExceptionOr<void> createRequest();
</ins><span class="cx">
</span><span class="cx"> void genericError();
</span><span class="cx"> void networkError();
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.idl (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.idl        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.idl        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008-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
</span><span class="lines">@@ -36,16 +36,16 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> [
</span><del>- Exposed=(Window,Worker),
</del><span class="cx"> ActiveDOMObject,
</span><span class="cx"> Constructor,
</span><span class="cx"> ConstructorCallWith=ScriptExecutionContext,
</span><ins>+ ExportMacro=WEBCORE_EXPORT,
+ Exposed=(Window,Worker),
</ins><span class="cx"> JSCustomMarkFunction,
</span><ins>+ JSGenerateToJSObject,
</ins><span class="cx"> JSGenerateToNativeObject,
</span><del>- JSGenerateToJSObject,
- ExportMacro=WEBCORE_EXPORT,
</del><ins>+ PrivateIdentifier,
</ins><span class="cx"> PublicIdentifier,
</span><del>- PrivateIdentifier,
</del><span class="cx"> ] interface XMLHttpRequest : XMLHttpRequestEventTarget {
</span><span class="cx"> attribute EventHandler onreadystatechange;
</span><span class="cx">
</span><span class="lines">@@ -56,30 +56,29 @@
</span><span class="cx"> const unsigned short LOADING = 3;
</span><span class="cx"> const unsigned short DONE = 4;
</span><span class="cx">
</span><del>- [SetterMayThrowLegacyException] attribute unsigned long timeout;
</del><ins>+ [SetterMayThrowException] attribute unsigned long timeout;
</ins><span class="cx"> readonly attribute unsigned short readyState;
</span><span class="cx">
</span><del>- [SetterMayThrowLegacyException] attribute boolean withCredentials;
</del><ins>+ [SetterMayThrowException] attribute boolean withCredentials;
</ins><span class="cx">
</span><span class="cx"> // Use overloading rather than "boolean async = true" because legacy content prevents treating the 'async' argument being undefined identical from it being omitted.
</span><del>- [MayThrowLegacyException] void open(DOMString method, DOMString url);
- [MayThrowLegacyException] void open(DOMString method, DOMString url, boolean async, optional DOMString? user = null, optional DOMString? password = null);
</del><ins>+ [MayThrowException] void open(DOMString method, DOMString url);
+ [MayThrowException] void open(DOMString method, DOMString url, boolean async, optional DOMString? user = null, optional DOMString? password = null);
</ins><span class="cx">
</span><del>- [MayThrowLegacyException] void setRequestHeader(DOMString header, DOMString value);
</del><ins>+ [MayThrowException] void setRequestHeader(DOMString header, DOMString value);
</ins><span class="cx">
</span><del>- [Custom, MayThrowLegacyException] void send();
</del><ins>+ [Custom, MayThrowException] void send();
</ins><span class="cx">
</span><span class="cx"> void abort();
</span><span class="cx">
</span><span class="cx"> readonly attribute XMLHttpRequestUpload upload;
</span><span class="cx">
</span><del>- // response
</del><span class="cx"> DOMString getAllResponseHeaders();
</span><span class="cx"> DOMString? getResponseHeader(DOMString header);
</span><del>- [GetterMayThrowLegacyException, CustomGetter] readonly attribute DOMString? responseText;
- [GetterMayThrowLegacyException] readonly attribute Document responseXML;
</del><ins>+ [GetterMayThrowException, CustomGetter] readonly attribute DOMString? responseText;
+ [GetterMayThrowException] readonly attribute Document responseXML;
</ins><span class="cx">
</span><del>- [SetterMayThrowLegacyException] attribute XMLHttpRequestResponseType responseType;
</del><ins>+ [SetterMayThrowException] attribute XMLHttpRequestResponseType responseType;
</ins><span class="cx"> [JSBuiltin] readonly attribute Object response;
</span><span class="cx">
</span><span class="cx"> readonly attribute unsigned short status;
</span><span class="lines">@@ -89,6 +88,5 @@
</span><span class="cx"> [PrivateIdentifier] boolean responseCacheIsValid();
</span><span class="cx"> [PrivateIdentifier, Custom] any retrieveResponse();
</span><span class="cx">
</span><del>- // Extension
- [MayThrowLegacyException] void overrideMimeType(DOMString override);
</del><ins>+ [MayThrowException] void overrideMimeType(DOMString override);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-10-06 Darin Adler <darin@apple.com>
+
+ Next step on moving to modern way to return DOM exceptions
+ https://bugs.webkit.org/show_bug.cgi?id=163016
+
+ Reviewed by Ryosuke Niwa.
+
+ * DOM/DOMDOMImplementation.mm:
+ (-[DOMImplementation createDocumentType:publicId:systemId:]): Updated for
+ name change from takeReturnValue to releaseReturnValue.
+ (-[DOMImplementation createDocument:qualifiedName:doctype:]): Ditto.
+
</ins><span class="cx"> 2016-10-07 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> [WK1 Mac] Fix repaints of fixed-background elements in layer-backed WebViews
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMDOMImplementationmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMDOMImplementation.mm (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMDOMImplementation.mm        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebKit/mac/DOM/DOMDOMImplementation.mm        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -66,9 +66,11 @@
</span><span class="cx"> {
</span><span class="cx"> WebCore::JSMainThreadNullState state;
</span><span class="cx"> auto result = unwrap(*self).createDocumentType(qualifiedName, publicId, systemId);
</span><del>- if (result.hasException())
- raiseDOMException(result.exceptionCode());
- return kit(result.takeReturnValue().ptr());
</del><ins>+ if (result.hasException()) {
+ raiseDOMException(result.releaseException().code());
+ return nil;
+ }
+ return kit(result.releaseReturnValue().ptr());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (DOMDocument *)createDocument:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName doctype:(DOMDocumentType *)doctype
</span><span class="lines">@@ -75,9 +77,11 @@
</span><span class="cx"> {
</span><span class="cx"> WebCore::JSMainThreadNullState state;
</span><span class="cx"> auto result = unwrap(*self).createDocument(namespaceURI, qualifiedName, core(doctype));
</span><del>- if (result.hasException())
- raiseDOMException(result.exceptionCode());
- return kit(result.takeReturnValue().ptr());
</del><ins>+ if (result.hasException()) {
+ raiseDOMException(result.releaseException().code());
+ return nil;
+ }
+ return kit(result.releaseReturnValue().ptr());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (DOMCSSStyleSheet *)createCSSStyleSheet:(NSString *)title media:(NSString *)media
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebKit2/ChangeLog        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-10-06 Darin Adler <darin@apple.com>
+
+ Next step on moving to modern way to return DOM exceptions
+ https://bugs.webkit.org/show_bug.cgi?id=163016
+
+ Reviewed by Ryosuke Niwa.
+
+ * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
+ (webkit_dom_dom_implementation_create_document_type): Updated for name change
+ from takeReturnValue to releaseReturnValue.
+ (webkit_dom_dom_implementation_create_document): Ditto.
+ * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
+ (webkit_dom_dom_selection_collapse_to_end): Use ExceptionOr instead of ExceptionCode.
+ (webkit_dom_dom_selection_collapse_to_start): Ditto.
+ (webkit_dom_dom_selection_extend): Ditto.
+ (webkit_dom_dom_selection_get_range_at): Ditto.
+
</ins><span class="cx"> 2016-10-08 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r206950.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkDOMWebKitDOMDOMImplementationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -130,10 +130,11 @@
</span><span class="cx"> WTF::String convertedSystemId = WTF::String::fromUTF8(systemId);
</span><span class="cx"> auto result = item->createDocumentType(convertedQualifiedName, convertedPublicId, convertedSystemId);
</span><span class="cx"> if (result.hasException()) {
</span><del>- WebCore::ExceptionCodeDescription ecdesc(result.exceptionCode());
</del><ins>+ WebCore::ExceptionCodeDescription ecdesc(result.releaseException().code());
</ins><span class="cx"> g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
</span><ins>+ return nullptr;
</ins><span class="cx"> }
</span><del>- return WebKit::kit(result.takeReturnValue().ptr());
</del><ins>+ return WebKit::kit(result.releaseReturnValue().ptr());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> WebKitDOMDocument* webkit_dom_dom_implementation_create_document(WebKitDOMDOMImplementation* self, const gchar* namespaceURI, const gchar* qualifiedName, WebKitDOMDocumentType* doctype, GError** error)
</span><span class="lines">@@ -149,10 +150,11 @@
</span><span class="cx"> WebCore::DocumentType* convertedDoctype = WebKit::core(doctype);
</span><span class="cx"> auto result = item->createDocument(convertedNamespaceURI, convertedQualifiedName, convertedDoctype);
</span><span class="cx"> if (result.hasException()) {
</span><del>- WebCore::ExceptionCodeDescription ecdesc(result.exceptionCode());
</del><ins>+ WebCore::ExceptionCodeDescription ecdesc(result.releaseException().code());
</ins><span class="cx"> g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
</span><ins>+ return nullptr;
</ins><span class="cx"> }
</span><del>- return WebKit::kit(result.takeReturnValue().ptr());
</del><ins>+ return WebKit::kit(result.releaseReturnValue().ptr());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> WebKitDOMCSSStyleSheet* webkit_dom_dom_implementation_create_css_style_sheet(WebKitDOMDOMImplementation* self, const gchar* title, const gchar* media, GError** error)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkDOMWebKitDOMDOMSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -291,10 +291,9 @@
</span><span class="cx"> g_return_if_fail(WEBKIT_DOM_IS_DOM_SELECTION(self));
</span><span class="cx"> g_return_if_fail(!error || !*error);
</span><span class="cx"> WebCore::DOMSelection* item = WebKit::core(self);
</span><del>- WebCore::ExceptionCode ec = 0;
- item->collapseToEnd(ec);
- if (ec) {
- WebCore::ExceptionCodeDescription ecdesc(ec);
</del><ins>+ auto result = item->collapseToEnd();
+ if (result.hasException()) {
+ WebCore::ExceptionCodeDescription ecdesc(result.releaseException().code());
</ins><span class="cx"> g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -305,10 +304,9 @@
</span><span class="cx"> g_return_if_fail(WEBKIT_DOM_IS_DOM_SELECTION(self));
</span><span class="cx"> g_return_if_fail(!error || !*error);
</span><span class="cx"> WebCore::DOMSelection* item = WebKit::core(self);
</span><del>- WebCore::ExceptionCode ec = 0;
- item->collapseToStart(ec);
- if (ec) {
- WebCore::ExceptionCodeDescription ecdesc(ec);
</del><ins>+ auto result = item->collapseToStart();
+ if (result.hasException()) {
+ WebCore::ExceptionCodeDescription ecdesc(result.releaseException().code());
</ins><span class="cx"> g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -350,10 +348,9 @@
</span><span class="cx"> g_return_if_fail(!error || !*error);
</span><span class="cx"> WebCore::DOMSelection* item = WebKit::core(self);
</span><span class="cx"> WebCore::Node* convertedNode = WebKit::core(node);
</span><del>- WebCore::ExceptionCode ec = 0;
- item->extend(*convertedNode, offset, ec);
- if (ec) {
- WebCore::ExceptionCodeDescription ecdesc(ec);
</del><ins>+ auto result = item->extend(*convertedNode, offset);
+ if (result.hasException()) {
+ WebCore::ExceptionCodeDescription ecdesc(result.releaseException().code());
</ins><span class="cx"> g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -364,13 +361,13 @@
</span><span class="cx"> g_return_val_if_fail(WEBKIT_DOM_IS_DOM_SELECTION(self), 0);
</span><span class="cx"> g_return_val_if_fail(!error || !*error, 0);
</span><span class="cx"> WebCore::DOMSelection* item = WebKit::core(self);
</span><del>- WebCore::ExceptionCode ec = 0;
- RefPtr<WebCore::Range> gobjectResult = WTF::getPtr(item->getRangeAt(index, ec));
- if (ec) {
- WebCore::ExceptionCodeDescription ecdesc(ec);
</del><ins>+ auto result = item->getRangeAt(index);
+ if (result.hasException()) {
+ WebCore::ExceptionCodeDescription ecdesc(result.releaseException().code());
</ins><span class="cx"> g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
</span><ins>+ return nullptr;
</ins><span class="cx"> }
</span><del>- return WebKit::kit(gobjectResult.get());
</del><ins>+ return WebKit::kit(result.releaseReturnValue().ptr());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void webkit_dom_dom_selection_remove_all_ranges(WebKitDOMDOMSelection* self)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Tools/ChangeLog        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-10-06 Darin Adler <darin@apple.com>
+
+ Next step on moving to modern way to return DOM exceptions
+ https://bugs.webkit.org/show_bug.cgi?id=163016
+
+ Reviewed by Ryosuke Niwa.
+
+ * Scripts/do-webcore-rename: Add proposed name change of setDOMException
+ to propagateException, since this function is primarily used to take an
+ exception already effectively "thrown" by setting an ExceptionCode out
+ argument and propagate it into the JavaScript engine's exception machinery.
+
</ins><span class="cx"> 2016-10-07 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> Non-special URL fragments should percent-encode non-ASCII characters
</span></span></pre></div>
<a id="trunkToolsScriptsdowebcorerename"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/do-webcore-rename (206959 => 206960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/do-webcore-rename        2016-10-08 20:42:52 UTC (rev 206959)
+++ trunk/Tools/Scripts/do-webcore-rename        2016-10-08 23:01:27 UTC (rev 206960)
</span><span class="lines">@@ -109,6 +109,9 @@
</span><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> my %renamesContemplatedForTheFuture = (
</span><ins>+ "setDOMException" => "propagateException",
+ "setDOMExceptionSlow" => "propagateExceptionSlowPath",
+
</ins><span class="cx"> "PassRefPtr" => "DeprecatedPassRefPtr",
</span><span class="cx">
</span><span class="cx"> "HTMLPlugInImageElement" => "HTMLEmbeddedObjectElement",
</span></span></pre>
</div>
</div>
</body>
</html>