<!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>[208308] 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/208308">208308</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-11-02 15:15:14 -0700 (Wed, 02 Nov 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[WebIDL] Move interfaces and typed arrays over to JSDOMConvert
https://bugs.webkit.org/show_bug.cgi?id=164256
Reviewed by Alex Christensen.
Source/JavaScriptCore:
* runtime/JSArrayBuffer.h:
(JSC::JSArrayBuffer::toWrapped):
Change return type to ArrayBuffer* to match WebCore's expectation.
Source/WebCore:
- Add the ability to pass an "exception thrower" functor to the convert functions.
This is only implemented for convert<IDLInterface<T>> and convert<IDLNullable<IDLInterface<T>>>
for now, but can be extended for more types as necessary to improve exception messages.
- Add support for using toJSNewlyCreated in JSDOMConvert.
* bindings/generic/IDLTypes.h:
(WebCore::IDLString::extractValueFromNullable):
Use forwarding to simplify extraction function.
(WebCore::IDLInterface::nullValue):
Update nullValue to work for both RefPtr<T> and T*.
(WebCore::IDLInterface::extractValueFromNullable):
Use forwarding to simplify extraction function.
* bindings/js/JSDOMConvert.h:
(WebCore::DefaultExceptionThrower::operator()):
Add a default "exception thrower" which throws a normal type error.
(WebCore::convert):
Add an overload of convert which takes an "exception thrower".
(WebCore::toJSNewlyCreated):
Add new overloaded function toJSNewlyCreated, matching the toJS overload set,
which will return "newly created" values. This only works for types that implement
a toJSNewlyCreated function for themselves.
(WebCore::Converter<IDLNullable<T>>::convert):
Fix the return type of Converter<IDLNullable<T>> to be specialized when
T is an IDLInterface. In that case, we want to match the return type of
inner converter.
Also add implementation of convert overload that takes an "exception thrower".
(WebCore::JSConverter<IDLNullable<T>>::convert):
(WebCore::JSConverter<IDLNullable<T>>::convertNewlyCreated):
Reimplement conversion to use forwarding of the value.
(WebCore::Converter<IDLInterface<T>>::convert):
Add support for an "exception thrower".
(WebCore::Detail::getPtrOrRef):
Add helper functions that extract either a pointer or reference, depending on the type,
and const_casts it allowing the value to be used with toJS functions.
(WebCore::JSConverter<IDLInterface<T>>::convert):
Re-implement to support more varied input values.
(WebCore::JSConverter<IDLInterface<T>>::convertNewlyCreated):
Added. Forwards to overloaded toJSNewlyCreated functions.
* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludesForIDLType):
Add support for adding the right includes for SerializedScriptValue and Dictionary.
(GetArgumentExceptionThrower):
(GetAttributeExceptionThrower):
Add helpers to generate "exception thrower" lambdas for wrappers and typed arrays
being passed to setters and functions.
(GenerateParametersCheck):
Move around special cases so it is clear that it's not wrappers and typed arrays that
need specialization here, it is now just EventListener and XPathNSResolver.
(GetIDLInterfaceName):
Add helper to get the InterfaceName for use in IDLInterface template.
(GetBaseIDLType):
Use new GetIDLInterfaceName helper.
(IsValidContextForJSValueToNative):
Remove IDLOperation as a valid context. It is not.
(JSValueToNative):
Move JSDOMConvert based conversion to the bottom, to show that everything above it
is a special case that should be fixed. I have used explicit c-style if-statements
to make it clear what the types of the exceptional cases are.
(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
Add wrapper types and typed arrays to the list needing state and globalObject.
(NativeToJSValue):
Move JSDOMConvert based conversion to the bottom, to show that everything above it
is a special case that should be fixed. I have used explicit c-style if-statements
to make it clear what the types of the exceptional cases are.
(JSValueToNativeIsHandledByDOMConvert): Deleted.
(NativeToJSValueIsHandledByDOMConvert): Deleted.
Remove predicates protecting use of JSDOMConvert now that it is the default.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCallback.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Update test results.
LayoutTests:
* svg/custom/polyline-points-crash-expected.txt:
* svg/dom/SVGLengthList-basics-expected.txt:
* svg/dom/SVGNumberList-basics-expected.txt:
* svg/dom/SVGPointList-basics-expected.txt:
* svg/dom/SVGTransformList-basics-expected.txt:
* svg/dom/SVGTransformList-expected.txt:
Update test results for improved error messages.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestssvgcustompolylinepointscrashexpectedtxt">trunk/LayoutTests/svg/custom/polyline-points-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgdomSVGLengthListbasicsexpectedtxt">trunk/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgdomSVGNumberListbasicsexpectedtxt">trunk/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgdomSVGPointListbasicsexpectedtxt">trunk/LayoutTests/svg/dom/SVGPointList-basics-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgdomSVGTransformListbasicsexpectedtxt">trunk/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgdomSVGTransformListexpectedtxt">trunk/LayoutTests/svg/dom/SVGTransformList-expected.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArrayBufferh">trunk/Source/JavaScriptCore/runtime/JSArrayBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsgenericIDLTypesh">trunk/Source/WebCore/bindings/generic/IDLTypes.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMConverth">trunk/Source/WebCore/bindings/js/JSDOMConvert.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCEReactionscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctioncpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestDOMJITcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestSerializationcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/LayoutTests/ChangeLog        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-11-01 Sam Weinig <sam@webkit.org>
+
+ [WebIDL] Move interfaces and typed arrays over to JSDOMConvert
+ https://bugs.webkit.org/show_bug.cgi?id=164256
+
+ Reviewed by Alex Christensen.
+
+ * svg/custom/polyline-points-crash-expected.txt:
+ * svg/dom/SVGLengthList-basics-expected.txt:
+ * svg/dom/SVGNumberList-basics-expected.txt:
+ * svg/dom/SVGPointList-basics-expected.txt:
+ * svg/dom/SVGTransformList-basics-expected.txt:
+ * svg/dom/SVGTransformList-expected.txt:
+ Update test results for improved error messages.
+
</ins><span class="cx"> 2016-11-02 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Include DebuggerAgent in Workers - see, pause, and step through scripts
</span></span></pre></div>
<a id="trunkLayoutTestssvgcustompolylinepointscrashexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/custom/polyline-points-crash-expected.txt (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/polyline-points-crash-expected.txt        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/LayoutTests/svg/custom/polyline-points-crash-expected.txt        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -1,2 +1,2 @@
</span><del>-Caught exception: SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation.
</del><ins>+Caught exception: TypeError: Argument 1 ('item') to SVGPointList.appendItem must be an instance of SVGPoint
</ins><span class="cx"> PASSED -- WebKit did not crash!
</span></span></pre></div>
<a id="trunkLayoutTestssvgdomSVGLengthListbasicsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx"> PASS text1.x.baseVal.initialize(30) threw exception TypeError: Argument 1 ('item') to SVGLengthList.initialize must be an instance of SVGLength.
</span><span class="cx"> PASS text1.x.baseVal.initialize('aString') threw exception TypeError: Argument 1 ('item') to SVGLengthList.initialize must be an instance of SVGLength.
</span><span class="cx"> PASS text1.x.baseVal.initialize(text1) threw exception TypeError: Argument 1 ('item') to SVGLengthList.initialize must be an instance of SVGLength.
</span><del>-PASS text1.x.baseVal.initialize(null) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS text1.x.baseVal.initialize(null) threw exception TypeError: Argument 1 ('item') to SVGLengthList.initialize must be an instance of SVGLength.
</ins><span class="cx">
</span><span class="cx"> Test uncommon arguments for getItem()
</span><span class="cx"> PASS text1.x.baseVal.getItem(30) threw exception IndexSizeError (DOM Exception 1): The index is not in the allowed range..
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> PASS text1.x.baseVal.insertItemBefore(30, 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.insertItemBefore must be an instance of SVGLength.
</span><span class="cx"> PASS text1.x.baseVal.insertItemBefore('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.insertItemBefore must be an instance of SVGLength.
</span><span class="cx"> PASS text1.x.baseVal.insertItemBefore(text1, 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.insertItemBefore must be an instance of SVGLength.
</span><del>-PASS text1.x.baseVal.insertItemBefore(null, 0) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS text1.x.baseVal.insertItemBefore(null, 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.insertItemBefore must be an instance of SVGLength.
</ins><span class="cx">
</span><span class="cx"> Set x='1 2 3 4' for text1
</span><span class="cx"> PASS text1.setAttribute('x', '1 2 3 4') is undefined.
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> PASS text1.x.baseVal.replaceItem(30, 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.replaceItem must be an instance of SVGLength.
</span><span class="cx"> PASS text1.x.baseVal.replaceItem('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.replaceItem must be an instance of SVGLength.
</span><span class="cx"> PASS text1.x.baseVal.replaceItem(text1, 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.replaceItem must be an instance of SVGLength.
</span><del>-PASS text1.x.baseVal.replaceItem(null, 0) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS text1.x.baseVal.replaceItem(null, 0) threw exception TypeError: Argument 1 ('item') to SVGLengthList.replaceItem must be an instance of SVGLength.
</ins><span class="cx"> PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 0) is text1.x.baseVal.getItem(0)
</span><span class="cx"> PASS text1.x.baseVal.numberOfItems is 4
</span><span class="cx"> PASS text1.x.baseVal.getItem(0).value is 1
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx"> PASS text1.x.baseVal.appendItem(30) threw exception TypeError: Argument 1 ('item') to SVGLengthList.appendItem must be an instance of SVGLength.
</span><span class="cx"> PASS text1.x.baseVal.appendItem('aString') threw exception TypeError: Argument 1 ('item') to SVGLengthList.appendItem must be an instance of SVGLength.
</span><span class="cx"> PASS text1.x.baseVal.appendItem(text1) threw exception TypeError: Argument 1 ('item') to SVGLengthList.appendItem must be an instance of SVGLength.
</span><del>-PASS text1.x.baseVal.appendItem(null) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS text1.x.baseVal.appendItem(null) threw exception TypeError: Argument 1 ('item') to SVGLengthList.appendItem must be an instance of SVGLength.
</ins><span class="cx">
</span><span class="cx"> Testing animVal clear throws
</span><span class="cx"> PASS text1.x.animVal.clear() threw exception NoModificationAllowedError (DOM Exception 7): The object can not be modified..
</span></span></pre></div>
<a id="trunkLayoutTestssvgdomSVGNumberListbasicsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -12,7 +12,7 @@
</span><span class="cx"> PASS text1.rotate.baseVal.initialize(30) threw exception TypeError: Argument 1 ('item') to SVGNumberList.initialize must be an instance of SVGNumber.
</span><span class="cx"> PASS text1.rotate.baseVal.initialize('aString') threw exception TypeError: Argument 1 ('item') to SVGNumberList.initialize must be an instance of SVGNumber.
</span><span class="cx"> PASS text1.rotate.baseVal.initialize(text1) threw exception TypeError: Argument 1 ('item') to SVGNumberList.initialize must be an instance of SVGNumber.
</span><del>-PASS text1.rotate.baseVal.initialize(null) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS text1.rotate.baseVal.initialize(null) threw exception TypeError: Argument 1 ('item') to SVGNumberList.initialize must be an instance of SVGNumber.
</ins><span class="cx">
</span><span class="cx"> Test uncommon arguments for getItem()
</span><span class="cx"> PASS text1.rotate.baseVal.getItem(30) threw exception IndexSizeError (DOM Exception 1): The index is not in the allowed range..
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> PASS text1.rotate.baseVal.insertItemBefore(30, 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.insertItemBefore must be an instance of SVGNumber.
</span><span class="cx"> PASS text1.rotate.baseVal.insertItemBefore('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.insertItemBefore must be an instance of SVGNumber.
</span><span class="cx"> PASS text1.rotate.baseVal.insertItemBefore(text1, 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.insertItemBefore must be an instance of SVGNumber.
</span><del>-PASS text1.rotate.baseVal.insertItemBefore(null, 0) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS text1.rotate.baseVal.insertItemBefore(null, 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.insertItemBefore must be an instance of SVGNumber.
</ins><span class="cx">
</span><span class="cx"> Set rotate='1 2 3 4' for text1
</span><span class="cx"> PASS text1.setAttribute('rotate', '1 2 3 4') is undefined.
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx"> PASS text1.rotate.baseVal.replaceItem(30, 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.replaceItem must be an instance of SVGNumber.
</span><span class="cx"> PASS text1.rotate.baseVal.replaceItem('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.replaceItem must be an instance of SVGNumber.
</span><span class="cx"> PASS text1.rotate.baseVal.replaceItem(text1, 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.replaceItem must be an instance of SVGNumber.
</span><del>-PASS text1.rotate.baseVal.replaceItem(null, 0) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS text1.rotate.baseVal.replaceItem(null, 0) threw exception TypeError: Argument 1 ('item') to SVGNumberList.replaceItem must be an instance of SVGNumber.
</ins><span class="cx"> PASS text1.rotate.baseVal.replaceItem(text1.rotate.baseVal.getItem(0), 0) is text1.rotate.baseVal.getItem(0)
</span><span class="cx"> PASS text1.rotate.baseVal.numberOfItems is 4
</span><span class="cx"> PASS text1.rotate.baseVal.getItem(0).value is 1
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx"> PASS text1.rotate.baseVal.appendItem(30) threw exception TypeError: Argument 1 ('item') to SVGNumberList.appendItem must be an instance of SVGNumber.
</span><span class="cx"> PASS text1.rotate.baseVal.appendItem('aString') threw exception TypeError: Argument 1 ('item') to SVGNumberList.appendItem must be an instance of SVGNumber.
</span><span class="cx"> PASS text1.rotate.baseVal.appendItem(text1) threw exception TypeError: Argument 1 ('item') to SVGNumberList.appendItem must be an instance of SVGNumber.
</span><del>-PASS text1.rotate.baseVal.appendItem(null) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS text1.rotate.baseVal.appendItem(null) threw exception TypeError: Argument 1 ('item') to SVGNumberList.appendItem must be an instance of SVGNumber.
</ins><span class="cx">
</span><span class="cx"> Testing animVal clear throws
</span><span class="cx"> PASS text1.rotate.animVal.clear() threw exception NoModificationAllowedError (DOM Exception 7): The object can not be modified..
</span></span></pre></div>
<a id="trunkLayoutTestssvgdomSVGPointListbasicsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/dom/SVGPointList-basics-expected.txt (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/SVGPointList-basics-expected.txt        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/LayoutTests/svg/dom/SVGPointList-basics-expected.txt        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -74,13 +74,13 @@
</span><span class="cx"> PASS poly1.points.insertItemBefore(30, 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.insertItemBefore must be an instance of SVGPoint.
</span><span class="cx"> PASS poly1.points.insertItemBefore('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.insertItemBefore must be an instance of SVGPoint.
</span><span class="cx"> PASS poly1.points.insertItemBefore(poly1, 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.insertItemBefore must be an instance of SVGPoint.
</span><del>-PASS poly1.points.insertItemBefore(null, 0) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS poly1.points.insertItemBefore(null, 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.insertItemBefore must be an instance of SVGPoint.
</ins><span class="cx">
</span><span class="cx"> Test uncommon arguments for replaceItem()
</span><span class="cx"> PASS poly1.points.replaceItem(30) threw exception TypeError: Not enough arguments.
</span><span class="cx"> PASS poly1.points.replaceItem('aString') threw exception TypeError: Not enough arguments.
</span><span class="cx"> PASS poly1.points.replaceItem(poly1) threw exception TypeError: Not enough arguments.
</span><del>-PASS poly1.points.replaceItem(null, 0) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS poly1.points.replaceItem(null, 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.replaceItem must be an instance of SVGPoint.
</ins><span class="cx"> PASS poly1.points.replaceItem('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.replaceItem must be an instance of SVGPoint.
</span><span class="cx"> PASS poly1.points.replaceItem(poly1, 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.replaceItem must be an instance of SVGPoint.
</span><span class="cx"> PASS poly1.points.replaceItem(1, 0) threw exception TypeError: Argument 1 ('item') to SVGPointList.replaceItem must be an instance of SVGPoint.
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx"> PASS poly1.points.appendItem(30) threw exception TypeError: Argument 1 ('item') to SVGPointList.appendItem must be an instance of SVGPoint.
</span><span class="cx"> PASS poly1.points.appendItem('aString') threw exception TypeError: Argument 1 ('item') to SVGPointList.appendItem must be an instance of SVGPoint.
</span><span class="cx"> PASS poly1.points.appendItem(poly1) threw exception TypeError: Argument 1 ('item') to SVGPointList.appendItem must be an instance of SVGPoint.
</span><del>-PASS poly1.points.appendItem(null) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS poly1.points.appendItem(null) threw exception TypeError: Argument 1 ('item') to SVGPointList.appendItem must be an instance of SVGPoint.
</ins><span class="cx"> PASS dumpPoint(poly1.points.appendItem(point)) is "x=200 y=100"
</span><span class="cx"> PASS poly1.points.numberOfItems is 2
</span><span class="cx"> PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=100"
</span></span></pre></div>
<a id="trunkLayoutTestssvgdomSVGTransformListbasicsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx"> PASS circle1.transform.baseVal.initialize(30) threw exception TypeError: Argument 1 ('item') to SVGTransformList.initialize must be an instance of SVGTransform.
</span><span class="cx"> PASS circle1.transform.baseVal.initialize('aString') threw exception TypeError: Argument 1 ('item') to SVGTransformList.initialize must be an instance of SVGTransform.
</span><span class="cx"> PASS circle1.transform.baseVal.initialize(circle1) threw exception TypeError: Argument 1 ('item') to SVGTransformList.initialize must be an instance of SVGTransform.
</span><del>-PASS circle1.transform.baseVal.initialize(null) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS circle1.transform.baseVal.initialize(null) threw exception TypeError: Argument 1 ('item') to SVGTransformList.initialize must be an instance of SVGTransform.
</ins><span class="cx">
</span><span class="cx"> Test uncommon arguments for getItem()
</span><span class="cx"> PASS circle1.transform.baseVal.getItem(30) threw exception IndexSizeError (DOM Exception 1): The index is not in the allowed range..
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> PASS circle1.transform.baseVal.insertItemBefore(30, 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.insertItemBefore must be an instance of SVGTransform.
</span><span class="cx"> PASS circle1.transform.baseVal.insertItemBefore('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.insertItemBefore must be an instance of SVGTransform.
</span><span class="cx"> PASS circle1.transform.baseVal.insertItemBefore(circle1, 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.insertItemBefore must be an instance of SVGTransform.
</span><del>-PASS circle1.transform.baseVal.insertItemBefore(null, 0) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS circle1.transform.baseVal.insertItemBefore(null, 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.insertItemBefore must be an instance of SVGTransform.
</ins><span class="cx">
</span><span class="cx"> Test overlapping edge cases for removeItem()
</span><span class="cx"> PASS circle1.setAttribute('transform', 'scale(2 2) translate(10 10)') is undefined.
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx"> PASS circle1.transform.baseVal.replaceItem(30, 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.replaceItem must be an instance of SVGTransform.
</span><span class="cx"> PASS circle1.transform.baseVal.replaceItem('aString', 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.replaceItem must be an instance of SVGTransform.
</span><span class="cx"> PASS circle1.transform.baseVal.replaceItem(circle1, 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.replaceItem must be an instance of SVGTransform.
</span><del>-PASS circle1.transform.baseVal.replaceItem(null, 0) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS circle1.transform.baseVal.replaceItem(null, 0) threw exception TypeError: Argument 1 ('item') to SVGTransformList.replaceItem must be an instance of SVGTransform.
</ins><span class="cx"> PASS circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.getItem(0), 0) is circle1.transform.baseVal.getItem(0)
</span><span class="cx"> PASS circle1.transform.baseVal.numberOfItems is 4
</span><span class="cx"> PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]"
</span><span class="lines">@@ -126,7 +126,7 @@
</span><span class="cx"> PASS circle1.transform.baseVal.appendItem(30) threw exception TypeError: Argument 1 ('item') to SVGTransformList.appendItem must be an instance of SVGTransform.
</span><span class="cx"> PASS circle1.transform.baseVal.appendItem('aString') threw exception TypeError: Argument 1 ('item') to SVGTransformList.appendItem must be an instance of SVGTransform.
</span><span class="cx"> PASS circle1.transform.baseVal.appendItem(circle1) threw exception TypeError: Argument 1 ('item') to SVGTransformList.appendItem must be an instance of SVGTransform.
</span><del>-PASS circle1.transform.baseVal.appendItem(null) threw exception SVG_WRONG_TYPE_ERR (DOM SVG Exception): An object of the wrong type was passed to an operation..
</del><ins>+PASS circle1.transform.baseVal.appendItem(null) threw exception TypeError: Argument 1 ('item') to SVGTransformList.appendItem must be an instance of SVGTransform.
</ins><span class="cx">
</span><span class="cx"> Testing animVal clear throws
</span><span class="cx"> PASS circle1.transform.animVal.clear() threw exception NoModificationAllowedError (DOM Exception 7): The object can not be modified..
</span></span></pre></div>
<a id="trunkLayoutTestssvgdomSVGTransformListexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/dom/SVGTransformList-expected.txt (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/SVGTransformList-expected.txt        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/LayoutTests/svg/dom/SVGTransformList-expected.txt        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -11,8 +11,8 @@
</span><span class="cx"> PASS transform.createSVGTransformFromMatrix('aString') threw exception TypeError: Argument 1 ('matrix') to SVGTransformList.createSVGTransformFromMatrix must be an instance of SVGMatrix.
</span><span class="cx"> PASS transform.createSVGTransformFromMatrix(1) threw exception TypeError: Argument 1 ('matrix') to SVGTransformList.createSVGTransformFromMatrix must be an instance of SVGMatrix.
</span><span class="cx"> PASS transform.createSVGTransformFromMatrix(true) threw exception TypeError: Argument 1 ('matrix') to SVGTransformList.createSVGTransformFromMatrix must be an instance of SVGMatrix.
</span><del>-PASS transform.createSVGTransformFromMatrix(undefined) threw exception TypeMismatchError (DOM Exception 17): The type of an object was incompatible with the expected type of the parameter associated to the object..
-PASS transform.createSVGTransformFromMatrix(null) threw exception TypeMismatchError (DOM Exception 17): The type of an object was incompatible with the expected type of the parameter associated to the object..
</del><ins>+PASS transform.createSVGTransformFromMatrix(undefined) threw exception TypeError: Argument 1 ('matrix') to SVGTransformList.createSVGTransformFromMatrix must be an instance of SVGMatrix.
+PASS transform.createSVGTransformFromMatrix(null) threw exception TypeError: Argument 1 ('matrix') to SVGTransformList.createSVGTransformFromMatrix must be an instance of SVGMatrix.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-11-01 Sam Weinig <sam@webkit.org>
+
+ [WebIDL] Move interfaces and typed arrays over to JSDOMConvert
+ https://bugs.webkit.org/show_bug.cgi?id=164256
+
+ Reviewed by Alex Christensen.
+
+ * runtime/JSArrayBuffer.h:
+ (JSC::JSArrayBuffer::toWrapped):
+ Change return type to ArrayBuffer* to match WebCore's expectation.
+
</ins><span class="cx"> 2016-11-02 Filip Pizlo <fpizlo@apple.com>
</span><span class="cx">
</span><span class="cx"> The GC should be in a thread
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArrayBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArrayBuffer.h (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArrayBuffer.h        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/JavaScriptCore/runtime/JSArrayBuffer.h        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> DECLARE_EXPORT_INFO;
</span><span class="cx">
</span><span class="cx"> // This is the default DOM unwrapping. It calls toUnsharedArrayBuffer().
</span><del>- static RefPtr<ArrayBuffer> toWrapped(JSValue);
</del><ins>+ static ArrayBuffer* toWrapped(JSValue);
</ins><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx">
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline RefPtr<ArrayBuffer> JSArrayBuffer::toWrapped(JSValue value)
</del><ins>+inline ArrayBuffer* JSArrayBuffer::toWrapped(JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> return toUnsharedArrayBuffer(value);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/ChangeLog        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -1,3 +1,115 @@
</span><ins>+2016-11-01 Sam Weinig <sam@webkit.org>
+
+ [WebIDL] Move interfaces and typed arrays over to JSDOMConvert
+ https://bugs.webkit.org/show_bug.cgi?id=164256
+
+ Reviewed by Alex Christensen.
+
+ - Add the ability to pass an "exception thrower" functor to the convert functions.
+ This is only implemented for convert<IDLInterface<T>> and convert<IDLNullable<IDLInterface<T>>>
+ for now, but can be extended for more types as necessary to improve exception messages.
+ - Add support for using toJSNewlyCreated in JSDOMConvert.
+
+ * bindings/generic/IDLTypes.h:
+ (WebCore::IDLString::extractValueFromNullable):
+ Use forwarding to simplify extraction function.
+
+ (WebCore::IDLInterface::nullValue):
+ Update nullValue to work for both RefPtr<T> and T*.
+
+ (WebCore::IDLInterface::extractValueFromNullable):
+ Use forwarding to simplify extraction function.
+
+ * bindings/js/JSDOMConvert.h:
+ (WebCore::DefaultExceptionThrower::operator()):
+ Add a default "exception thrower" which throws a normal type error.
+
+ (WebCore::convert):
+ Add an overload of convert which takes an "exception thrower".
+
+ (WebCore::toJSNewlyCreated):
+ Add new overloaded function toJSNewlyCreated, matching the toJS overload set,
+ which will return "newly created" values. This only works for types that implement
+ a toJSNewlyCreated function for themselves.
+
+ (WebCore::Converter<IDLNullable<T>>::convert):
+ Fix the return type of Converter<IDLNullable<T>> to be specialized when
+ T is an IDLInterface. In that case, we want to match the return type of
+ inner converter.
+
+ Also add implementation of convert overload that takes an "exception thrower".
+
+ (WebCore::JSConverter<IDLNullable<T>>::convert):
+ (WebCore::JSConverter<IDLNullable<T>>::convertNewlyCreated):
+ Reimplement conversion to use forwarding of the value.
+
+ (WebCore::Converter<IDLInterface<T>>::convert):
+ Add support for an "exception thrower".
+
+ (WebCore::Detail::getPtrOrRef):
+ Add helper functions that extract either a pointer or reference, depending on the type,
+ and const_casts it allowing the value to be used with toJS functions.
+
+ (WebCore::JSConverter<IDLInterface<T>>::convert):
+ Re-implement to support more varied input values.
+
+ (WebCore::JSConverter<IDLInterface<T>>::convertNewlyCreated):
+ Added. Forwards to overloaded toJSNewlyCreated functions.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (AddToImplIncludesForIDLType):
+ Add support for adding the right includes for SerializedScriptValue and Dictionary.
+
+ (GetArgumentExceptionThrower):
+ (GetAttributeExceptionThrower):
+ Add helpers to generate "exception thrower" lambdas for wrappers and typed arrays
+ being passed to setters and functions.
+
+ (GenerateParametersCheck):
+ Move around special cases so it is clear that it's not wrappers and typed arrays that
+ need specialization here, it is now just EventListener and XPathNSResolver.
+
+ (GetIDLInterfaceName):
+ Add helper to get the InterfaceName for use in IDLInterface template.
+
+ (GetBaseIDLType):
+ Use new GetIDLInterfaceName helper.
+
+ (IsValidContextForJSValueToNative):
+ Remove IDLOperation as a valid context. It is not.
+
+ (JSValueToNative):
+ Move JSDOMConvert based conversion to the bottom, to show that everything above it
+ is a special case that should be fixed. I have used explicit c-style if-statements
+ to make it clear what the types of the exceptional cases are.
+
+ (NativeToJSValueDOMConvertNeedsState):
+ (NativeToJSValueDOMConvertNeedsGlobalObject):
+ Add wrapper types and typed arrays to the list needing state and globalObject.
+
+ (NativeToJSValue):
+ Move JSDOMConvert based conversion to the bottom, to show that everything above it
+ is a special case that should be fixed. I have used explicit c-style if-statements
+ to make it clear what the types of the exceptional cases are.
+
+ (JSValueToNativeIsHandledByDOMConvert): Deleted.
+ (NativeToJSValueIsHandledByDOMConvert): Deleted.
+ Remove predicates protecting use of JSDOMConvert now that it is the default.
+
+ * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
+ * bindings/scripts/test/JS/JSTestCEReactions.cpp:
+ * bindings/scripts/test/JS/JSTestCallback.cpp:
+ * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
+ * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
+ * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+ * bindings/scripts/test/JS/JSTestInterface.cpp:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
+ * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
+ * bindings/scripts/test/JS/JSTestSerialization.cpp:
+ * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+ Update test results.
+
</ins><span class="cx"> 2016-11-02 David Kilzer <ddkilzer@apple.com>
</span><span class="cx">
</span><span class="cx"> Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgenericIDLTypesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/generic/IDLTypes.h (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/generic/IDLTypes.h        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/generic/IDLTypes.h        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx"> using NullableType = String;
</span><span class="cx"> static String nullValue() { return String(); }
</span><span class="cx"> static bool isNullValue(const String& value) { return value.isNull(); }
</span><del>- static const String& extractValueFromNullable(const String& value) { return value; }
</del><ins>+ template <typename U> static U&& extractValueFromNullable(U&& value) { return std::forward<U>(value); }
</ins><span class="cx"> };
</span><span class="cx"> struct IDLDOMString : IDLString { };
</span><span class="cx"> struct IDLByteString : IDLUnsupportedType { };
</span><span class="lines">@@ -95,9 +95,9 @@
</span><span class="cx"> using RawType = T;
</span><span class="cx">
</span><span class="cx"> using NullableType = RefPtr<T>;
</span><del>- static RefPtr<T> nullValue() { return nullptr; }
</del><ins>+ static std::nullptr_t nullValue() { return nullptr; }
</ins><span class="cx"> static bool isNullValue(const RefPtr<T>& value) { return !value; }
</span><del>- static const RefPtr<T>& extractValueFromNullable(const RefPtr<T>& value) { return value; }
</del><ins>+ template <typename U> static U&& extractValueFromNullable(U&& value) { return std::forward<U>(value); }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> template<typename T> struct IDLDictionary : IDLType<T> { };
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMConverth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMConvert.h (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -37,9 +37,17 @@
</span><span class="cx"> enum class IntegerConversionConfiguration { Normal, EnforceRange, Clamp };
</span><span class="cx"> enum class StringConversionConfiguration { Normal, TreatNullAsEmptyString };
</span><span class="cx">
</span><ins>+struct DefaultExceptionThrower {
+ void operator()(JSC::ExecState& state, JSC::ThrowScope& scope)
+ {
+ throwTypeError(&state, scope);
+ }
+};
+
</ins><span class="cx"> template<typename T> typename Converter<T>::ReturnType convert(JSC::ExecState&, JSC::JSValue);
</span><span class="cx"> template<typename T> typename Converter<T>::ReturnType convert(JSC::ExecState&, JSC::JSValue, IntegerConversionConfiguration);
</span><span class="cx"> template<typename T> typename Converter<T>::ReturnType convert(JSC::ExecState&, JSC::JSValue, StringConversionConfiguration);
</span><ins>+template<typename T, typename ExceptionThrower> typename Converter<T>::ReturnType convert(JSC::ExecState&, JSC::JSValue, ExceptionThrower&&);
</ins><span class="cx">
</span><span class="cx"> // Specialized by generated code for IDL dictionary conversion.
</span><span class="cx"> template<typename T> T convertDictionary(JSC::ExecState&, JSC::JSValue);
</span><span class="lines">@@ -64,6 +72,11 @@
</span><span class="cx"> return Converter<T>::convert(state, value, configuration);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+template<typename T, typename ExceptionThrower> inline typename Converter<T>::ReturnType convert(JSC::ExecState& state, JSC::JSValue value, ExceptionThrower&& exceptionThrower)
+{
+ return Converter<T>::convert(state, value, std::forward<ExceptionThrower>(exceptionThrower));
+}
+
</ins><span class="cx"> // Conversion from Implementation -> JSValue
</span><span class="cx"> template<typename T> struct JSConverter;
</span><span class="cx">
</span><span class="lines">@@ -72,6 +85,8 @@
</span><span class="cx"> template<typename T, typename U> inline JSC::JSValue toJS(JSC::ExecState&, JSDOMGlobalObject&, U&&);
</span><span class="cx"> template<typename T, typename U> inline JSC::JSValue toJS(JSC::ExecState&, JSC::ThrowScope&, ExceptionOr<U>&&);
</span><span class="cx"> template<typename T, typename U> inline JSC::JSValue toJS(JSC::ExecState&, JSDOMGlobalObject&, JSC::ThrowScope&, ExceptionOr<U>&&);
</span><ins>+template<typename T, typename U> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState&, JSDOMGlobalObject&, U&&);
+template<typename T, typename U> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState&, JSDOMGlobalObject&, JSC::ThrowScope&, ExceptionOr<U>&&);
</ins><span class="cx">
</span><span class="cx"> // Specialized by generated code for IDL enumeration conversion.
</span><span class="cx"> template<typename T> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, T);
</span><span class="lines">@@ -149,7 +164,22 @@
</span><span class="cx"> return toJS<T>(state, globalObject, value.releaseReturnValue());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+template<typename T, typename U> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState& state, JSDOMGlobalObject& globalObject, U&& value)
+{
+ return JSConverter<T>::convertNewlyCreated(state, globalObject, std::forward<U>(value));
+}
</ins><span class="cx">
</span><ins>+template<typename T, typename U> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState& state, JSDOMGlobalObject& globalObject, JSC::ThrowScope& throwScope, ExceptionOr<U>&& value)
+{
+ if (UNLIKELY(value.hasException())) {
+ propagateException(state, throwScope, value.releaseException());
+ return { };
+ }
+
+ return toJSNewlyCreated<T>(state, globalObject, value.releaseReturnValue());
+}
+
+
</ins><span class="cx"> template<typename T> struct DefaultConverter {
</span><span class="cx"> using ReturnType = typename T::ImplementationType;
</span><span class="cx"> };
</span><span class="lines">@@ -157,8 +187,23 @@
</span><span class="cx"> // MARK: -
</span><span class="cx"> // MARK: Nullable type
</span><span class="cx">
</span><ins>+namespace Detail {
+ template<typename IDLType>
+ struct NullableConversionType;
+
+ template<typename IDLType>
+ struct NullableConversionType {
+ using Type = typename IDLNullable<IDLType>::ImplementationType;
+ };
+
+ template<typename T>
+ struct NullableConversionType<IDLInterface<T>> {
+ using Type = typename Converter<IDLInterface<T>>::ReturnType;
+ };
+}
+
</ins><span class="cx"> template<typename T> struct Converter<IDLNullable<T>> : DefaultConverter<IDLNullable<T>> {
</span><del>- using ReturnType = typename IDLNullable<T>::ImplementationType;
</del><ins>+ using ReturnType = typename Detail::NullableConversionType<T>::Type;
</ins><span class="cx">
</span><span class="cx"> // 1. If Type(V) is not Object, and the conversion to an IDL value is being performed
</span><span class="cx"> // due to V being assigned to an attribute whose type is a nullable callback function
</span><span class="lines">@@ -188,6 +233,14 @@
</span><span class="cx"> return T::nullValue();
</span><span class="cx"> return Converter<T>::convert(state, value, configuration);
</span><span class="cx"> }
</span><ins>+
+ template<typename ExceptionThrower = DefaultExceptionThrower>
+ static ReturnType convert(JSC::ExecState& state, JSC::JSValue value, ExceptionThrower&& exceptionThrower)
+ {
+ if (value.isUndefinedOrNull())
+ return T::nullValue();
+ return Converter<T>::convert(state, value, std::forward<ExceptionThrower>(exceptionThrower));
+ }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> template<typename T> struct JSConverter<IDLNullable<T>> {
</span><span class="lines">@@ -196,24 +249,35 @@
</span><span class="cx"> static constexpr bool needsState = JSConverter<T>::needsState;
</span><span class="cx"> static constexpr bool needsGlobalObject = JSConverter<T>::needsGlobalObject;
</span><span class="cx">
</span><del>- static JSC::JSValue convert(const ImplementationType& value)
</del><ins>+ template<typename U>
+ static JSC::JSValue convert(U&& value)
</ins><span class="cx"> {
</span><span class="cx"> if (T::isNullValue(value))
</span><span class="cx"> return JSC::jsNull();
</span><span class="cx"> return JSConverter<T>::convert(T::extractValueFromNullable(value));
</span><span class="cx"> }
</span><del>- static JSC::JSValue convert(JSC::ExecState& state, const ImplementationType& value)
</del><ins>+ template<typename U>
+ static JSC::JSValue convert(JSC::ExecState& state, U&& value)
</ins><span class="cx"> {
</span><span class="cx"> if (T::isNullValue(value))
</span><span class="cx"> return JSC::jsNull();
</span><span class="cx"> return JSConverter<T>::convert(state, T::extractValueFromNullable(value));
</span><span class="cx"> }
</span><del>- static JSC::JSValue convert(JSC::ExecState& state, JSDOMGlobalObject& globalObject, const ImplementationType& value)
</del><ins>+ template<typename U>
+ static JSC::JSValue convert(JSC::ExecState& state, JSDOMGlobalObject& globalObject, U&& value)
</ins><span class="cx"> {
</span><span class="cx"> if (T::isNullValue(value))
</span><span class="cx"> return JSC::jsNull();
</span><span class="cx"> return JSConverter<T>::convert(state, globalObject, T::extractValueFromNullable(value));
</span><span class="cx"> }
</span><ins>+
+ template<typename U>
+ static JSC::JSValue convertNewlyCreated(JSC::ExecState& state, JSDOMGlobalObject& globalObject, U&& value)
+ {
+ if (T::isNullValue(value))
+ return JSC::jsNull();
+ return JSConverter<T>::convert(state, globalObject, T::extractValueFromNullable(value));
+ }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // MARK: -
</span><span class="lines">@@ -261,25 +325,41 @@
</span><span class="cx"> using ReturnType = typename JSDOMWrapperConverterTraits<T>::ToWrappedReturnType;
</span><span class="cx"> using WrapperType = typename JSDOMWrapperConverterTraits<T>::WrapperClass;
</span><span class="cx">
</span><del>- static ReturnType convert(JSC::ExecState& state, JSC::JSValue value)
</del><ins>+ template<typename ExceptionThrower = DefaultExceptionThrower>
+ static ReturnType convert(JSC::ExecState& state, JSC::JSValue value, ExceptionThrower&& exceptionThrower = ExceptionThrower())
</ins><span class="cx"> {
</span><span class="cx"> JSC::VM& vm = state.vm();
</span><span class="cx"> auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> ReturnType object = WrapperType::toWrapped(value);
</span><del>- if (!object)
- throwTypeError(&state, scope);
</del><ins>+ if (UNLIKELY(!object))
+ exceptionThrower(state, scope);
</ins><span class="cx"> return object;
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+namespace Detail {
+
+template <typename T> inline T* getPtrOrRef(const T* p) { return const_cast<T*>(p); }
+template <typename T> inline T& getPtrOrRef(const T& p) { return const_cast<T&>(p); }
+template <typename T> inline T* getPtrOrRef(const RefPtr<T>& p) { return const_cast<T*>(p.get()); }
+template <typename T> inline T& getPtrOrRef(const Ref<T>& p) { return const_cast<T&>(p.get()); }
+
+}
+
</ins><span class="cx"> template<typename T> struct JSConverter<IDLInterface<T>> {
</span><span class="cx"> static constexpr bool needsState = true;
</span><span class="cx"> static constexpr bool needsGlobalObject = true;
</span><span class="cx">
</span><ins>+ template <typename U>
+ static JSC::JSValue convert(JSC::ExecState& state, JSDOMGlobalObject& globalObject, const U& value)
+ {
+ return toJS(&state, &globalObject, Detail::getPtrOrRef(value));
+ }
+
</ins><span class="cx"> template<typename U>
</span><del>- static JSC::JSValue convert(JSC::ExecState& exec, JSDOMGlobalObject& globalObject, const U& value)
</del><ins>+ static JSC::JSValue convertNewlyCreated(JSC::ExecState& state, JSDOMGlobalObject& globalObject, U&& value)
</ins><span class="cx"> {
</span><del>- return toJS(&exec, &globalObject, WTF::getPtr(value));
</del><ins>+ return toJSNewlyCreated(&state, &globalObject, std::forward<U>(value));
</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 (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -288,6 +288,16 @@
</span><span class="cx"> AddToImplIncludes("JS" . $type->name . ".h", $conditional);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+
+ if ($type->name eq "SerializedScriptValue") {
+ AddToImplIncludes("SerializedScriptValue.h", $conditional);
+ return;
+ }
+
+ if ($type->name eq "Dictionary") {
+ AddToImplIncludes("Dictionary.h", $conditional);
+ return;
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub AddToImplIncludes
</span><span class="lines">@@ -533,6 +543,32 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub GetArgumentExceptionThrower
+{
+ my ($interface, $argument, $argumentIndex, $quotedFunctionName) = @_;
+
+ return undef if !$codeGenerator->IsWrapperType($argument->type) && !$codeGenerator->IsTypedArrayType($argument->type);
+
+ my $name = $argument->name;
+ my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interface);
+ my $typeName = $argument->type->name;
+
+ return "[](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, ${argumentIndex}, \"${name}\", \"${visibleInterfaceName}\", ${quotedFunctionName}, \"${typeName}\"); }"
+}
+
+sub GetAttributeExceptionThrower
+{
+ my ($interface, $attribute) = @_;
+
+ return undef if !$codeGenerator->IsWrapperType($attribute->type) && !$codeGenerator->IsTypedArrayType($attribute->type);
+
+ my $name = $attribute->name;
+ my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interface);
+ my $typeName = $attribute->type->name;
+
+ return "[](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, \"${visibleInterfaceName}\", \"${name}\", \"${typeName}\"); }"
+}
+
</ins><span class="cx"> sub GetAttributeGetterName
</span><span class="cx"> {
</span><span class="cx"> my ($interface, $className, $attribute) = @_;
</span><span class="lines">@@ -3276,12 +3312,7 @@
</span><span class="cx"> unshift(@arguments, @callWithArgs);
</span><span class="cx"> my $jsType = NativeToJSValueUsingReferences($attribute, 0, $interface, "${functionName}(" . join(", ", @arguments) . ")", "thisObject");
</span><span class="cx"> push(@implContent, " auto& impl = thisObject.wrapped();\n") if !$attribute->isStatic;
</span><del>- if ($codeGenerator->IsSVGAnimatedType($type)) {
- push(@implContent, " auto obj = $jsType;\n");
- push(@implContent, " JSValue result = toJS(&state, thisObject.globalObject(), obj.get());\n");
- } else {
- push(@implContent, " JSValue result = $jsType;\n");
- }
</del><ins>+ push(@implContent, " JSValue result = $jsType;\n");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> push(@implContent, " thisObject.m_" . $attribute->name . ".set(state.vm(), &thisObject, result);\n") if $attribute->extendedAttributes->{CachedAttribute};
</span><span class="lines">@@ -3540,37 +3571,18 @@
</span><span class="cx">
</span><span class="cx"> push(@implContent, " ExceptionCode ec = 0;\n") if $setterMayThrowLegacyException;
</span><span class="cx">
</span><del>- my $shouldPassByReference = ShouldPassWrapperByReference($attribute, $interface);
</del><ins>+ my $exceptionThrower = GetAttributeExceptionThrower($interface, $attribute);
</ins><span class="cx">
</span><del>- my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $attribute, "value", $attribute->extendedAttributes->{Conditional}, "&state", "state", "thisObject");
- if (!$shouldPassByReference && ($codeGenerator->IsWrapperType($type) || $codeGenerator->IsTypedArrayType($type))) {
- $implIncludes{"<runtime/Error.h>"} = 1;
- push(@implContent, " " . GetNativeType($interface, $attribute->type) . " nativeValue = nullptr;\n");
- push(@implContent, " if (!value.isUndefinedOrNull()) {\n");
- push(@implContent, " nativeValue = $nativeValue;\n");
- push(@implContent, " RETURN_IF_EXCEPTION(throwScope, false);\n") if $mayThrowException;
- push(@implContent, " if (UNLIKELY(!nativeValue)) {\n");
- push(@implContent, " throwAttributeTypeError(state, throwScope, \"$visibleInterfaceName\", \"$name\", \"" . $type->name . "\");\n");
- push(@implContent, " return false;\n");
- push(@implContent, " }\n");
- push(@implContent, " }\n");
- } else {
- push(@implContent, " auto nativeValue = $nativeValue;\n");
- push(@implContent, " RETURN_IF_EXCEPTION(throwScope, false);\n") if $mayThrowException;
- }
</del><ins>+ my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $attribute, "value", $attribute->extendedAttributes->{Conditional}, "&state", "state", "thisObject", $exceptionThrower);
</ins><span class="cx">
</span><ins>+ push(@implContent, " auto nativeValue = $nativeValue;\n");
+ push(@implContent, " RETURN_IF_EXCEPTION(throwScope, false);\n") if $mayThrowException;
+
</ins><span class="cx"> if ($codeGenerator->IsEnumType($type)) {
</span><span class="cx"> push (@implContent, " if (UNLIKELY(!nativeValue))\n");
</span><span class="cx"> push (@implContent, " return false;\n");
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($shouldPassByReference) {
- push(@implContent, " if (UNLIKELY(!nativeValue)) {\n");
- push(@implContent, " throwAttributeTypeError(state, throwScope, \"$visibleInterfaceName\", \"$name\", \"" . $type->name . "\");\n");
- push(@implContent, " return false;\n");
- push(@implContent, " }\n");
- }
-
</del><span class="cx"> if ($svgPropertyOrListPropertyType) {
</span><span class="cx"> if ($svgPropertyType) {
</span><span class="cx"> push(@implContent, " if (impl.isReadOnly()) {\n");
</span><span class="lines">@@ -3607,7 +3619,7 @@
</span><span class="cx"> } elsif ($codeGenerator->IsEnumType($type)) {
</span><span class="cx"> push(@arguments, "nativeValue.value()");
</span><span class="cx"> } else {
</span><del>- push(@arguments, $shouldPassByReference ? "*nativeValue" : "WTFMove(nativeValue)");
</del><ins>+ push(@arguments, ShouldPassWrapperByReference($attribute, $interface) ? "*nativeValue" : "WTFMove(nativeValue)");
</ins><span class="cx"> }
</span><span class="cx"> my $implementedBy = $attribute->extendedAttributes->{ImplementedBy};
</span><span class="cx"> if ($implementedBy) {
</span><span class="lines">@@ -4412,68 +4424,73 @@
</span><span class="cx"> my $inner;
</span><span class="cx"> my $nativeType = GetNativeType($interface, $argument->type);
</span><span class="cx"> my $isTearOff = $codeGenerator->IsSVGTypeNeedingTearOff($type) && $interfaceName !~ /List$/;
</span><del>- my $shouldPassByReference = $isTearOff || ShouldPassWrapperByReference($argument, $interface);
</del><span class="cx">
</span><span class="cx"> die "Variadic argument is already handled here" if $argument->isVariadic;
</span><span class="cx"> my $argumentLookupMethod = $argument->isOptional ? "argument" : "uncheckedArgument";
</span><span class="cx">
</span><del>- if (!$shouldPassByReference && ($codeGenerator->IsWrapperType($type) || $codeGenerator->IsTypedArrayType($type))) {
- $implIncludes{"<runtime/Error.h>"} = 1;
- my $checkedArgument = "state->$argumentLookupMethod($argumentIndex)";
- my $uncheckedArgument = "state->uncheckedArgument($argumentIndex)";
- my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $argument, $uncheckedArgument, $function->extendedAttributes->{Conditional});
- push(@$outputArray, " $nativeType $name = nullptr;\n");
- push(@$outputArray, " if (!$checkedArgument.isUndefinedOrNull()) {\n");
- push(@$outputArray, " $name = $nativeValue;\n");
- push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $mayThrowException;
- push(@$outputArray, " if (UNLIKELY(!$name))\n");
- push(@$outputArray, " return throwArgumentTypeError(*state, throwScope, $argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName, \"" . $type->name . "\");\n");
- push(@$outputArray, " }\n");
- $value = "WTFMove($name)";
- } else {
- if ($argument->isOptional && defined($argument->default) && !WillConvertUndefinedToDefaultParameterValue($type, $argument->default)) {
- my $defaultValue = $argument->default;
</del><ins>+ if ($argument->isOptional && defined($argument->default) && !WillConvertUndefinedToDefaultParameterValue($type, $argument->default)) {
+ my $defaultValue = $argument->default;
</ins><span class="cx">
</span><del>- # String-related optimizations.
- if ($codeGenerator->IsStringType($type)) {
- my $useAtomicString = $argument->extendedAttributes->{AtomicString};
- if ($defaultValue eq "null") {
- $defaultValue = $useAtomicString ? "nullAtom" : "String()";
- } elsif ($defaultValue eq "\"\"") {
- $defaultValue = $useAtomicString ? "emptyAtom" : "emptyString()";
- } else {
- $defaultValue = $useAtomicString ? "AtomicString($defaultValue, AtomicString::ConstructFromLiteral)" : "ASCIILiteral($defaultValue)";
- }
</del><ins>+ # String-related optimizations.
+ if ($codeGenerator->IsStringType($type)) {
+ my $useAtomicString = $argument->extendedAttributes->{AtomicString};
+ if ($defaultValue eq "null") {
+ $defaultValue = $useAtomicString ? "nullAtom" : "String()";
+ } elsif ($defaultValue eq "\"\"") {
+ $defaultValue = $useAtomicString ? "emptyAtom" : "emptyString()";
</ins><span class="cx"> } else {
</span><del>- $defaultValue = GenerateDefaultValue($interface, $argument->type, $argument->default);
</del><ins>+ $defaultValue = $useAtomicString ? "AtomicString($defaultValue, AtomicString::ConstructFromLiteral)" : "ASCIILiteral($defaultValue)";
</ins><span class="cx"> }
</span><ins>+ } else {
+ $defaultValue = GenerateDefaultValue($interface, $argument->type, $argument->default);
+ }
</ins><span class="cx">
</span><del>- $outer = "state->$argumentLookupMethod($argumentIndex).isUndefined() ? $defaultValue : ";
- $inner = "state->uncheckedArgument($argumentIndex)";
- } elsif ($argument->isOptional && !defined($argument->default)) {
- # Use WTF::Optional<>() for optional arguments that are missing or undefined and that do not have a default value in the IDL.
- $outer = "state->$argumentLookupMethod($argumentIndex).isUndefined() ? Optional<$nativeType>() : ";
- $inner = "state->uncheckedArgument($argumentIndex)";
</del><ins>+ $outer = "state->$argumentLookupMethod($argumentIndex).isUndefined() ? $defaultValue : ";
+ $inner = "state->uncheckedArgument($argumentIndex)";
+ } elsif ($argument->isOptional && !defined($argument->default)) {
+ # Use WTF::Optional<>() for optional arguments that are missing or undefined and that do not have a default value in the IDL.
+ $outer = "state->$argumentLookupMethod($argumentIndex).isUndefined() ? Optional<$nativeType>() : ";
+ $inner = "state->uncheckedArgument($argumentIndex)";
+ } elsif (($argument->type->name eq "EventListener" || $argument->type->name eq "XPathNSResolver") && ($argument->isOptional || $type->isNullable)) {
+ $outer = "";
+ $inner = "state->uncheckedArgument($argumentIndex)";
+ } else {
+ $outer = "";
+ $inner = "state->$argumentLookupMethod($argumentIndex)";
+ }
+
+ my $argumentExceptionThrower = GetArgumentExceptionThrower($interface, $argument, $argumentIndex, $quotedFunctionName);
+ my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $argument, $inner, $function->extendedAttributes->{Conditional}, "state", "*state", "", $argumentExceptionThrower);
+
+ if ($argument->type->name eq "EventListener" || $argument->type->name eq "XPathNSResolver") {
+ if ($argument->isOptional || $type->isNullable) {
+ push(@$outputArray, " $nativeType $name = nullptr;\n");
+ push(@$outputArray, " if (!state->$argumentLookupMethod($argumentIndex).isUndefinedOrNull()) {\n");
+ push(@$outputArray, " $name = $nativeValue;\n");
+ push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $mayThrowException;
+ push(@$outputArray, " if (UNLIKELY(!$name))\n");
+ push(@$outputArray, " return throwArgumentTypeError(*state, throwScope, $argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName, \"" . $type->name . "\");\n");
+ push(@$outputArray, " }\n");
</ins><span class="cx"> } else {
</span><del>- $outer = "";
- $inner = "state->$argumentLookupMethod($argumentIndex)";
</del><ins>+ push(@$outputArray, " auto $name = $nativeValue;\n");
+ push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $mayThrowException;
+ push(@$outputArray, " if (UNLIKELY(!$name))\n");
+ push(@$outputArray, " return throwArgumentTypeError(*state, throwScope, $argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName, \"" . $type->name . "\");\n");
</ins><span class="cx"> }
</span><del>-
- my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $argument, $inner, $function->extendedAttributes->{Conditional});
</del><ins>+ } else {
</ins><span class="cx"> push(@$outputArray, " auto $name = ${outer}${nativeValue};\n");
</span><del>- $value = "WTFMove($name)";
</del><span class="cx"> push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $mayThrowException;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($shouldPassByReference) {
- push(@$outputArray, " if (UNLIKELY(!$name))\n");
- push(@$outputArray, " return throwArgumentTypeError(*state, throwScope, $argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName, \"" . $type->name . "\");\n");
- $value = $isTearOff ? "$name->propertyReference()" : "*$name";
- }
-
- if ($codeGenerator->IsTypedArrayType($type) and $type->name ne "ArrayBuffer") {
- $value = $shouldPassByReference ? "$name.releaseNonNull()" : "WTFMove($name)";
- } elsif ($codeGenerator->IsDictionaryType($type)) {
</del><ins>+ if ($isTearOff) {
+ $value = "$name->propertyReference()";
+ } elsif (ShouldPassWrapperByReference($argument, $interface)) {
+ if ($codeGenerator->IsTypedArrayType($type) and $type->name ne "ArrayBuffer") {
+ $value = "$name.releaseNonNull()";
+ } else {
+ $value = "*$name";
+ }
+ } else {
</ins><span class="cx"> $value = "WTFMove($name)";
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -5068,6 +5085,14 @@
</span><span class="cx"> return @idlUnionMemberTypes;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub GetIDLInterfaceName
+{
+ my ($type) = @_;
+
+ return $codeGenerator->GetSVGTypeNeedingTearOff($type) if $codeGenerator->IsSVGTypeNeedingTearOff($type);
+ return $type->name;
+}
+
</ins><span class="cx"> sub GetBaseIDLType
</span><span class="cx"> {
</span><span class="cx"> my ($interface, $type) = @_;
</span><span class="lines">@@ -5102,7 +5127,7 @@
</span><span class="cx"> return "IDLSequence<" . GetIDLType($interface, @{$type->subtypes}[0]) . ">" if $codeGenerator->IsSequenceType($type);
</span><span class="cx"> return "IDLFrozenArray<" . GetIDLType($interface, @{$type->subtypes}[0]) . ">" if $codeGenerator->IsFrozenArrayType($type);
</span><span class="cx"> return "IDLUnion<" . join(", ", GetIDLUnionMemberTypes($interface, $type)) . ">" if $type->isUnion;
</span><del>- return "IDLInterface<" . $type->name . ">";
</del><ins>+ return "IDLInterface<" . GetIDLInterfaceName($type) . ">";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub GetIDLType
</span><span class="lines">@@ -5234,30 +5259,11 @@
</span><span class="cx"> return "StringConversionConfiguration::Normal";
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub JSValueToNativeIsHandledByDOMConvert
-{
- my ($type, $context) = @_;
-
- return 0 if $type->name eq "DOMString" && ($context->extendedAttributes->{RequiresExistingAtomicString} || $context->extendedAttributes->{AtomicString});
-
- return 1 if $type->isUnion;
- return 1 if $type->name eq "any";
- return 1 if $type->name eq "boolean";
- return 1 if $type->name eq "Date";
- return 1 if $type->name eq "BufferSource";
- return 1 if $codeGenerator->IsIntegerType($type);
- return 1 if $codeGenerator->IsFloatingPointType($type);
- return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($type);
- return 1 if $codeGenerator->IsDictionaryType($type);
- return 1 if $codeGenerator->IsStringType($type);
- return 0;
-}
-
</del><span class="cx"> sub IsValidContextForJSValueToNative
</span><span class="cx"> {
</span><span class="cx"> my $context = shift;
</span><span class="cx">
</span><del>- return ref($context) eq "IDLAttribute" || ref($context) eq "IDLOperation" || ref($context) eq "IDLArgument";
</del><ins>+ return ref($context) eq "IDLAttribute" || ref($context) eq "IDLArgument";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # Returns (convertString, mayThrowException).
</span><span class="lines">@@ -5264,7 +5270,7 @@
</span><span class="cx">
</span><span class="cx"> sub JSValueToNative
</span><span class="cx"> {
</span><del>- my ($interface, $context, $value, $conditional, $statePointer, $stateReference, $thisObjectReference) = @_;
</del><ins>+ my ($interface, $context, $value, $conditional, $statePointer, $stateReference, $thisObjectReference, $exceptionThrower) = @_;
</ins><span class="cx">
</span><span class="cx"> assert("Invalid context type") if !IsValidContextForJSValueToNative($context);
</span><span class="cx">
</span><span class="lines">@@ -5275,65 +5281,47 @@
</span><span class="cx"> $stateReference = "*state" unless $stateReference;
</span><span class="cx"> $thisObjectReference = "*castedThis" unless $thisObjectReference;
</span><span class="cx">
</span><del>- if (JSValueToNativeIsHandledByDOMConvert($type, $context)) {
- AddToImplIncludes("JSDOMConvert.h");
- AddToImplIncludesForIDLType($type, $conditional);
</del><ins>+ AddToImplIncludesForIDLType($type, $conditional);
</ins><span class="cx">
</span><del>- my $IDLType = GetIDLType($interface, $type);
-
- my @conversionArguments = ();
- push(@conversionArguments, "$stateReference");
- push(@conversionArguments, "$value");
- push(@conversionArguments, GetIntegerConversionConfiguration($context)) if $codeGenerator->IsIntegerType($type);
- push(@conversionArguments, GetStringConversionConfiguration($context)) if $codeGenerator->IsStringType($type);
-
- return ("convert<$IDLType>(" . join(", ", @conversionArguments) . ")", 1);
- }
-
</del><span class="cx"> if ($type->name eq "DOMString") {
</span><span class="cx"> return ("AtomicString($value.toString($statePointer)->toExistingAtomicString($statePointer))", 1) if $context->extendedAttributes->{RequiresExistingAtomicString};
</span><span class="cx"> return ("$value.toString($statePointer)->toAtomicString($statePointer)", 1) if $context->extendedAttributes->{AtomicString};
</span><del>- assert("Unhandled string conversion.");
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($type->name eq "SerializedScriptValue") {
</span><del>- AddToImplIncludes("SerializedScriptValue.h", $conditional);
</del><span class="cx"> return ("SerializedScriptValue::create($stateReference, $value)", 1);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($type->name eq "Dictionary") {
</span><del>- AddToImplIncludes("Dictionary.h", $conditional);
</del><span class="cx"> return ("Dictionary($statePointer, $value)", 0);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- AddToImplIncludesForIDLType($type, $conditional);
</del><ins>+ if ($codeGenerator->IsEnumType($type)) {
+ return ("parseEnumeration<" . GetEnumerationClassName($type, $interface) . ">($stateReference, $value)", 1);
+ }
</ins><span class="cx">
</span><del>- return ("toUnshared@{[$type->name]}($value)", 1) if $codeGenerator->IsTypedArrayType($type);
- return ("parseEnumeration<" . GetEnumerationClassName($type, $interface) . ">($stateReference, $value)", 1) if $codeGenerator->IsEnumType($type);
-
</del><span class="cx"> # FIXME: EventListener should be a callback interface.
</span><del>- return "JSEventListener::create($value, $thisObjectReference, false, currentWorld($statePointer))" if $type->name eq "EventListener";
</del><ins>+ if ($type->name eq "EventListener") {
+ return ("JSEventListener::create($value, $thisObjectReference, false, currentWorld($statePointer))", 0);
+ }
</ins><span class="cx">
</span><del>- my $extendedAttributes = $codeGenerator->GetInterfaceExtendedAttributesFromName($type->name);
- return ("JS" . $type->name . "::toWrapped($stateReference, $value)", 1) if $type->name eq "XPathNSResolver";
- return ("JS" . $type->name . "::toWrapped($value)", 0);
-}
</del><ins>+ # FIXME: XPathNSResolver should be a callback interface.
+ if ($type->name eq "XPathNSResolver") {
+ return ("JSXPathNSResolver::toWrapped($stateReference, $value)", 1);
+ }
</ins><span class="cx">
</span><del>-sub NativeToJSValueIsHandledByDOMConvert
-{
- my ($type) = @_;
-
- return 1 if $type->name eq "any";
- return 1 if $type->name eq "boolean";
- return 1 if $type->name eq "Date";
- return 1 if $codeGenerator->IsIntegerType($type);
- return 1 if $codeGenerator->IsFloatingPointType($type);
- return 1 if $codeGenerator->IsStringType($type);
- return 1 if $codeGenerator->IsEnumType($type);
- return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($type);
- return 1 if $type->isUnion;
</del><ins>+ AddToImplIncludes("JSDOMConvert.h");
</ins><span class="cx">
</span><del>- return 0;
</del><ins>+ my $IDLType = GetIDLType($interface, $type);
+
+ my @conversionArguments = ();
+ push(@conversionArguments, "$stateReference");
+ push(@conversionArguments, "$value");
+ push(@conversionArguments, GetIntegerConversionConfiguration($context)) if $codeGenerator->IsIntegerType($type);
+ push(@conversionArguments, GetStringConversionConfiguration($context)) if $codeGenerator->IsStringType($type);
+ push(@conversionArguments, $exceptionThrower) if $exceptionThrower;
+
+ return ("convert<$IDLType>(" . join(", ", @conversionArguments) . ")", 1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub NativeToJSValueDOMConvertNeedsState
</span><span class="lines">@@ -5345,6 +5333,8 @@
</span><span class="cx"> return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($type);
</span><span class="cx"> return 1 if $codeGenerator->IsStringType($type);
</span><span class="cx"> return 1 if $codeGenerator->IsEnumType($type);
</span><ins>+ return 1 if $codeGenerator->IsWrapperType($type);
+ return 1 if $codeGenerator->IsTypedArrayType($type);
</ins><span class="cx"> return 1 if $type->name eq "Date";
</span><span class="cx">
</span><span class="cx"> return 0;
</span><span class="lines">@@ -5357,6 +5347,8 @@
</span><span class="cx"> # FIXME: This should actually check if all the sub-objects of the union need the global object.
</span><span class="cx"> return 1 if $type->isUnion;
</span><span class="cx"> return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($type);
</span><ins>+ return 1 if $codeGenerator->IsWrapperType($type);
+ return 1 if $codeGenerator->IsTypedArrayType($type);
</ins><span class="cx">
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -5416,72 +5408,63 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (NativeToJSValueIsHandledByDOMConvert($type)) {
- AddToImplIncludes("JSDOMConvert.h");
- AddToImplIncludesForIDLType($type, $conditional);
</del><ins>+ AddToImplIncludesForIDLType($type, $conditional);
</ins><span class="cx">
</span><del>- my $IDLType = GetIDLType($interface, $type);
</del><span class="cx">
</span><del>- my @conversionArguments = ();
- push(@conversionArguments, "$stateReference") if NativeToJSValueDOMConvertNeedsState($type) || $mayThrowException;
- push(@conversionArguments, "*$globalObject") if NativeToJSValueDOMConvertNeedsGlobalObject($type);
- push(@conversionArguments, "throwScope") if $mayThrowException;
- push(@conversionArguments, "$value");
-
- return "toJS<$IDLType>(" . join(", ", @conversionArguments) . ")";
- }
-
</del><span class="cx"> if ($type->name eq "SerializedScriptValue") {
</span><del>- AddToImplIncludes("SerializedScriptValue.h", $conditional);
</del><span class="cx"> return "$value ? $value->deserialize($stateReference, $globalObject) : jsNull()";
</span><span class="cx"> }
</span><ins>+
+ if ($codeGenerator->IsWrapperType($type) && !$codeGenerator->IsSVGAnimatedType($type)) {
+ if ($codeGenerator->IsSVGAnimatedType($interface->type) or ($interface->type->name eq "SVGViewSpec" and $type->name eq "SVGTransformList")) {
+ # Convert from abstract RefPtr<ListProperty> to real type, so the right toJS() method can be invoked.
+ $value = "static_cast<" . GetNativeType($interface, $type) . ">($value.get())";
+ } elsif ($interface->type->name eq "SVGViewSpec") {
+ # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked.
+ $value = "static_cast<" . GetNativeType($interface, $type) . ">($value)";
+ } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($type) and not $interface->type->name =~ /List$/) {
+ my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOff($type);
+ if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOff($type) and !$inFunctionCall and not defined $context->extendedAttributes->{Immutable}) {
+ my $getter = $value;
+ $getter =~ s/impl\.//;
+ $getter =~ s/impl->//;
+ $getter =~ s/\(\)//;
+ my $updateMethod = "&" . $interface->type->name . "::update" . $codeGenerator->WK_ucfirst($getter);
</ins><span class="cx">
</span><del>- AddToImplIncludesForIDLType($type, $conditional);
-
- return $value if $codeGenerator->IsSVGAnimatedType($type);
-
- if ($codeGenerator->IsSVGAnimatedType($interface->type) or ($interface->type->name eq "SVGViewSpec" and $type->name eq "SVGTransformList")) {
- # Convert from abstract RefPtr<ListProperty> to real type, so the right toJS() method can be invoked.
- $value = "static_cast<" . GetNativeType($interface, $type) . ">($value.get())";
- } elsif ($interface->type->name eq "SVGViewSpec") {
- # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked.
- $value = "static_cast<" . GetNativeType($interface, $type) . ">($value)";
- } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($type) and not $interface->type->name =~ /List$/) {
- my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOff($type);
- if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOff($type) and !$inFunctionCall and not defined $context->extendedAttributes->{Immutable}) {
- my $getter = $value;
- $getter =~ s/impl\.//;
- $getter =~ s/impl->//;
- $getter =~ s/\(\)//;
- my $updateMethod = "&" . $interface->type->name . "::update" . $codeGenerator->WK_ucfirst($getter);
-
- my $selfIsTearOffType = $codeGenerator->IsSVGTypeNeedingTearOff($interface->type);
- if ($selfIsTearOffType) {
- # FIXME: Why SVGMatrix specifically?
- AddToImplIncludes("SVGMatrixTearOff.h", $conditional);
- $value = "SVGMatrixTearOff::create($wrapped, $value)";
- } else {
- AddToImplIncludes("SVGStaticPropertyTearOff.h", $conditional);
- my $interfaceName = $interface->type->name;
- $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$interfaceName, /;
- $value = "${tearOffType}::create(impl, $value, $updateMethod)";
</del><ins>+ my $selfIsTearOffType = $codeGenerator->IsSVGTypeNeedingTearOff($interface->type);
+ if ($selfIsTearOffType) {
+ # FIXME: Why SVGMatrix specifically?
+ AddToImplIncludes("SVGMatrixTearOff.h", $conditional);
+ $value = "SVGMatrixTearOff::create($wrapped, $value)";
+ } else {
+ AddToImplIncludes("SVGStaticPropertyTearOff.h", $conditional);
+ my $interfaceName = $interface->type->name;
+ $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$interfaceName, /;
+ $value = "${tearOffType}::create(impl, $value, $updateMethod)";
+ }
+ } elsif ($tearOffType =~ /SVGStaticListPropertyTearOff/) {
+ $value = "${tearOffType}::create(impl, $value)";
+ } elsif (not $tearOffType =~ /SVG(Point|PathSeg)List/) {
+ $value = "${tearOffType}::create($value)";
</ins><span class="cx"> }
</span><del>- } elsif ($tearOffType =~ /SVGStaticListPropertyTearOff/) {
- $value = "${tearOffType}::create(impl, $value)";
- } elsif (not $tearOffType =~ /SVG(Point|PathSeg)List/) {
- $value = "${tearOffType}::create($value)";
</del><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> $value = "BindingSecurity::checkSecurityForNode($stateReference, $value)" if $context->extendedAttributes->{CheckSecurityForNode};
</span><span class="cx">
</span><del>- my $functionName = "toJS";
- $functionName = "toJSNewlyCreated" if $context->extendedAttributes->{NewObject};
</del><ins>+ AddToImplIncludes("JSDOMConvert.h");
</ins><span class="cx">
</span><del>- my $arguments = "$statePointer, $globalObject, $value";
- $arguments = "$stateReference, *$globalObject, throwScope, $value" if $mayThrowException;
</del><ins>+ my $IDLType = GetIDLType($interface, $type);
</ins><span class="cx">
</span><del>- return "$functionName($arguments)";
</del><ins>+ my @conversionArguments = ();
+ push(@conversionArguments, "$stateReference") if NativeToJSValueDOMConvertNeedsState($type) || $mayThrowException;
+ push(@conversionArguments, "*$globalObject") if NativeToJSValueDOMConvertNeedsGlobalObject($type);
+ push(@conversionArguments, "throwScope") if $mayThrowException;
+ push(@conversionArguments, "$value");
+
+ my $functionName = $context->extendedAttributes->{NewObject} ? "toJSNewlyCreated" : "toJS";
+
+ return "${functionName}<${IDLType}>(" . join(", ", @conversionArguments) . ")";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub ceilingToPowerOf2
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -214,9 +214,8 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto nextChild = JSNode::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!nextChild))
- return throwArgumentTypeError(*state, throwScope, 0, "nextChild", "TestActiveDOMObject", "excitingFunction", "Node");
</del><ins>+ auto nextChild = convert<IDLInterface<Node>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "nextChild", "TestActiveDOMObject", "excitingFunction", "Node"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.excitingFunction(*nextChild);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCEReactionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.cpp (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.cpp        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.cpp        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -189,7 +189,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.stringifierAttribute());
</del><ins>+ JSValue result = toJS<IDLInterface<TestCEReactionsStringifier>>(state, *thisObject.globalObject(), impl.stringifierAttribute());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -125,7 +125,7 @@
</span><span class="cx">
</span><span class="cx"> ExecState* state = m_data->globalObject()->globalExec();
</span><span class="cx"> MarkedArgumentBuffer args;
</span><del>- args.append(toJS(state, m_data->globalObject(), arrayParam));
</del><ins>+ args.append(toJS<IDLInterface<Float32Array>>(*state, *m_data->globalObject(), arrayParam));
</ins><span class="cx">
</span><span class="cx"> NakedPtr<JSC::Exception> returnedException;
</span><span class="cx"> m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackWithArrayParam"), returnedException);
</span><span class="lines">@@ -166,7 +166,7 @@
</span><span class="cx">
</span><span class="cx"> ExecState* state = m_data->globalObject()->globalExec();
</span><span class="cx"> MarkedArgumentBuffer args;
</span><del>- args.append(toJS(state, m_data->globalObject(), listParam));
</del><ins>+ args.append(toJS<IDLInterface<DOMStringList>>(*state, *m_data->globalObject(), listParam));
</ins><span class="cx">
</span><span class="cx"> NakedPtr<JSC::Exception> returnedException;
</span><span class="cx"> m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackWithStringList"), returnedException);
</span><span class="lines">@@ -207,7 +207,7 @@
</span><span class="cx"> ExecState* state = m_data->globalObject()->globalExec();
</span><span class="cx"> MarkedArgumentBuffer args;
</span><span class="cx"> args.append(toJS<IDLLong>(longParam));
</span><del>- args.append(toJS(state, m_data->globalObject(), testNodeParam));
</del><ins>+ args.append(toJS<IDLInterface<TestNode>>(*state, *m_data->globalObject(), testNodeParam));
</ins><span class="cx">
</span><span class="cx"> NakedPtr<JSC::Exception> returnedException;
</span><span class="cx"> m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, "callbackRequiresThisToPass"), returnedException);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx">
</span><span class="cx"> ExecState* state = m_data->globalObject()->globalExec();
</span><span class="cx"> MarkedArgumentBuffer args;
</span><del>- args.append(toJS(state, m_data->globalObject(), arrayParam));
</del><ins>+ args.append(toJS<IDLInterface<Float32Array>>(*state, *m_data->globalObject(), arrayParam));
</ins><span class="cx">
</span><span class="cx"> NakedPtr<JSC::Exception> returnedException;
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx">
</span><span class="cx"> ExecState* state = m_data->globalObject()->globalExec();
</span><span class="cx"> MarkedArgumentBuffer args;
</span><del>- args.append(toJS(state, m_data->globalObject(), listParam));
</del><ins>+ args.append(toJS<IDLInterface<DOMStringList>>(*state, *m_data->globalObject(), listParam));
</ins><span class="cx">
</span><span class="cx"> NakedPtr<JSC::Exception> returnedException;
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx"> ExecState* state = m_data->globalObject()->globalExec();
</span><span class="cx"> MarkedArgumentBuffer args;
</span><span class="cx"> args.append(toJS<IDLLong>(longParam));
</span><del>- args.append(toJS(state, m_data->globalObject(), testNodeParam));
</del><ins>+ args.append(toJS<IDLInterface<TestNode>>(*state, *m_data->globalObject(), testNodeParam));
</ins><span class="cx">
</span><span class="cx"> NakedPtr<JSC::Exception> returnedException;
</span><span class="cx"> UNUSED_PARAM(state);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestDOMJITcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -602,7 +602,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.byteStringAttr());
</del><ins>+ JSValue result = toJS<IDLByteString>(state, *thisObject.globalObject(), impl.byteStringAttr());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -656,7 +656,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.nodeAttr());
</del><ins>+ JSValue result = toJS<IDLInterface<Node>>(state, *thisObject.globalObject(), impl.nodeAttr());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1061,7 +1061,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.byteStringNullableAttr());
</del><ins>+ JSValue result = toJS<IDLNullable<IDLByteString>>(state, *thisObject.globalObject(), impl.byteStringNullableAttr());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1115,7 +1115,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.nodeNullableAttr());
</del><ins>+ JSValue result = toJS<IDLNullable<IDLInterface<Node>>>(state, *thisObject.globalObject(), impl.nodeNullableAttr());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -220,7 +220,7 @@
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), impl.item(WTFMove(index)));
</del><ins>+ JSValue result = toJS<IDLInterface<Node>>(*state, *castedThis->globalObject(), impl.item(WTFMove(index)));
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -511,7 +511,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.implementsNode());
</del><ins>+ JSValue result = toJS<IDLInterface<Node>>(state, *thisObject.globalObject(), impl.implementsNode());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -621,7 +621,7 @@
</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 = toJS(&state, thisObject.globalObject(), WebCore::TestSupplemental::supplementalNode(impl));
</del><ins>+ JSValue result = toJS<IDLInterface<Node>>(state, *thisObject.globalObject(), WebCore::TestSupplemental::supplementalNode(impl));
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -740,11 +740,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- auto nativeValue = JSNode::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestInterface", "implementsNode", "Node");
- return false;
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<Node>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestInterface", "implementsNode", "Node"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> impl.setImplementsNode(*nativeValue);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -818,11 +815,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- auto nativeValue = JSNode::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestInterface", "supplementalNode", "Node");
- return false;
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<Node>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestInterface", "supplementalNode", "Node"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> WebCore::TestSupplemental::setSupplementalNode(impl, *nativeValue);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -874,10 +868,9 @@
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto strArg = convert<IDLDOMString>(*state, state->uncheckedArgument(0), StringConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto objArg = JSTestObj::toWrapped(state->uncheckedArgument(1));
- if (UNLIKELY(!objArg))
- return throwArgumentTypeError(*state, throwScope, 1, "objArg", "TestInterface", "implementsMethod2", "TestObj");
- JSValue result = toJS(state, castedThis->globalObject(), impl.implementsMethod2(*context, WTFMove(strArg), *objArg, ec));
</del><ins>+ auto objArg = convert<IDLInterface<TestObj>>(*state, state->uncheckedArgument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 1, "objArg", "TestInterface", "implementsMethod2", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+ JSValue result = toJS<IDLInterface<TestObj>>(*state, *castedThis->globalObject(), impl.implementsMethod2(*context, WTFMove(strArg), *objArg, ec));
</ins><span class="cx">
</span><span class="cx"> setDOMException(state, throwScope, ec);
</span><span class="cx"> return JSValue::encode(result);
</span><span class="lines">@@ -954,10 +947,9 @@
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto strArg = convert<IDLDOMString>(*state, state->uncheckedArgument(0), StringConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto objArg = JSTestObj::toWrapped(state->uncheckedArgument(1));
- if (UNLIKELY(!objArg))
- return throwArgumentTypeError(*state, throwScope, 1, "objArg", "TestInterface", "supplementalMethod2", "TestObj");
- JSValue result = toJS(state, castedThis->globalObject(), WebCore::TestSupplemental::supplementalMethod2(impl, *context, WTFMove(strArg), *objArg, ec));
</del><ins>+ auto objArg = convert<IDLInterface<TestObj>>(*state, state->uncheckedArgument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 1, "objArg", "TestInterface", "supplementalMethod2", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+ JSValue result = toJS<IDLInterface<TestObj>>(*state, *castedThis->globalObject(), WebCore::TestSupplemental::supplementalMethod2(impl, *context, WTFMove(strArg), *objArg, ec));
</ins><span class="cx">
</span><span class="cx"> setDOMException(state, throwScope, ec);
</span><span class="cx"> return JSValue::encode(result);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -1859,7 +1859,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.readOnlyTestObjAttr());
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(state, *thisObject.globalObject(), impl.readOnlyTestObjAttr());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2130,7 +2130,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.testObjAttr());
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(state, *thisObject.globalObject(), impl.testObjAttr());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2146,7 +2146,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.testNullableObjAttr());
</del><ins>+ JSValue result = toJS<IDLNullable<IDLInterface<TestObj>>>(state, *thisObject.globalObject(), impl.testNullableObjAttr());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2162,7 +2162,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.lenientTestObjAttr());
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(state, *thisObject.globalObject(), impl.lenientTestObjAttr());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2242,7 +2242,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.xmlObjAttr());
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(state, *thisObject.globalObject(), impl.xmlObjAttr());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2469,7 +2469,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.typedArrayAttr());
</del><ins>+ JSValue result = toJS<IDLInterface<Float32Array>>(state, *thisObject.globalObject(), impl.typedArrayAttr());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2662,7 +2662,7 @@
</span><span class="cx"> if (!context)
</span><span class="cx"> return jsUndefined();
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- JSValue result = toJS(&state, thisObject.globalObject(), impl.withScriptExecutionContextAttribute(*context));
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(state, *thisObject.globalObject(), impl.withScriptExecutionContextAttribute(*context));
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2679,7 +2679,7 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> ExceptionCode ec = 0;
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- JSValue result = toJS(&state, thisObject.globalObject(), impl.withScriptStateAttributeRaises(state, ec));
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(state, *thisObject.globalObject(), impl.withScriptStateAttributeRaises(state, ec));
</ins><span class="cx"> setDOMException(&state, throwScope, ec);
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="lines">@@ -2700,7 +2700,7 @@
</span><span class="cx"> if (!context)
</span><span class="cx"> return jsUndefined();
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- JSValue result = toJS(&state, thisObject.globalObject(), impl.withScriptExecutionContextAttributeRaises(*context, ec));
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(state, *thisObject.globalObject(), impl.withScriptExecutionContextAttributeRaises(*context, ec));
</ins><span class="cx"> setDOMException(&state, throwScope, ec);
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="lines">@@ -2720,7 +2720,7 @@
</span><span class="cx"> if (!context)
</span><span class="cx"> return jsUndefined();
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- JSValue result = toJS(&state, thisObject.globalObject(), impl.withScriptExecutionContextAndScriptStateAttribute(state, *context));
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(state, *thisObject.globalObject(), impl.withScriptExecutionContextAndScriptStateAttribute(state, *context));
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2740,7 +2740,7 @@
</span><span class="cx"> if (!context)
</span><span class="cx"> return jsUndefined();
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- JSValue result = toJS(&state, thisObject.globalObject(), impl.withScriptExecutionContextAndScriptStateAttributeRaises(state, *context, ec));
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(state, *thisObject.globalObject(), impl.withScriptExecutionContextAndScriptStateAttributeRaises(state, *context, ec));
</ins><span class="cx"> setDOMException(&state, throwScope, ec);
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="lines">@@ -2760,7 +2760,7 @@
</span><span class="cx"> if (!context)
</span><span class="cx"> return jsUndefined();
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- JSValue result = toJS(&state, thisObject.globalObject(), impl.withScriptExecutionContextAndScriptStateWithSpacesAttribute(state, *context));
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(state, *thisObject.globalObject(), impl.withScriptExecutionContextAndScriptStateWithSpacesAttribute(state, *context));
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2776,7 +2776,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.withScriptArgumentsAndCallStackAttribute());
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(state, *thisObject.globalObject(), impl.withScriptArgumentsAndCallStackAttribute());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2954,7 +2954,7 @@
</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 = toJS(&state, thisObject.globalObject(), BindingSecurity::checkSecurityForNode(state, impl.contentDocument()));
</del><ins>+ JSValue result = toJS<IDLInterface<Document>>(state, *thisObject.globalObject(), BindingSecurity::checkSecurityForNode(state, impl.contentDocument()));
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2970,7 +2970,7 @@
</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 = toJS(&state, thisObject.globalObject(), SVGStaticPropertyTearOff<TestObj, SVGPoint>::create(impl, impl.mutablePoint(), &TestObj::updateMutablePoint));
</del><ins>+ JSValue result = toJS<IDLInterface<SVGPropertyTearOff<SVGPoint>>>(state, *thisObject.globalObject(), SVGStaticPropertyTearOff<TestObj, SVGPoint>::create(impl, impl.mutablePoint(), &TestObj::updateMutablePoint));
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2986,7 +2986,7 @@
</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 = toJS(&state, thisObject.globalObject(), SVGPropertyTearOff<SVGPoint>::create(impl.immutablePoint()));
</del><ins>+ JSValue result = toJS<IDLInterface<SVGPropertyTearOff<SVGPoint>>>(state, *thisObject.globalObject(), SVGPropertyTearOff<SVGPoint>::create(impl.immutablePoint()));
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3244,7 +3244,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.testReadOnlyPromiseAttribute());
</del><ins>+ JSValue result = toJS<IDLInterface<Promise>>(state, *thisObject.globalObject(), impl.testReadOnlyPromiseAttribute());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3260,7 +3260,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.putForwardsAttribute());
</del><ins>+ JSValue result = toJS<IDLInterface<TestNode>>(state, *thisObject.globalObject(), impl.putForwardsAttribute());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3276,7 +3276,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.putForwardsNullableAttribute());
</del><ins>+ JSValue result = toJS<IDLNullable<IDLInterface<TestNode>>>(state, *thisObject.globalObject(), impl.putForwardsNullableAttribute());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3591,11 +3591,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- auto nativeValue = JSTestObj::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestObject", "testObjAttr", "TestObj");
- return false;
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<TestObj>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "testObjAttr", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> impl.setTestObjAttr(*nativeValue);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -3613,14 +3610,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- TestObj* nativeValue = nullptr;
- if (!value.isUndefinedOrNull()) {
- nativeValue = JSTestObj::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestObject", "testNullableObjAttr", "TestObj");
- return false;
- }
- }
</del><ins>+ auto nativeValue = convert<IDLNullable<IDLInterface<TestObj>>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "testNullableObjAttr", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> impl.setTestNullableObjAttr(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -3638,11 +3629,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- auto nativeValue = JSTestObj::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestObject", "lenientTestObjAttr", "TestObj");
- return false;
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<TestObj>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "lenientTestObjAttr", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> impl.setLenientTestObjAttr(*nativeValue);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -3719,11 +3707,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- auto nativeValue = JSTestObj::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestObject", "XMLObjAttr", "TestObj");
- return false;
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<TestObj>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "XMLObjAttr", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> impl.setXMLObjAttr(*nativeValue);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -3990,12 +3975,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- auto nativeValue = toUnsharedFloat32Array(value);
</del><ins>+ auto nativeValue = convert<IDLInterface<Float32Array>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "typedArrayAttr", "Float32Array"); });
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><del>- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestObject", "typedArrayAttr", "Float32Array");
- return false;
- }
</del><span class="cx"> impl.setTypedArrayAttr(nativeValue.get());
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -4217,11 +4198,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- auto nativeValue = JSTestObj::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestObject", "withScriptExecutionContextAttribute", "TestObj");
- return false;
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<TestObj>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "withScriptExecutionContextAttribute", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> auto* context = jsCast<JSDOMGlobalObject*>(state.lexicalGlobalObject())->scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><span class="cx"> return false;
</span><span class="lines">@@ -4242,11 +4220,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- auto nativeValue = JSTestObj::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestObject", "withScriptStateAttributeRaises", "TestObj");
- return false;
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<TestObj>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "withScriptStateAttributeRaises", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> impl.setWithScriptStateAttributeRaises(state, *nativeValue);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -4264,11 +4239,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- auto nativeValue = JSTestObj::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestObject", "withScriptExecutionContextAttributeRaises", "TestObj");
- return false;
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<TestObj>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "withScriptExecutionContextAttributeRaises", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> auto* context = jsCast<JSDOMGlobalObject*>(state.lexicalGlobalObject())->scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><span class="cx"> return false;
</span><span class="lines">@@ -4289,11 +4261,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- auto nativeValue = JSTestObj::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestObject", "withScriptExecutionContextAndScriptStateAttribute", "TestObj");
- return false;
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<TestObj>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "withScriptExecutionContextAndScriptStateAttribute", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> auto* context = jsCast<JSDOMGlobalObject*>(state.lexicalGlobalObject())->scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><span class="cx"> return false;
</span><span class="lines">@@ -4314,11 +4283,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- auto nativeValue = JSTestObj::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestObject", "withScriptExecutionContextAndScriptStateAttributeRaises", "TestObj");
- return false;
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<TestObj>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "withScriptExecutionContextAndScriptStateAttributeRaises", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> auto* context = jsCast<JSDOMGlobalObject*>(state.lexicalGlobalObject())->scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><span class="cx"> return false;
</span><span class="lines">@@ -4339,11 +4305,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- auto nativeValue = JSTestObj::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestObject", "withScriptExecutionContextAndScriptStateWithSpacesAttribute", "TestObj");
- return false;
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<TestObj>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "withScriptExecutionContextAndScriptStateWithSpacesAttribute", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> auto* context = jsCast<JSDOMGlobalObject*>(state.lexicalGlobalObject())->scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><span class="cx"> return false;
</span><span class="lines">@@ -4364,11 +4327,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- auto nativeValue = JSTestObj::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestObject", "withScriptArgumentsAndCallStackAttribute", "TestObj");
- return false;
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<TestObj>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "withScriptArgumentsAndCallStackAttribute", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> impl.setWithScriptArgumentsAndCallStackAttribute(*nativeValue);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -4522,14 +4482,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- SVGPropertyTearOff<SVGPoint>* nativeValue = nullptr;
- if (!value.isUndefinedOrNull()) {
- nativeValue = JSSVGPoint::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestObject", "mutablePoint", "SVGPoint");
- return false;
- }
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<SVGPropertyTearOff<SVGPoint>>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "mutablePoint", "SVGPoint"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> impl.setMutablePoint(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -4547,14 +4501,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- SVGPropertyTearOff<SVGPoint>* nativeValue = nullptr;
- if (!value.isUndefinedOrNull()) {
- nativeValue = JSSVGPoint::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestObject", "immutablePoint", "SVGPoint");
- return false;
- }
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<SVGPropertyTearOff<SVGPoint>>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "immutablePoint", "SVGPoint"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> impl.setImmutablePoint(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -4887,9 +4835,8 @@
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto strArg = convert<IDLDOMString>(*state, state->uncheckedArgument(1), StringConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto objArg = JSTestObj::toWrapped(state->uncheckedArgument(2));
- if (UNLIKELY(!objArg))
- return throwArgumentTypeError(*state, throwScope, 2, "objArg", "TestObject", "voidMethodWithArgs", "TestObj");
</del><ins>+ auto objArg = convert<IDLInterface<TestObj>>(*state, state->uncheckedArgument(2), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 2, "objArg", "TestObject", "voidMethodWithArgs", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.voidMethodWithArgs(WTFMove(longArg), WTFMove(strArg), *objArg);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -4928,9 +4875,8 @@
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto strArg = convert<IDLDOMString>(*state, state->uncheckedArgument(1), StringConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto objArg = JSTestObj::toWrapped(state->uncheckedArgument(2));
- if (UNLIKELY(!objArg))
- return throwArgumentTypeError(*state, throwScope, 2, "objArg", "TestObject", "byteMethodWithArgs", "TestObj");
</del><ins>+ auto objArg = convert<IDLInterface<TestObj>>(*state, state->uncheckedArgument(2), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 2, "objArg", "TestObject", "byteMethodWithArgs", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> JSValue result = toJS<IDLByte>(impl.byteMethodWithArgs(WTFMove(byteArg), WTFMove(strArg), *objArg));
</span><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -4969,9 +4915,8 @@
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto strArg = convert<IDLDOMString>(*state, state->uncheckedArgument(1), StringConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto objArg = JSTestObj::toWrapped(state->uncheckedArgument(2));
- if (UNLIKELY(!objArg))
- return throwArgumentTypeError(*state, throwScope, 2, "objArg", "TestObject", "octetMethodWithArgs", "TestObj");
</del><ins>+ auto objArg = convert<IDLInterface<TestObj>>(*state, state->uncheckedArgument(2), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 2, "objArg", "TestObject", "octetMethodWithArgs", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> JSValue result = toJS<IDLOctet>(impl.octetMethodWithArgs(WTFMove(octetArg), WTFMove(strArg), *objArg));
</span><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -5010,9 +4955,8 @@
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto strArg = convert<IDLDOMString>(*state, state->uncheckedArgument(1), StringConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto objArg = JSTestObj::toWrapped(state->uncheckedArgument(2));
- if (UNLIKELY(!objArg))
- return throwArgumentTypeError(*state, throwScope, 2, "objArg", "TestObject", "longMethodWithArgs", "TestObj");
</del><ins>+ auto objArg = convert<IDLInterface<TestObj>>(*state, state->uncheckedArgument(2), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 2, "objArg", "TestObject", "longMethodWithArgs", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> JSValue result = toJS<IDLLong>(impl.longMethodWithArgs(WTFMove(longArg), WTFMove(strArg), *objArg));
</span><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -5029,7 +4973,7 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), impl.objMethod());
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(*state, *castedThis->globalObject(), impl.objMethod());
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -5051,10 +4995,9 @@
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto strArg = convert<IDLDOMString>(*state, state->uncheckedArgument(1), StringConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto objArg = JSTestObj::toWrapped(state->uncheckedArgument(2));
- if (UNLIKELY(!objArg))
- return throwArgumentTypeError(*state, throwScope, 2, "objArg", "TestObject", "objMethodWithArgs", "TestObj");
- JSValue result = toJS(state, castedThis->globalObject(), impl.objMethodWithArgs(WTFMove(longArg), WTFMove(strArg), *objArg));
</del><ins>+ auto objArg = convert<IDLInterface<TestObj>>(*state, state->uncheckedArgument(2), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 2, "objArg", "TestObject", "objMethodWithArgs", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+ JSValue result = toJS<IDLInterface<TestObj>>(*state, *castedThis->globalObject(), impl.objMethodWithArgs(WTFMove(longArg), WTFMove(strArg), *objArg));
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -5279,10 +5222,9 @@
</span><span class="cx"> ExceptionCode ec = 0;
</span><span class="cx"> auto strArg = convert<IDLDOMString>(*state, state->uncheckedArgument(0), StringConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto objArg = JSTestObj::toWrapped(state->uncheckedArgument(1));
- if (UNLIKELY(!objArg))
- return throwArgumentTypeError(*state, throwScope, 1, "objArg", "TestObject", "methodThatRequiresAllArgsAndThrows", "TestObj");
- JSValue result = toJS(state, castedThis->globalObject(), impl.methodThatRequiresAllArgsAndThrows(WTFMove(strArg), *objArg, ec));
</del><ins>+ auto objArg = convert<IDLInterface<TestObj>>(*state, state->uncheckedArgument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 1, "objArg", "TestObject", "methodThatRequiresAllArgsAndThrows", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+ JSValue result = toJS<IDLInterface<TestObj>>(*state, *castedThis->globalObject(), impl.methodThatRequiresAllArgsAndThrows(WTFMove(strArg), *objArg, ec));
</ins><span class="cx">
</span><span class="cx"> setDOMException(state, throwScope, ec);
</span><span class="cx"> return JSValue::encode(result);
</span><span class="lines">@@ -5432,7 +5374,7 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- JSValue result = toJS(*state, *castedThis->globalObject(), throwScope, impl.methodWithExceptionReturningObject());
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(*state, *castedThis->globalObject(), throwScope, impl.methodWithExceptionReturningObject());
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -5600,7 +5542,7 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptStateObj(*state));
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(*state, *castedThis->globalObject(), impl.withScriptStateObj(*state));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -5636,7 +5578,7 @@
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptStateObjException(*state, ec));
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(*state, *castedThis->globalObject(), impl.withScriptStateObjException(*state, ec));
</ins><span class="cx">
</span><span class="cx"> setDOMException(state, throwScope, ec);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="lines">@@ -5697,7 +5639,7 @@
</span><span class="cx"> auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptExecutionContextAndScriptStateObjException(*state, *context, ec));
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(*state, *castedThis->globalObject(), impl.withScriptExecutionContextAndScriptStateObjException(*state, *context, ec));
</ins><span class="cx">
</span><span class="cx"> setDOMException(state, throwScope, ec);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="lines">@@ -5719,7 +5661,7 @@
</span><span class="cx"> auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptExecutionContextAndScriptStateWithSpaces(*state, *context));
</del><ins>+ JSValue result = toJS<IDLInterface<TestObj>>(*state, *castedThis->globalObject(), impl.withScriptExecutionContextAndScriptStateWithSpaces(*state, *context));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -6287,12 +6229,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- TestObj* obj = nullptr;
- if (!state->argument(0).isUndefinedOrNull()) {
- obj = JSTestObj::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!obj))
- return throwArgumentTypeError(*state, throwScope, 0, "obj", "TestObject", "methodWithOptionalNullableWrapper", "TestObj");
- }
</del><ins>+ auto obj = convert<IDLNullable<IDLInterface<TestObj>>>(*state, state->argument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "obj", "TestObject", "methodWithOptionalNullableWrapper", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.methodWithOptionalNullableWrapper(WTFMove(obj));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6309,12 +6247,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- TestObj* obj = nullptr;
- if (!state->argument(0).isUndefinedOrNull()) {
- obj = JSTestObj::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!obj))
- return throwArgumentTypeError(*state, throwScope, 0, "obj", "TestObject", "methodWithOptionalNullableWrapperIsNull", "TestObj");
- }
</del><ins>+ auto obj = convert<IDLNullable<IDLInterface<TestObj>>>(*state, state->argument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "obj", "TestObject", "methodWithOptionalNullableWrapperIsNull", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.methodWithOptionalNullableWrapperIsNull(WTFMove(obj));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6574,12 +6508,8 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 2))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- TestObj* objArg = nullptr;
- if (!state->uncheckedArgument(0).isUndefinedOrNull()) {
- objArg = JSTestObj::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!objArg))
- return throwArgumentTypeError(*state, throwScope, 0, "objArg", "TestObject", "overloadedMethod", "TestObj");
- }
</del><ins>+ auto objArg = convert<IDLNullable<IDLInterface<TestObj>>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "objArg", "TestObject", "overloadedMethod", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> auto strArg = convert<IDLDOMString>(*state, state->uncheckedArgument(1), StringConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.overloadedMethod(WTFMove(objArg), WTFMove(strArg));
</span><span class="lines">@@ -6600,12 +6530,8 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- TestObj* objArg = nullptr;
- if (!state->uncheckedArgument(0).isUndefinedOrNull()) {
- objArg = JSTestObj::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!objArg))
- return throwArgumentTypeError(*state, throwScope, 0, "objArg", "TestObject", "overloadedMethod", "TestObj");
- }
</del><ins>+ auto objArg = convert<IDLNullable<IDLInterface<TestObj>>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "objArg", "TestObject", "overloadedMethod", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> auto longArg = state->argument(1).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(1), IntegerConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.overloadedMethod(WTFMove(objArg), WTFMove(longArg));
</span><span class="lines">@@ -6687,12 +6613,8 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- DOMStringList* listArg = nullptr;
- if (!state->uncheckedArgument(0).isUndefinedOrNull()) {
- listArg = JSDOMStringList::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!listArg))
- return throwArgumentTypeError(*state, throwScope, 0, "listArg", "TestObject", "overloadedMethod", "DOMStringList");
- }
</del><ins>+ auto listArg = convert<IDLNullable<IDLInterface<DOMStringList>>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "listArg", "TestObject", "overloadedMethod", "DOMStringList"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.overloadedMethod(WTFMove(listArg));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6731,9 +6653,8 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto objArg = JSTestObj::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!objArg))
- return throwArgumentTypeError(*state, throwScope, 0, "objArg", "TestObject", "overloadedMethod", "TestObj");
</del><ins>+ auto objArg = convert<IDLInterface<TestObj>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "objArg", "TestObject", "overloadedMethod", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.overloadedMethod(*objArg);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6752,9 +6673,8 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto window = JSDOMWindow::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!window))
- return throwArgumentTypeError(*state, throwScope, 0, "window", "TestObject", "overloadedMethod", "DOMWindow");
</del><ins>+ auto window = convert<IDLInterface<DOMWindow>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "window", "TestObject", "overloadedMethod", "DOMWindow"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.overloadedMethod(*window);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6899,12 +6819,8 @@
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto strArg = convert<IDLDOMString>(*state, state->uncheckedArgument(0), StringConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- TestObj* objArg = nullptr;
- if (!state->argument(1).isUndefinedOrNull()) {
- objArg = JSTestObj::toWrapped(state->uncheckedArgument(1));
- if (UNLIKELY(!objArg))
- return throwArgumentTypeError(*state, throwScope, 1, "objArg", "TestObject", "overloadedMethodWithOptionalParameter", "TestObj");
- }
</del><ins>+ auto objArg = convert<IDLNullable<IDLInterface<TestObj>>>(*state, state->argument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 1, "objArg", "TestObject", "overloadedMethodWithOptionalParameter", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.overloadedMethodWithOptionalParameter(WTFMove(strArg), WTFMove(objArg));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6923,12 +6839,8 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- TestObj* objArg = nullptr;
- if (!state->uncheckedArgument(0).isUndefinedOrNull()) {
- objArg = JSTestObj::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!objArg))
- return throwArgumentTypeError(*state, throwScope, 0, "objArg", "TestObject", "overloadedMethodWithOptionalParameter", "TestObj");
- }
</del><ins>+ auto objArg = convert<IDLNullable<IDLInterface<TestObj>>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "objArg", "TestObject", "overloadedMethodWithOptionalParameter", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> auto longArg = state->argument(1).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(1), IntegerConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.overloadedMethodWithOptionalParameter(WTFMove(objArg), WTFMove(longArg));
</span><span class="lines">@@ -7096,9 +7008,8 @@
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto objectOrNode = convert<IDLUnion<IDLInterface<TestObj>, IDLInterface<TestNode>>>(*state, state->uncheckedArgument(0));
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto object = JSTestObj::toWrapped(state->uncheckedArgument(1));
- if (UNLIKELY(!object))
- return throwArgumentTypeError(*state, throwScope, 1, "object", "TestObject", "overloadedMethodWithNonDistinguishingUnion", "TestObj");
</del><ins>+ auto object = convert<IDLInterface<TestObj>>(*state, state->uncheckedArgument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 1, "object", "TestObject", "overloadedMethodWithNonDistinguishingUnion", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.overloadedMethodWithNonDistinguishingUnion(WTFMove(objectOrNode), *object);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -7119,9 +7030,8 @@
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto objectOrNode = convert<IDLUnion<IDLInterface<TestObj>, IDLInterface<TestNode>>>(*state, state->uncheckedArgument(0));
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto node = JSTestNode::toWrapped(state->uncheckedArgument(1));
- if (UNLIKELY(!node))
- return throwArgumentTypeError(*state, throwScope, 1, "node", "TestObject", "overloadedMethodWithNonDistinguishingUnion", "TestNode");
</del><ins>+ auto node = convert<IDLInterface<TestNode>>(*state, state->uncheckedArgument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 1, "node", "TestObject", "overloadedMethodWithNonDistinguishingUnion", "TestNode"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.overloadedMethodWithNonDistinguishingUnion(WTFMove(objectOrNode), *node);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -7277,15 +7187,10 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 2))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- TestObj* obj = nullptr;
- if (!state->uncheckedArgument(0).isUndefinedOrNull()) {
- obj = JSTestObj::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!obj))
- return throwArgumentTypeError(*state, throwScope, 0, "obj", "TestObject", "overloadWithNullableNonDistinguishingParameter", "TestObj");
- }
- auto node = JSTestNode::toWrapped(state->uncheckedArgument(1));
- if (UNLIKELY(!node))
- return throwArgumentTypeError(*state, throwScope, 1, "node", "TestObject", "overloadWithNullableNonDistinguishingParameter", "TestNode");
</del><ins>+ auto obj = convert<IDLNullable<IDLInterface<TestObj>>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "obj", "TestObject", "overloadWithNullableNonDistinguishingParameter", "TestObj"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+ auto node = convert<IDLInterface<TestNode>>(*state, state->uncheckedArgument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 1, "node", "TestObject", "overloadWithNullableNonDistinguishingParameter", "TestNode"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.overloadWithNullableNonDistinguishingParameter(WTFMove(obj), *node);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -7304,12 +7209,8 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 2))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- TestNode* node = nullptr;
- if (!state->uncheckedArgument(0).isUndefinedOrNull()) {
- node = JSTestNode::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!node))
- return throwArgumentTypeError(*state, throwScope, 0, "node", "TestObject", "overloadWithNullableNonDistinguishingParameter", "TestNode");
- }
</del><ins>+ auto node = convert<IDLNullable<IDLInterface<TestNode>>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "node", "TestObject", "overloadWithNullableNonDistinguishingParameter", "TestNode"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> auto index = convert<IDLLong>(*state, state->uncheckedArgument(1), IntegerConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.overloadWithNullableNonDistinguishingParameter(WTFMove(node), WTFMove(index));
</span><span class="lines">@@ -7515,10 +7416,9 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- auto values = JSDOMStringList::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!values))
- return throwArgumentTypeError(*state, throwScope, 0, "values", "TestObject", "domStringListFunction", "DOMStringList");
- JSValue result = toJS(state, castedThis->globalObject(), impl.domStringListFunction(*values, ec));
</del><ins>+ auto values = convert<IDLInterface<DOMStringList>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "values", "TestObject", "domStringListFunction", "DOMStringList"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+ JSValue result = toJS<IDLInterface<DOMStringList>>(*state, *castedThis->globalObject(), impl.domStringListFunction(*values, ec));
</ins><span class="cx">
</span><span class="cx"> setDOMException(state, throwScope, ec);
</span><span class="cx"> return JSValue::encode(result);
</span><span class="lines">@@ -7562,7 +7462,7 @@
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto elementId = AtomicString(state->uncheckedArgument(0).toString(state)->toExistingAtomicString(state));
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), impl.getElementById(WTFMove(elementId)));
</del><ins>+ JSValue result = toJS<IDLNullable<IDLInterface<Element>>>(*state, *castedThis->globalObject(), impl.getElementById(WTFMove(elementId)));
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -7579,7 +7479,7 @@
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), BindingSecurity::checkSecurityForNode(*state, impl.getSVGDocument(ec)));
</del><ins>+ JSValue result = toJS<IDLInterface<SVGDocument>>(*state, *castedThis->globalObject(), BindingSecurity::checkSecurityForNode(*state, impl.getSVGDocument(ec)));
</ins><span class="cx">
</span><span class="cx"> setDOMException(state, throwScope, ec);
</span><span class="cx"> return JSValue::encode(result);
</span><span class="lines">@@ -7599,9 +7499,8 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto value = JSTestNode::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!value))
- return throwArgumentTypeError(*state, throwScope, 0, "value", "TestObject", "convert1", "TestNode");
</del><ins>+ auto value = convert<IDLInterface<TestNode>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "value", "TestObject", "convert1", "TestNode"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.convert1(*value);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -7620,12 +7519,8 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- TestNode* value = nullptr;
- if (!state->uncheckedArgument(0).isUndefinedOrNull()) {
- value = JSTestNode::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!value))
- return throwArgumentTypeError(*state, throwScope, 0, "value", "TestObject", "convert2", "TestNode");
- }
</del><ins>+ auto value = convert<IDLNullable<IDLInterface<TestNode>>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "value", "TestObject", "convert2", "TestNode"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.convert2(WTFMove(value));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -7682,7 +7577,7 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), SVGPropertyTearOff<SVGPoint>::create(impl.mutablePointFunction()));
</del><ins>+ JSValue result = toJS<IDLInterface<SVGPropertyTearOff<SVGPoint>>>(*state, *castedThis->globalObject(), SVGPropertyTearOff<SVGPoint>::create(impl.mutablePointFunction()));
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -7698,7 +7593,7 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), SVGPropertyTearOff<SVGPoint>::create(impl.immutablePointFunction()));
</del><ins>+ JSValue result = toJS<IDLInterface<SVGPropertyTearOff<SVGPoint>>>(*state, *castedThis->globalObject(), SVGPropertyTearOff<SVGPoint>::create(impl.immutablePointFunction()));
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -7776,9 +7671,8 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto head = JSNode::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!head))
- return throwArgumentTypeError(*state, throwScope, 0, "head", "TestObject", "variadicNodeMethod", "Node");
</del><ins>+ auto head = convert<IDLInterface<Node>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "head", "TestObject", "variadicNodeMethod", "Node"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> auto tail = convertVariadicArguments<IDLInterface<Node>>(*state, 1);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.variadicNodeMethod(*head, WTFMove(tail.arguments.value()));
</span><span class="lines">@@ -7983,9 +7877,8 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto request = JSFetchRequest::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!request))
- return throwArgumentTypeError(*state, throwScope, 0, "request", "TestObject", "testPromiseOverloadedFunction", "FetchRequest");
</del><ins>+ auto request = convert<IDLInterface<FetchRequest>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "request", "TestObject", "testPromiseOverloadedFunction", "FetchRequest"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.testPromiseOverloadedFunction(*request, WTFMove(promise));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -75,10 +75,8 @@
</span><span class="cx"> ASSERT(castedThis);
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto arrayBuffer = toUnsharedArrayBuffer(state->uncheckedArgument(0));
</del><ins>+ auto arrayBuffer = convert<IDLInterface<ArrayBuffer>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "arrayBuffer", "TestOverloadedConstructors", nullptr, "ArrayBuffer"); });
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- if (UNLIKELY(!arrayBuffer))
- return throwArgumentTypeError(*state, throwScope, 0, "arrayBuffer", "TestOverloadedConstructors", nullptr, "ArrayBuffer");
</del><span class="cx"> auto object = TestOverloadedConstructors::create(*arrayBuffer);
</span><span class="cx"> return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
</span><span class="cx"> }
</span><span class="lines">@@ -92,10 +90,8 @@
</span><span class="cx"> ASSERT(castedThis);
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto arrayBufferView = toUnsharedArrayBufferView(state->uncheckedArgument(0));
</del><ins>+ auto arrayBufferView = convert<IDLInterface<ArrayBufferView>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "arrayBufferView", "TestOverloadedConstructors", nullptr, "ArrayBufferView"); });
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- if (UNLIKELY(!arrayBufferView))
- return throwArgumentTypeError(*state, throwScope, 0, "arrayBufferView", "TestOverloadedConstructors", nullptr, "ArrayBufferView");
</del><span class="cx"> auto object = TestOverloadedConstructors::create(*arrayBufferView);
</span><span class="cx"> return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
</span><span class="cx"> }
</span><span class="lines">@@ -109,9 +105,8 @@
</span><span class="cx"> ASSERT(castedThis);
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto blob = JSBlob::toWrapped(state->uncheckedArgument(0));
- if (UNLIKELY(!blob))
- return throwArgumentTypeError(*state, throwScope, 0, "blob", "TestOverloadedConstructors", nullptr, "Blob");
</del><ins>+ auto blob = convert<IDLInterface<Blob>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "blob", "TestOverloadedConstructors", nullptr, "Blob"); });
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> auto object = TestOverloadedConstructors::create(*blob);
</span><span class="cx"> return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -217,7 +217,7 @@
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto name = convert<IDLDOMString>(*state, state->uncheckedArgument(0), StringConversionConfiguration::Normal);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), impl.namedItem(WTFMove(name)));
</del><ins>+ JSValue result = toJS<IDLInterface<Node>>(*state, *castedThis->globalObject(), impl.namedItem(WTFMove(name)));
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestSerializationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -192,7 +192,7 @@
</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 = toJS(&state, thisObject.globalObject(), impl.thirdUnserializableAttribute());
</del><ins>+ JSValue result = toJS<IDLInterface<TestNode>>(state, *thisObject.globalObject(), impl.thirdUnserializableAttribute());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -302,11 +302,8 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = thisObject.wrapped();
</span><del>- auto nativeValue = JSTestNode::toWrapped(value);
- if (UNLIKELY(!nativeValue)) {
- throwAttributeTypeError(state, throwScope, "TestSerialization", "thirdUnserializableAttribute", "TestNode");
- return false;
- }
</del><ins>+ auto nativeValue = convert<IDLInterface<TestNode>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestSerialization", "thirdUnserializableAttribute", "TestNode"); });
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> impl.setThirdUnserializableAttribute(*nativeValue);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (208307 => 208308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-11-02 22:12:19 UTC (rev 208307)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-11-02 22:15:14 UTC (rev 208308)
</span><span class="lines">@@ -686,7 +686,7 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), SVGPropertyTearOff<SVGPoint>::create(impl.immutablePointFunction()));
</del><ins>+ JSValue result = toJS<IDLInterface<SVGPropertyTearOff<SVGPoint>>>(*state, *castedThis->globalObject(), SVGPropertyTearOff<SVGPoint>::create(impl.immutablePointFunction()));
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>