<!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>[207150] 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/207150">207150</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-10-11 10:33:45 -0700 (Tue, 11 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Use IDLTypes in more places
https://bugs.webkit.org/show_bug.cgi?id=163247
Reviewed by Darin Adler.
Source/WebCore:
Switch JS -> Native type conversions to use convert<IDLType>(...) rather
than convert<NativeType>(...). This allows us to differentiate things like
conversion from JSValue to DOMString vs. JSValue to USVString which have different
rules.
* bindings/generic/IDLTypes.h:
Add predicate for integer types.
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyPathFromValue):
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
(WebCore::JSApplePaySession::completeShippingContactSelection):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::createAesKeyGenParams):
(WebCore::createRsaKeyGenParams):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::getCSSCanvasContext):
* bindings/js/JSMockContentFilterSettingsCustom.cpp:
(WebCore::JSMockContentFilterSettings::setDecisionPoint):
(WebCore::toDecision):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):
Switch to new convert<IDLType> style.
* bindings/js/JSDOMBinding.h:
(WebCore::toRefPtrNativeArray): Deleted.
(WebCore::toNativeArray): Deleted.
These can now be called as convert<IDLSequence<IDLInterface<T>>> and convert<IDLType> respectively.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLNullable<T>>::convert):
(WebCore::Converter<IDLBoolean>::convert):
(WebCore::Converter<IDLInterface<T>>::convert):
(WebCore::Converter<IDLByte>::convert):
(WebCore::Converter<IDLOctet>::convert):
(WebCore::Converter<IDLShort>::convert):
(WebCore::Converter<IDLUnsignedShort>::convert):
(WebCore::Converter<IDLLong>::convert):
(WebCore::Converter<IDLUnsignedLong>::convert):
(WebCore::Converter<IDLLongLong>::convert):
(WebCore::Converter<IDLUnsignedLongLong>::convert):
(WebCore::Converter<IDLFloat>::convert):
(WebCore::Converter<IDLUnrestrictedFloat>::convert):
(WebCore::Converter<IDLDouble>::convert):
(WebCore::Converter<IDLUnrestrictedDouble>::convert):
(WebCore::Converter<IDLDOMString>::convert):
(WebCore::Converter<IDLUSVString>::convert):
(WebCore::Detail::ArrayConverter::convert):
(WebCore::Converter<IDLSequence<T>>::convert):
(WebCore::Converter<IDLFrozenArray<T>>::convert):
(WebCore::Converter<IDLDictionary<T>>::convert):
(WebCore::Converter<IDLEnumeration<T>>::convert):
(WebCore::Detail::VariadicConverterBase::convert):
(WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert):
(WebCore::convertVariadicArguments):
(WebCore::convertWrapperType): Deleted.
(WebCore::convertWrapperTypeSequence): Deleted.
(WebCore::Converter<bool>::convert): Deleted.
(WebCore::Converter<String>::convert): Deleted.
(WebCore::Converter<Vector<T>>::convert): Deleted.
(WebCore::Converter<int8_t>::convert): Deleted.
(WebCore::Converter<uint8_t>::convert): Deleted.
(WebCore::Converter<int16_t>::convert): Deleted.
(WebCore::Converter<uint16_t>::convert): Deleted.
(WebCore::Converter<int32_t>::convert): Deleted.
(WebCore::Converter<uint32_t>::convert): Deleted.
(WebCore::Converter<int64_t>::convert): Deleted.
(WebCore::Converter<uint64_t>::convert): Deleted.
Switch Converter to be specialized on IDLTypes. Add support for IDLNullable, IDLSequence, and IDLFrozenArray.
* bindings/scripts/CodeGenerator.pm:
(GetFlattenedMemberTypes): Deleted.
(GetNumberOfNullableMemberTypes): Deleted.
(GetIDLUnionMemberTypes): Deleted.
(GetBaseIDLType): Deleted.
(GetIDLType): Deleted.
Move IDLType conversion logic to CodeGeneratorJS so it can use GetEnumerationClassName and GetDictionaryClassName.
* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludesForIDLType):
Add support for sequences, FrozenArrays and external dictionaries.
(GenerateEnumerationsImplementationContent):
(GenerateEnumerationsHeaderContent):
Change the name of parse<enum> and convert<enum> to parseEnumeration<enum> and convertEnumeration<enum>
to make them more consistent with dictionary conversion specialization and not interfere with the convert
function specialization.
(GenerateDictionaryImplementationContent):
Simplify by using convert<IDLType>.
(GetFlattenedMemberTypes):
(GetNumberOfNullableMemberTypes):
(GetIDLUnionMemberTypes):
(GetBaseIDLType):
(GetIDLType):
Moved from CodeGenerator.pm
(IsHandledByDOMConvert):
(JSValueToNative):
Start switching JSValueToNative over to using convert<IDLType>. Use IsHandledByDOMConvert as a predicate
for what is supported.
* bindings/scripts/IDLParser.pm:
(applyTypedefs):
(cloneType):
(applyTypedefsForSignature):
(parseTypedef):
(parseOperationOrIterator):
(parseSpecialOperation):
Make typedefs work with aggregate types (unions, sequences and FrozenArrays).
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Update test results.
* bindings/scripts/test/TestTypedefs.idl:
Add additional tests for typedefs that use unions and sequences.
* testing/InternalSettings.idl:
Change the name of a parameter to avoid a name collision.
LayoutTests:
* fast/events/constructors/message-event-constructor-expected.txt:
* fast/mediastream/MediaStreamConstructor-expected.txt:
Update tests for different error message.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfasteventsconstructorsmessageeventconstructorexpectedtxt">trunk/LayoutTests/fast/events/constructors/message-event-constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamMediaStreamConstructorexpectedtxt">trunk/LayoutTests/fast/mediastream/MediaStreamConstructor-expected.txt</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="#trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSApplePaySessionCustomcpp">trunk/Source/WebCore/bindings/js/JSApplePaySessionCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCryptoAlgorithmDictionarycpp">trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCustomElementRegistryCustomcpp">trunk/Source/WebCore/bindings/js/JSCustomElementRegistryCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMConverth">trunk/Source/WebCore/bindings/js/JSDOMConvert.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDocumentCustomcpp">trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMockContentFilterSettingsCustomcpp">trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeFilterCustomcpp">trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorpm">trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLParserpm">trunk/Source/WebCore/bindings/scripts/IDLParser.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsWithSequencecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestStandaloneDictionarycpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestTypedefsidl">trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingsidl">trunk/Source/WebCore/testing/InternalSettings.idl</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/LayoutTests/ChangeLog        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-10-10 Sam Weinig <sam@webkit.org>
+
+ Use IDLTypes in more places
+ https://bugs.webkit.org/show_bug.cgi?id=163247
+
+ Reviewed by Darin Adler.
+
+ * fast/events/constructors/message-event-constructor-expected.txt:
+ * fast/mediastream/MediaStreamConstructor-expected.txt:
+ Update tests for different error message.
+
</ins><span class="cx"> 2016-10-11 Antoine Quint <graouts@apple.com>
</span><span class="cx">
</span><span class="cx"> [mac] LayoutTest media/modern-media-controls/play-pause-button/play-pause-button.html is a flaky failure
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsconstructorsmessageeventconstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/constructors/message-event-constructor-expected.txt (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/constructors/message-event-constructor-expected.txt        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/LayoutTests/fast/events/constructors/message-event-constructor-expected.txt        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx"> PASS new MessageEvent('eventType', { ports: [channel.port1, channel.port2, channel2.port1] }).ports[2] is channel2.port1
</span><span class="cx"> PASS new MessageEvent('eventType', { ports: [] }).ports is []
</span><span class="cx"> PASS new MessageEvent('eventType', { ports: undefined }).ports is []
</span><del>-PASS new MessageEvent('eventType', { ports: [1, 2, 3] }).ports[2] threw exception TypeError: Invalid Array element type.
</del><ins>+PASS new MessageEvent('eventType', { ports: [1, 2, 3] }).ports[2] threw exception TypeError: Type error.
</ins><span class="cx"> PASS new MessageEvent('eventType', { ports: test_object }).ports threw exception TypeError: Type error.
</span><span class="cx"> PASS new MessageEvent('eventType', { ports: document }).ports threw exception TypeError: Type error.
</span><span class="cx"> PASS new MessageEvent('eventType', { ports: null }).ports threw exception TypeError: Value is not a sequence.
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamMediaStreamConstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/mediastream/MediaStreamConstructor-expected.txt (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/MediaStreamConstructor-expected.txt        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/LayoutTests/fast/mediastream/MediaStreamConstructor-expected.txt        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -9,10 +9,10 @@
</span><span class="cx"> PASS typeof MediaStream === 'function' is true
</span><span class="cx"> PASS checkIdAttribute(localStream.id) is true
</span><span class="cx"> PASS new MediaStream(document) threw exception TypeError: Type error.
</span><del>-PASS new MediaStream([document]) threw exception TypeError: Invalid Array element type.
-PASS new MediaStream([stream.getAudioTracks()[0], document]) threw exception TypeError: Invalid Array element type.
-PASS new MediaStream([null]) threw exception TypeError: Invalid Array element type.
-PASS new MediaStream([undefined]) threw exception TypeError: Invalid Array element type.
</del><ins>+PASS new MediaStream([document]) threw exception TypeError: Type error.
+PASS new MediaStream([stream.getAudioTracks()[0], document]) threw exception TypeError: Type error.
+PASS new MediaStream([null]) threw exception TypeError: Type error.
+PASS new MediaStream([undefined]) threw exception TypeError: Type error.
</ins><span class="cx"> PASS new MediaStream(null) threw exception TypeError: Type error.
</span><span class="cx"> PASS new MediaStream(undefined) threw exception TypeError: Type error.
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/ChangeLog        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -1,3 +1,140 @@
</span><ins>+2016-10-10 Sam Weinig <sam@webkit.org>
+
+ Use IDLTypes in more places
+ https://bugs.webkit.org/show_bug.cgi?id=163247
+
+ Reviewed by Darin Adler.
+
+ Switch JS -> Native type conversions to use convert<IDLType>(...) rather
+ than convert<NativeType>(...). This allows us to differentiate things like
+ conversion from JSValue to DOMString vs. JSValue to USVString which have different
+ rules.
+
+ * bindings/generic/IDLTypes.h:
+ Add predicate for integer types.
+
+ * bindings/js/IDBBindingUtilities.cpp:
+ (WebCore::idbKeyPathFromValue):
+ * bindings/js/JSApplePaySessionCustom.cpp:
+ (WebCore::JSApplePaySession::completeShippingMethodSelection):
+ (WebCore::JSApplePaySession::completeShippingContactSelection):
+ * bindings/js/JSCryptoAlgorithmDictionary.cpp:
+ (WebCore::createAesKeyGenParams):
+ (WebCore::createRsaKeyGenParams):
+ * bindings/js/JSCustomElementRegistryCustom.cpp:
+ (WebCore::JSCustomElementRegistry::define):
+ * bindings/js/JSDocumentCustom.cpp:
+ (WebCore::JSDocument::getCSSCanvasContext):
+ * bindings/js/JSMockContentFilterSettingsCustom.cpp:
+ (WebCore::JSMockContentFilterSettings::setDecisionPoint):
+ (WebCore::toDecision):
+ * bindings/js/JSNodeFilterCustom.cpp:
+ (WebCore::JSNodeFilter::acceptNode):
+ Switch to new convert<IDLType> style.
+
+ * bindings/js/JSDOMBinding.h:
+ (WebCore::toRefPtrNativeArray): Deleted.
+ (WebCore::toNativeArray): Deleted.
+ These can now be called as convert<IDLSequence<IDLInterface<T>>> and convert<IDLType> respectively.
+
+ * bindings/js/JSDOMConvert.h:
+ (WebCore::Converter<IDLNullable<T>>::convert):
+ (WebCore::Converter<IDLBoolean>::convert):
+ (WebCore::Converter<IDLInterface<T>>::convert):
+ (WebCore::Converter<IDLByte>::convert):
+ (WebCore::Converter<IDLOctet>::convert):
+ (WebCore::Converter<IDLShort>::convert):
+ (WebCore::Converter<IDLUnsignedShort>::convert):
+ (WebCore::Converter<IDLLong>::convert):
+ (WebCore::Converter<IDLUnsignedLong>::convert):
+ (WebCore::Converter<IDLLongLong>::convert):
+ (WebCore::Converter<IDLUnsignedLongLong>::convert):
+ (WebCore::Converter<IDLFloat>::convert):
+ (WebCore::Converter<IDLUnrestrictedFloat>::convert):
+ (WebCore::Converter<IDLDouble>::convert):
+ (WebCore::Converter<IDLUnrestrictedDouble>::convert):
+ (WebCore::Converter<IDLDOMString>::convert):
+ (WebCore::Converter<IDLUSVString>::convert):
+ (WebCore::Detail::ArrayConverter::convert):
+ (WebCore::Converter<IDLSequence<T>>::convert):
+ (WebCore::Converter<IDLFrozenArray<T>>::convert):
+ (WebCore::Converter<IDLDictionary<T>>::convert):
+ (WebCore::Converter<IDLEnumeration<T>>::convert):
+ (WebCore::Detail::VariadicConverterBase::convert):
+ (WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert):
+ (WebCore::convertVariadicArguments):
+ (WebCore::convertWrapperType): Deleted.
+ (WebCore::convertWrapperTypeSequence): Deleted.
+ (WebCore::Converter<bool>::convert): Deleted.
+ (WebCore::Converter<String>::convert): Deleted.
+ (WebCore::Converter<Vector<T>>::convert): Deleted.
+ (WebCore::Converter<int8_t>::convert): Deleted.
+ (WebCore::Converter<uint8_t>::convert): Deleted.
+ (WebCore::Converter<int16_t>::convert): Deleted.
+ (WebCore::Converter<uint16_t>::convert): Deleted.
+ (WebCore::Converter<int32_t>::convert): Deleted.
+ (WebCore::Converter<uint32_t>::convert): Deleted.
+ (WebCore::Converter<int64_t>::convert): Deleted.
+ (WebCore::Converter<uint64_t>::convert): Deleted.
+ Switch Converter to be specialized on IDLTypes. Add support for IDLNullable, IDLSequence, and IDLFrozenArray.
+
+ * bindings/scripts/CodeGenerator.pm:
+ (GetFlattenedMemberTypes): Deleted.
+ (GetNumberOfNullableMemberTypes): Deleted.
+ (GetIDLUnionMemberTypes): Deleted.
+ (GetBaseIDLType): Deleted.
+ (GetIDLType): Deleted.
+ Move IDLType conversion logic to CodeGeneratorJS so it can use GetEnumerationClassName and GetDictionaryClassName.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (AddToImplIncludesForIDLType):
+ Add support for sequences, FrozenArrays and external dictionaries.
+
+ (GenerateEnumerationsImplementationContent):
+ (GenerateEnumerationsHeaderContent):
+ Change the name of parse<enum> and convert<enum> to parseEnumeration<enum> and convertEnumeration<enum>
+ to make them more consistent with dictionary conversion specialization and not interfere with the convert
+ function specialization.
+
+ (GenerateDictionaryImplementationContent):
+ Simplify by using convert<IDLType>.
+
+ (GetFlattenedMemberTypes):
+ (GetNumberOfNullableMemberTypes):
+ (GetIDLUnionMemberTypes):
+ (GetBaseIDLType):
+ (GetIDLType):
+ Moved from CodeGenerator.pm
+
+ (IsHandledByDOMConvert):
+ (JSValueToNative):
+ Start switching JSValueToNative over to using convert<IDLType>. Use IsHandledByDOMConvert as a predicate
+ for what is supported.
+
+ * bindings/scripts/IDLParser.pm:
+ (applyTypedefs):
+ (cloneType):
+ (applyTypedefsForSignature):
+ (parseTypedef):
+ (parseOperationOrIterator):
+ (parseSpecialOperation):
+ Make typedefs work with aggregate types (unions, sequences and FrozenArrays).
+
+ * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+ * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ * bindings/scripts/test/JS/JSTestObj.h:
+ * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
+ * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
+ * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+ Update test results.
+
+ * bindings/scripts/test/TestTypedefs.idl:
+ Add additional tests for typedefs that use unions and sequences.
+
+ * testing/InternalSettings.idl:
+ Change the name of a parameter to avoid a name collision.
+
</ins><span class="cx"> 2016-10-11 Konstantin Tokarev <annulen@yandex.ru>
</span><span class="cx">
</span><span class="cx"> Fixed compilation with !ENABLE(SVG_FONTS)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgenericIDLTypesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/generic/IDLTypes.h (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/generic/IDLTypes.h        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/generic/IDLTypes.h        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -130,4 +130,7 @@
</span><span class="cx"> template <typename T>
</span><span class="cx"> struct IsIDLNumber : public std::integral_constant<bool, WTF::IsBaseOfTemplate<IDLNumber, T>::value> { };
</span><span class="cx">
</span><ins>+template <typename T>
+struct IsIDLInteger : public std::integral_constant<bool, WTF::IsBaseOfTemplate<IDLInteger, T>::value> { };
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include "IDBValue.h"
</span><span class="cx"> #include "IndexKey.h"
</span><span class="cx"> #include "JSDOMBinding.h"
</span><ins>+#include "JSDOMConvert.h"
</ins><span class="cx"> #include "JSDOMStringList.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "ScriptExecutionContext.h"
</span><span class="lines">@@ -178,7 +179,7 @@
</span><span class="cx"> {
</span><span class="cx"> IDBKeyPath keyPath;
</span><span class="cx"> if (isJSArray(keyPathValue))
</span><del>- keyPath = IDBKeyPath(toNativeArray<String>(exec, keyPathValue));
</del><ins>+ keyPath = IDBKeyPath(convert<IDLSequence<IDLDOMString>>(exec, keyPathValue));
</ins><span class="cx"> else
</span><span class="cx"> keyPath = IDBKeyPath(keyPathValue.toWTFString(&exec));
</span><span class="cx"> return keyPath;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSApplePaySessionCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSApplePaySessionCustom.cpp (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSApplePaySessionCustom.cpp        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/js/JSApplePaySessionCustom.cpp        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> if (UNLIKELY(state.argumentCount() < 3))
</span><span class="cx"> return JSValue::decode(throwVMError(&state, scope, createNotEnoughArgumentsError(&state)));
</span><span class="cx">
</span><del>- uint16_t status = convert<uint16_t>(state, state.argument(0), NormalConversion);
</del><ins>+ uint16_t status = convert<IDLUnsignedShort>(state, state.argument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">
</span><span class="cx"> Dictionary newTotal = { &state, state.argument(1) };
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx"> if (UNLIKELY(state.argumentCount() < 4))
</span><span class="cx"> return JSValue::decode(throwVMError(&state, scope, createNotEnoughArgumentsError(&state)));
</span><span class="cx">
</span><del>- uint16_t status = convert<uint16_t>(state, state.argument(0), NormalConversion);
</del><ins>+ uint16_t status = convert<IDLUnsignedShort>(state, state.argument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">
</span><span class="cx"> ArrayValue newShippingMethods { &state, state.argument(1) };
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCryptoAlgorithmDictionarycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -169,7 +169,7 @@
</span><span class="cx"> JSValue lengthValue = getProperty(&state, value.getObject(), "length");
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, nullptr);
</span><span class="cx">
</span><del>- result->length = convert<uint16_t>(state, lengthValue, EnforceRange);
</del><ins>+ result->length = convert<IDLUnsignedShort>(state, lengthValue, EnforceRange);
</ins><span class="cx">
</span><span class="cx"> return WTFMove(result);
</span><span class="cx"> }
</span><span class="lines">@@ -236,7 +236,7 @@
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, nullptr);
</span><span class="cx">
</span><span class="cx"> // FIXME: Why no EnforceRange? Filed as <https://www.w3.org/Bugs/Public/show_bug.cgi?id=23779>.
</span><del>- result->modulusLength = convert<uint32_t>(state, modulusLengthValue, NormalConversion);
</del><ins>+ result->modulusLength = convert<IDLUnsignedLong>(state, modulusLengthValue, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(scope, nullptr);
</span><span class="cx">
</span><span class="cx"> JSValue publicExponentValue = getProperty(&state, value.getObject(), "publicExponent");
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCustomElementRegistryCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCustomElementRegistryCustom.cpp (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCustomElementRegistryCustom.cpp        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/js/JSCustomElementRegistryCustom.cpp        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx"> auto observedAttributesValue = constructor->get(&state, Identifier::fromString(&state, "observedAttributes"));
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx"> if (!observedAttributesValue.isUndefined()) {
</span><del>- auto observedAttributes = convert<Vector<String>>(state, observedAttributesValue);
</del><ins>+ auto observedAttributes = convert<IDLSequence<IDLDOMString>>(state, observedAttributesValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx"> elementInterface->setAttributeChangedCallback(attributeChangedCallback, observedAttributes);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -298,8 +298,6 @@
</span><span class="cx"> RefPtr<JSC::Float64Array> toFloat64Array(JSC::JSValue);
</span><span class="cx">
</span><span class="cx"> template<typename T, typename JSType> Vector<Ref<T>> toRefNativeArray(JSC::ExecState&, JSC::JSValue);
</span><del>-template<typename T, typename JSType, typename VectorType = Vector<RefPtr<T>>> VectorType toRefPtrNativeArray(JSC::ExecState&, JSC::JSValue);
-template<typename T> Vector<T> toNativeArray(JSC::ExecState&, JSC::JSValue);
</del><span class="cx"> bool hasIteratorMethod(JSC::ExecState&, JSC::JSValue);
</span><span class="cx">
</span><span class="cx"> bool shouldAllowAccessToNode(JSC::ExecState*, Node*);
</span><span class="lines">@@ -839,51 +837,6 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<typename T, typename JST, typename VectorType> VectorType toRefPtrNativeArray(JSC::ExecState& state, JSC::JSValue value)
-{
- JSC::VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- if (!value.isObject()) {
- throwSequenceTypeError(state, scope);
- return { };
- }
-
- VectorType result;
- forEachInIterable(&state, value, [&result](JSC::VM& vm, JSC::ExecState* state, JSC::JSValue jsValue) {
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- if (jsValue.inherits(JST::info()))
- result.append(JST::toWrapped(jsValue));
- else
- throwArrayElementTypeError(*state, scope);
- });
- return result;
-}
-
-template<typename T> Vector<T> toNativeArray(JSC::ExecState& exec, JSC::JSValue value)
-{
- JSC::VM& vm = exec.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- if (!value.isObject()) {
- throwSequenceTypeError(exec, scope);
- return Vector<T>();
- }
-
- Vector<T> result;
- forEachInIterable(&exec, value, [&result](JSC::VM& vm, JSC::ExecState* state, JSC::JSValue jsValue) {
- auto scope = DECLARE_THROW_SCOPE(vm);
- T convertedValue;
- bool success = NativeValueTraits<T>::nativeValue(*state, jsValue, convertedValue);
- ASSERT_UNUSED(scope, scope.exception() || success);
- if (!success)
- return;
- result.append(convertedValue);
- });
- return result;
-}
-
</del><span class="cx"> inline String propertyNameToString(JSC::PropertyName propertyName)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!propertyName.isSymbol());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMConverth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMConvert.h (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -30,31 +30,27 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-enum class ShouldAllowNonFinite { No, Yes };
</del><ins>+template<typename T> struct Converter;
</ins><span class="cx">
</span><del>-template<typename T, typename U = T> using EnableIfIntegralType = typename std::enable_if<std::is_integral<T>::value, U>::type;
-template<typename T, typename U = T> using EnableIfFloatingPointType = typename std::enable_if<std::is_floating_point<T>::value, U>::type;
</del><ins>+template<typename T, typename U = T> using EnableIfIntegralType = typename std::enable_if<IsIDLInteger<T>::value, typename Converter<U>::ReturnType>::type;
+template<typename T, typename U = T> using EnableIfNotIntegralType = typename std::enable_if<!IsIDLInteger<T>::value, typename Converter<U>::ReturnType>::type;
</ins><span class="cx">
</span><del>-template<typename T, typename Enable = void> struct Converter;
</del><ins>+template<typename T> EnableIfNotIntegralType<T> convert(JSC::ExecState&, JSC::JSValue);
</ins><span class="cx">
</span><del>-template<typename T> T convert(JSC::ExecState&, JSC::JSValue);
-template<typename T> EnableIfIntegralType<T> convert(JSC::ExecState&, JSC::JSValue, IntegerConversionConfiguration);
-template<typename T> EnableIfIntegralType<Optional<T>> convertNullable(JSC::ExecState&, JSC::JSValue, IntegerConversionConfiguration);
-template<typename T> EnableIfFloatingPointType<T> convert(JSC::ExecState&, JSC::JSValue, ShouldAllowNonFinite);
</del><ins>+// Specialization for integer types, allowing passing of a conversion flag.
+template<typename T> EnableIfIntegralType<T> convert(JSC::ExecState&, JSC::JSValue, IntegerConversionConfiguration = NormalConversion);
</ins><span class="cx">
</span><ins>+// Specialized by generated code for IDL dictionary conversion.
</ins><span class="cx"> template<typename T> Optional<T> convertDictionary(JSC::ExecState&, JSC::JSValue);
</span><span class="cx">
</span><del>-// Used for IDL enumerations.
-template<typename T> Optional<T> parse(JSC::ExecState&, JSC::JSValue);
</del><ins>+// Specialized by generated code for IDL enumeration conversion.
+template<typename T> Optional<T> parseEnumeration(JSC::ExecState&, JSC::JSValue);
+template<typename T> T convertEnumeration(JSC::ExecState&, JSC::JSValue);
</ins><span class="cx"> template<typename T> const char* expectedEnumerationValues();
</span><span class="cx">
</span><del>-enum class IsNullable { No, Yes };
-template<typename T, typename JST> T* convertWrapperType(JSC::ExecState&, JSC::JSValue, IsNullable);
-template<typename T, typename JST, typename VectorType> VectorType convertWrapperTypeSequence(JSC::ExecState&, JSC::JSValue);
-
</del><span class="cx"> // This is where the implementation of the things declared above begins:
</span><span class="cx">
</span><del>-template<typename T> T convert(JSC::ExecState& state, JSC::JSValue value)
</del><ins>+template<typename T> inline EnableIfNotIntegralType<T> convert(JSC::ExecState& state, JSC::JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> return Converter<T>::convert(state, value);
</span><span class="cx"> }
</span><span class="lines">@@ -64,39 +60,43 @@
</span><span class="cx"> return Converter<T>::convert(state, value, configuration);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<typename T> inline EnableIfIntegralType<T, Optional<T>> convertNullable(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration)
-{
- return value.isUndefinedOrNull() ? Optional<T>() : Converter<T>::convert(state, value, configuration);
-}
</del><ins>+template<typename T> struct DefaultConverter {
+ using ReturnType = typename T::ImplementationType;
+};
</ins><span class="cx">
</span><del>-template<typename T> inline EnableIfFloatingPointType<T> convert(JSC::ExecState& state, JSC::JSValue value, ShouldAllowNonFinite allow)
-{
- return Converter<T>::convert(state, value, allow);
-}
</del><ins>+template<typename T> struct Converter : DefaultConverter<T> {
+};
</ins><span class="cx">
</span><del>-template<typename T, typename JST> inline T* convertWrapperType(JSC::ExecState& state, JSC::JSValue value, IsNullable isNullable)
-{
- JSC::VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
- T* object = JST::toWrapped(value);
- if (!object && (isNullable == IsNullable::No || !value.isUndefinedOrNull()))
- throwTypeError(&state, scope);
- return object;
-}
</del><ins>+// MARK: -
+// MARK: Nullable type
</ins><span class="cx">
</span><del>-template<typename T, typename JST, typename VectorType> inline VectorType convertWrapperTypeSequence(JSC::ExecState& state, JSC::JSValue value)
-{
- return toRefPtrNativeArray<T, JST, VectorType>(state, value);
-}
</del><ins>+template<typename T> struct Converter<IDLNullable<T>> : DefaultConverter<IDLNullable<T>> {
+ using ReturnType = typename IDLNullable<T>::ImplementationType;
+
+ static ReturnType convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ // 1. If Type(V) is not Object, and the conversion to an IDL value is being performed
+ // due to V being assigned to an attribute whose type is a nullable callback function
+ // that is annotated with [TreatNonObjectAsNull], then return the IDL nullable type T?
+ // value null.
+ //
+ // NOTE: Handled elsewhere.
</ins><span class="cx">
</span><del>-template<typename T> struct DefaultConverter {
- using OptionalValue = Optional<T>;
-};
</del><ins>+ // 2. Otherwise, if V is null or undefined, then return the IDL nullable type T? value null.
+ if (value.isUndefinedOrNull()) {
+ // FIXME: Should we make it part of the IDLType to provide the null value?
+ return ReturnType();
+ }
</ins><span class="cx">
</span><del>-template<typename T, typename Enable> struct Converter : DefaultConverter<T> {
</del><ins>+ // 3. Otherwise, return the result of converting V using the rules for the inner IDL type T.
+ return Converter<T>::convert(state, value);
+ }
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-template<> struct Converter<bool> : DefaultConverter<bool> {
</del><ins>+// MARK: -
+// MARK: Boolean type
+
+template<> struct Converter<IDLBoolean> : DefaultConverter<IDLBoolean> {
</ins><span class="cx"> static bool convert(JSC::ExecState& state, JSC::JSValue value)
</span><span class="cx"> {
</span><span class="cx"> return value.toBoolean(&state);
</span><span class="lines">@@ -103,39 +103,27 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> struct Converter<String> : DefaultConverter<String> {
- using OptionalValue = String; // Use null string to mean an optional value was not present.
- static String convert(JSC::ExecState& state, JSC::JSValue value)
- {
- return value.toWTFString(&state);
- }
-};
</del><ins>+// MARK: -
+// MARK: Interface type
</ins><span class="cx">
</span><del>-template<> struct Converter<IDLDOMString> : DefaultConverter<String> {
- using OptionalValue = String; // Use null string to mean an optional value was not present.
- static String convert(JSC::ExecState& state, JSC::JSValue value)
- {
- return value.toWTFString(&state);
- }
-};
</del><ins>+template<typename T> struct Converter<IDLInterface<T>> : DefaultConverter<IDLInterface<T>> {
+ using WrapperType = typename JSDOMWrapperConverterTraits<T>::WrapperClass;
</ins><span class="cx">
</span><del>-template<> struct Converter<IDLUSVString> : DefaultConverter<String> {
- using OptionalValue = String; // Use null string to mean an optional value was not present.
- static String convert(JSC::ExecState& state, JSC::JSValue value)
- {
- return valueToUSVString(&state, value);
- }
-};
-
-template<typename T> struct Converter<IDLInterface<T>> : DefaultConverter<T*> {
</del><span class="cx"> static T* convert(JSC::ExecState& state, JSC::JSValue value)
</span><span class="cx"> {
</span><del>- return convertWrapperType<T, typename JSDOMWrapperConverterTraits<T>::WrapperClass>(state, value, IsNullable::No);
</del><ins>+ JSC::VM& vm = state.vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ T* object = WrapperType::toWrapped(value);
+ if (!object)
+ throwTypeError(&state, scope);
+ return object;
</ins><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> struct Converter<JSC::JSValue> : DefaultConverter<JSC::JSValue> {
- using OptionalValue = JSC::JSValue; // Use jsUndefined() to mean an optional value was not present.
</del><ins>+// MARK: -
+// MARK: Any type
+
+template<> struct Converter<IDLAny> : DefaultConverter<IDLAny> {
</ins><span class="cx"> static JSC::JSValue convert(JSC::ExecState&, JSC::JSValue value)
</span><span class="cx"> {
</span><span class="cx"> return value;
</span><span class="lines">@@ -142,15 +130,11 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<typename T> struct Converter<Vector<T>> : DefaultConverter<Vector<T>> {
- static Vector<T> convert(JSC::ExecState& state, JSC::JSValue value)
- {
- return toNativeArray<T>(state, value);
- }
-};
</del><ins>+// MARK: -
+// MARK: Integer types
</ins><span class="cx">
</span><del>-template<> struct Converter<int8_t> : DefaultConverter<int8_t> {
- static int8_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+template<> struct Converter<IDLByte> : DefaultConverter<IDLByte> {
+ static int8_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration = NormalConversion)
</ins><span class="cx"> {
</span><span class="cx"> switch (configuration) {
</span><span class="cx"> case NormalConversion:
</span><span class="lines">@@ -164,8 +148,8 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> struct Converter<uint8_t> : DefaultConverter<uint8_t> {
- static uint8_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+template<> struct Converter<IDLOctet> : DefaultConverter<IDLOctet> {
+ static uint8_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration = NormalConversion)
</ins><span class="cx"> {
</span><span class="cx"> switch (configuration) {
</span><span class="cx"> case NormalConversion:
</span><span class="lines">@@ -179,8 +163,8 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> struct Converter<int16_t> : DefaultConverter<int16_t> {
- static int16_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+template<> struct Converter<IDLShort> : DefaultConverter<IDLShort> {
+ static int16_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration = NormalConversion)
</ins><span class="cx"> {
</span><span class="cx"> switch (configuration) {
</span><span class="cx"> case NormalConversion:
</span><span class="lines">@@ -194,8 +178,8 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> struct Converter<uint16_t> : DefaultConverter<uint16_t> {
- static uint16_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+template<> struct Converter<IDLUnsignedShort> : DefaultConverter<IDLUnsignedShort> {
+ static uint16_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration = NormalConversion)
</ins><span class="cx"> {
</span><span class="cx"> switch (configuration) {
</span><span class="cx"> case NormalConversion:
</span><span class="lines">@@ -209,8 +193,8 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> struct Converter<int32_t> : DefaultConverter<int32_t> {
- static int32_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+template<> struct Converter<IDLLong> : DefaultConverter<IDLLong> {
+ static int32_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration = NormalConversion)
</ins><span class="cx"> {
</span><span class="cx"> switch (configuration) {
</span><span class="cx"> case NormalConversion:
</span><span class="lines">@@ -224,8 +208,8 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> struct Converter<uint32_t> : DefaultConverter<uint32_t> {
- static uint32_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+template<> struct Converter<IDLUnsignedLong> : DefaultConverter<IDLUnsignedLong> {
+ static uint32_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration = NormalConversion)
</ins><span class="cx"> {
</span><span class="cx"> switch (configuration) {
</span><span class="cx"> case NormalConversion:
</span><span class="lines">@@ -239,8 +223,8 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> struct Converter<int64_t> : DefaultConverter<int64_t> {
- static int64_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+template<> struct Converter<IDLLongLong> : DefaultConverter<IDLLongLong> {
+ static int64_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration = NormalConversion)
</ins><span class="cx"> {
</span><span class="cx"> if (value.isInt32())
</span><span class="cx"> return value.asInt32();
</span><span class="lines">@@ -257,8 +241,8 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> struct Converter<uint64_t> : DefaultConverter<uint64_t> {
- static uint64_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+template<> struct Converter<IDLUnsignedLongLong> : DefaultConverter<IDLUnsignedLongLong> {
+ static uint64_t convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration = NormalConversion)
</ins><span class="cx"> {
</span><span class="cx"> if (value.isUInt32())
</span><span class="cx"> return value.asUInt32();
</span><span class="lines">@@ -275,18 +259,153 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<typename T> struct Converter<T, typename std::enable_if<std::is_floating_point<T>::value>::type> : DefaultConverter<T> {
- static T convert(JSC::ExecState& state, JSC::JSValue value, ShouldAllowNonFinite allow)
</del><ins>+// MARK: -
+// MARK: Floating point types
+
+template<> struct Converter<IDLFloat> : DefaultConverter<IDLFloat> {
+ static float convert(JSC::ExecState& state, JSC::JSValue value)
</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"> double number = value.toNumber(&state);
</span><del>- if (allow == ShouldAllowNonFinite::No && UNLIKELY(!std::isfinite(number)))
</del><ins>+ if (UNLIKELY(!std::isfinite(number)))
</ins><span class="cx"> throwNonFiniteTypeError(state, scope);
</span><del>- return static_cast<T>(number);
</del><ins>+ return static_cast<float>(number);
</ins><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+template<> struct Converter<IDLUnrestrictedFloat> : DefaultConverter<IDLUnrestrictedFloat> {
+ static float convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ return static_cast<float>(value.toNumber(&state));
+ }
+};
+
+template<> struct Converter<IDLDouble> : DefaultConverter<IDLDouble> {
+ static double convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ JSC::VM& vm = state.vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ double number = value.toNumber(&state);
+ if (UNLIKELY(!std::isfinite(number)))
+ throwNonFiniteTypeError(state, scope);
+ return number;
+ }
+};
+
+template<> struct Converter<IDLUnrestrictedDouble> : DefaultConverter<IDLUnrestrictedDouble> {
+ static double convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ return value.toNumber(&state);
+ }
+};
+
+// MARK: -
+// MARK: String types
+
+template<> struct Converter<IDLDOMString> : DefaultConverter<IDLDOMString> {
+ static String convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ return value.toWTFString(&state);
+ }
+};
+
+template<> struct Converter<IDLUSVString> : DefaultConverter<IDLUSVString> {
+ static String convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ return valueToUSVString(&state, value);
+ }
+};
+
+// MARK: -
+// MARK: Array-like types
+
+namespace Detail {
+ template<typename IDLType>
+ struct ArrayConverterBase;
+
+ template<typename IDLType>
+ struct ArrayConverterBase {
+ using ReturnType = Vector<typename IDLType::ImplementationType>;
+ };
+
+ template<typename T>
+ struct ArrayConverterBase<IDLInterface<T>> {
+ using ReturnType = Vector<RefPtr<T>>;
+ };
+
+ template<typename IDLType>
+ struct ArrayConverter : ArrayConverterBase<IDLType> {
+ using ReturnType = typename ArrayConverterBase<IDLType>::ReturnType;
+
+ static ReturnType convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ auto& vm = state.vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ if (!value.isObject()) {
+ throwSequenceTypeError(state, scope);
+ return { };
+ }
+
+ ReturnType result;
+ forEachInIterable(&state, value, [&result](JSC::VM& vm, JSC::ExecState* state, JSC::JSValue jsValue) {
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ auto convertedValue = Converter<IDLType>::convert(*state, jsValue);
+ if (UNLIKELY(scope.exception()))
+ return;
+ result.append(WTFMove(convertedValue));
+ });
+ return result;
+ }
+ };
+}
+
+template<typename T> struct Converter<IDLSequence<T>> : DefaultConverter<IDLSequence<T>> {
+ using ReturnType = typename Detail::ArrayConverter<T>::ReturnType;
+
+ static ReturnType convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ return Detail::ArrayConverter<T>::convert(state, value);
+ }
+};
+
+template<typename T> struct Converter<IDLFrozenArray<T>> : DefaultConverter<IDLFrozenArray<T>> {
+ using ReturnType = typename Detail::ArrayConverter<T>::ReturnType;
+
+ static ReturnType convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ return Detail::ArrayConverter<T>::convert(state, value);
+ }
+};
+
+// MARK: -
+// MARK: Dictionary type
+
+template<typename T> struct Converter<IDLDictionary<T>> : DefaultConverter<IDLDictionary<T>> {
+ using ReturnType = Optional<T>;
+
+ static ReturnType convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ return convertDictionary<T>(state, value);
+ }
+};
+
+// MARK: -
+// MARK: Enumeration type
+
+template<typename T> struct Converter<IDLEnumeration<T>> : DefaultConverter<IDLEnumeration<T>> {
+ static T convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ return convertEnumeration<T>(state, value);
+ }
+};
+
+
+// MARK: -
+// MARK: Union type
+
</ins><span class="cx"> template<typename ReturnType, typename T, bool enabled>
</span><span class="cx"> struct ConditionalConverter;
</span><span class="cx">
</span><span class="lines">@@ -327,7 +446,7 @@
</span><span class="cx"> using ConditionalFront = typename Detail::ConditionalFront<List, condition>::type;
</span><span class="cx">
</span><span class="cx"> template<typename... T>
</span><del>-struct Converter<IDLUnion<T...>> : DefaultConverter<typename IDLUnion<T...>::ImplementationType>
</del><ins>+struct Converter<IDLUnion<T...>> : DefaultConverter<IDLUnion<T...>>
</ins><span class="cx"> {
</span><span class="cx"> using Type = IDLUnion<T...>;
</span><span class="cx"> using TypeList = typename Type::TypeList;
</span><span class="lines">@@ -431,60 +550,65 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<typename IDLType>
-struct VariadicConverterBase;
</del><ins>+// MARK: -
+// MARK: Support for variadic tail convertions
</ins><span class="cx">
</span><del>-template<typename IDLType>
-struct VariadicConverterBase {
- using Item = typename IDLType::ImplementationType;
</del><ins>+namespace Detail {
+ template<typename IDLType>
+ struct VariadicConverterBase;
</ins><span class="cx">
</span><del>- static Optional<Item> convert(JSC::ExecState& state, JSC::JSValue value)
- {
- auto& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
</del><ins>+ template<typename IDLType>
+ struct VariadicConverterBase {
+ using Item = typename IDLType::ImplementationType;
</ins><span class="cx">
</span><del>- auto result = Converter<IDLType>::convert(state, value);
- RETURN_IF_EXCEPTION(scope, Nullopt);
</del><ins>+ static Optional<Item> convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ auto& vm = state.vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">
</span><del>- return result;
- }
-};
</del><ins>+ auto result = Converter<IDLType>::convert(state, value);
+ RETURN_IF_EXCEPTION(scope, Nullopt);
</ins><span class="cx">
</span><del>-template<typename T>
-struct VariadicConverterBase<IDLInterface<T>> {
- using Item = typename IDLInterface<T>::ImplementationType;
</del><ins>+ return result;
+ }
+ };
</ins><span class="cx">
</span><del>- static Optional<Item> convert(JSC::ExecState& state, JSC::JSValue value)
- {
- auto* result = Converter<IDLInterface<T>>::convert(state, value);
- if (!result)
- return Nullopt;
- return Optional<Item>(*result);
- }
-};
</del><ins>+ template<typename T>
+ struct VariadicConverterBase<IDLInterface<T>> {
+ using Item = typename IDLInterface<T>::ImplementationType;
</ins><span class="cx">
</span><del>-template<typename IDLType>
-struct VariadicConverter : VariadicConverterBase<IDLType> {
- using Item = typename VariadicConverterBase<IDLType>::Item;
- using Container = Vector<Item>;
</del><ins>+ static Optional<Item> convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ auto* result = Converter<IDLInterface<T>>::convert(state, value);
+ if (!result)
+ return Nullopt;
+ return Optional<Item>(*result);
+ }
+ };
</ins><span class="cx">
</span><del>- struct Result {
- size_t argumentIndex;
- Optional<Container> arguments;
</del><ins>+ template<typename IDLType>
+ struct VariadicConverter : VariadicConverterBase<IDLType> {
+ using Item = typename VariadicConverterBase<IDLType>::Item;
+ using Container = Vector<Item>;
+
+ struct Result {
+ size_t argumentIndex;
+ Optional<Container> arguments;
+ };
</ins><span class="cx"> };
</span><del>-};
</del><ins>+}
</ins><span class="cx">
</span><del>-template<typename IDLType> typename VariadicConverter<IDLType>::Result convertVariadicArguments(JSC::ExecState& state, size_t startIndex)
</del><ins>+template<typename IDLType> typename Detail::VariadicConverter<IDLType>::Result convertVariadicArguments(JSC::ExecState& state, size_t startIndex)
</ins><span class="cx"> {
</span><span class="cx"> size_t length = state.argumentCount();
</span><span class="cx"> if (startIndex > length)
</span><span class="cx"> return { 0, Nullopt };
</span><span class="cx">
</span><del>- typename VariadicConverter<IDLType>::Container result;
</del><ins>+ typename Detail::VariadicConverter<IDLType>::Container result;
</ins><span class="cx"> result.reserveInitialCapacity(length - startIndex);
</span><span class="cx">
</span><span class="cx"> for (size_t i = startIndex; i < length; ++i) {
</span><del>- auto value = VariadicConverter<IDLType>::convert(state, state.uncheckedArgument(i));
</del><ins>+ auto value = Detail::VariadicConverter<IDLType>::convert(state, state.uncheckedArgument(i));
</ins><span class="cx"> if (!value)
</span><span class="cx"> return { i, Nullopt };
</span><span class="cx"> result.uncheckedAppend(WTFMove(*value));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDocumentCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -137,9 +137,9 @@
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx"> auto name = state.uncheckedArgument(1).toWTFString(&state);
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><del>- auto width = convert<int32_t>(state, state.uncheckedArgument(2), NormalConversion);
</del><ins>+ auto width = convert<IDLLong>(state, state.uncheckedArgument(2), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><del>- auto height = convert<int32_t>(state, state.uncheckedArgument(3), NormalConversion);
</del><ins>+ auto height = convert<IDLLong>(state, state.uncheckedArgument(3), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">
</span><span class="cx"> auto* context = wrapped().getCSSCanvasContext(WTFMove(contextId), WTFMove(name), WTFMove(width), WTFMove(height));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMockContentFilterSettingsCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> VM& vm = state.vm();
</span><span class="cx"> auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx">
</span><del>- uint8_t nativeValue { convert<uint8_t>(state, value, EnforceRange) };
</del><ins>+ uint8_t nativeValue { convert<IDLOctet>(state, value, EnforceRange) };
</ins><span class="cx"> RETURN_IF_EXCEPTION(scope, void());
</span><span class="cx">
</span><span class="cx"> DecisionPoint decisionPoint { static_cast<DecisionPoint>(nativeValue) };
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> VM& vm = state.vm();
</span><span class="cx"> auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx">
</span><del>- uint8_t nativeValue { convert<uint8_t>(state, value, EnforceRange) };
</del><ins>+ uint8_t nativeValue { convert<IDLOctet>(state, value, EnforceRange) };
</ins><span class="cx"> RETURN_IF_EXCEPTION(scope, Decision::Allow);
</span><span class="cx">
</span><span class="cx"> Decision decision { static_cast<Decision>(nativeValue) };
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeFilterCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> return NodeFilter::FILTER_REJECT;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- uint16_t result = convert<uint16_t>(*state, value, NormalConversion);
</del><ins>+ auto result = convert<IDLUnsignedShort>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(scope, NodeFilter::FILTER_REJECT);
</span><span class="cx">
</span><span class="cx"> return result;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -677,99 +677,6 @@
</span><span class="cx"> return "";
</span><span class="cx"> }
</span><span class="cx">
</span><del>-# http://heycam.github.io/webidl/#dfn-flattened-union-member-types
-sub GetFlattenedMemberTypes
-{
- my ($object, $idlUnionType) = @_;
-
- my @flattenedMemberTypes = ();
-
- foreach my $memberType (@{$idlUnionType->subtypes}) {
- if ($memberType->isUnion) {
- push(@flattenedMemberTypes, $object->GetFlattenedMemberTypes($memberType));
- } else {
- push(@flattenedMemberTypes, $memberType);
- }
- }
-
- return @flattenedMemberTypes;
-}
-
-# http://heycam.github.io/webidl/#dfn-number-of-nullable-member-types
-sub GetNumberOfNullableMemberTypes
-{
- my ($object, $idlUnionType) = @_;
-
- my $count = 0;
-
- foreach my $memberType (@{$idlUnionType->subtypes}) {
- $count++ if $memberType->isNullable;
- $count += $object->GetNumberOfNullableMemberTypes($memberType) if $memberType->isUnion;
- }
-
- return $count;
-}
-
-sub GetIDLUnionMemberTypes
-{
- my ($object, $interface, $idlUnionType) = @_;
-
- my $numberOfNullableMembers = $object->GetNumberOfNullableMemberTypes($idlUnionType);
- assert("Union types must only have 0 or 1 nullable types.") if $numberOfNullableMembers > 1;
-
- my @idlUnionMemberTypes = ();
-
- push(@idlUnionMemberTypes, "IDLNull") if $numberOfNullableMembers == 1;
-
- foreach my $memberType ($object->GetFlattenedMemberTypes($idlUnionType)) {
- push(@idlUnionMemberTypes, $object->GetBaseIDLType($interface, $memberType));
- }
-
- return @idlUnionMemberTypes;
-}
-
-sub GetBaseIDLType
-{
- my ($object, $interface, $idlType) = @_;
-
- my %IDLTypes = (
- "any" => "IDLAny",
- "boolean" => "IDLBoolean",
- "byte" => "IDLByte",
- "octet" => "IDLOctet",
- "short" => "IDLShort",
- "unsigned short" => "IDLUnsignedShort",
- "long" => "IDLLong",
- "unsigned long" => "IDLUnsignedLong",
- "long long" => "IDLLongLong",
- "unsigned long long" => "IDLUnsignedLongLong",
- "float" => "IDLFloat",
- "unrestricted float" => "IDLUnrestrictedFloat",
- "double" => "IDLDouble",
- "unrestricted double" => "IDLUnrestrictedDouble",
- "DOMString" => "IDLDOMString",
- "ByteString" => "IDLByteString",
- "USVString" => "IDLUSVString",
- );
-
- return $IDLTypes{$idlType->name} if exists $IDLTypes{$idlType->name};
- return "IDLEnumeration<" . $object->GetEnumerationClassName($interface, $idlType->name) . ">" if $object->IsEnumType($idlType->name);
- return "IDLDictionary<" . $object->GetDictionaryClassName($interface, $idlType->name) . ">" if $object->IsDictionaryType($idlType->name);
- return "IDLSequence<" . $object->GetIDLType($interface, @{$idlType->subtypes}[0]) . ">" if $object->IsSequenceType($idlType->name);
- return "IDLFrozenArray<" . $object->GetIDLType($interface, @{$idlType->subtypes}[0]) . ">" if $object->IsFrozenArrayType($idlType->name);
- return "IDLUnion<" . join(", ", $object->GetIDLUnionMemberTypes($interface, $idlType)) . ">" if $idlType->isUnion;
- return "IDLInterface<" . $idlType->name . ">";
-}
-
-sub GetIDLType
-{
- my ($object, $interface, $idlType) = @_;
-
- my $baseIDLType = $object->GetBaseIDLType($interface, $idlType);
- return "IDLNullable<" . $baseIDLType . ">" if $idlType->isNullable;
- return $baseIDLType;
-}
-
</del><span class="cx"> # These match WK_lcfirst and WK_ucfirst defined in builtins_generator.py.
</span><span class="cx"> # Uppercase the first letter while respecting WebKit style guidelines.
</span><span class="cx"> # E.g., xmlEncoding becomes XMLEncoding, but xmlllang becomes Xmllang.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -264,8 +264,18 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if ($codeGenerator->IsSequenceOrFrozenArrayType($idlType->name)) {
+ AddToImplIncludesForIDLType(@{$idlType->subtypes}[0], $conditional);
+ return;
+ }
+
+ if ($codeGenerator->IsExternalDictionaryType($idlType->name)) {
+ AddToImplIncludes("JS" . $idlType->name . ".h", $conditional);
+ return;
+ }
+
</ins><span class="cx"> if ($codeGenerator->IsWrapperType($idlType->name)) {
</span><del>- AddToImplIncludes("JS" . $idlType->name . ".h");
</del><ins>+ AddToImplIncludes("JS" . $idlType->name . ".h", $conditional);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -881,7 +891,7 @@
</span><span class="cx"> # FIXME: Change to take VM& instead of ExecState&.
</span><span class="cx"> # FIXME: Consider using toStringOrNull to make exception checking faster.
</span><span class="cx"> # FIXME: Consider finding a more efficient way to match against all the strings quickly.
</span><del>- $result .= "template<> Optional<$className> parse<$className>(ExecState& state, JSValue value)\n";
</del><ins>+ $result .= "template<> Optional<$className> parseEnumeration<$className>(ExecState& state, JSValue value)\n";
</ins><span class="cx"> $result .= "{\n";
</span><span class="cx"> $result .= " auto stringValue = value.toWTFString(&state);\n";
</span><span class="cx"> foreach my $value (@{$enumeration->values}) {
</span><span class="lines">@@ -899,11 +909,11 @@
</span><span class="cx"> # FIXME: A little ugly to have this be a side effect instead of a return value.
</span><span class="cx"> AddToImplIncludes("JSDOMConvert.h");
</span><span class="cx">
</span><del>- $result .= "template<> $className convert<$className>(ExecState& state, JSValue value)\n";
</del><ins>+ $result .= "template<> $className convertEnumeration<$className>(ExecState& state, JSValue value)\n";
</ins><span class="cx"> $result .= "{\n";
</span><span class="cx"> $result .= " VM& vm = state.vm();\n";
</span><span class="cx"> $result .= " auto throwScope = DECLARE_THROW_SCOPE(vm);\n";
</span><del>- $result .= " auto result = parse<$className>(state, value);\n";
</del><ins>+ $result .= " auto result = parseEnumeration<$className>(state, value);\n";
</ins><span class="cx"> $result .= " if (UNLIKELY(!result)) {\n";
</span><span class="cx"> $result .= " throwTypeError(&state, throwScope);\n";
</span><span class="cx"> $result .= " return { };\n";
</span><span class="lines">@@ -948,8 +958,8 @@
</span><span class="cx"> $result .= " static JSC::JSString* arrayJSValue(JSC::ExecState* state, JSDOMGlobalObject*, $className value) { return jsStringWithCache(state, value); }\n";
</span><span class="cx"> $result .= "};\n\n";
</span><span class="cx">
</span><del>- $result .= "template<> Optional<$className> parse<$className>(JSC::ExecState&, JSC::JSValue);\n";
- $result .= "template<> $className convert<$className>(JSC::ExecState&, JSC::JSValue);\n";
</del><ins>+ $result .= "template<> Optional<$className> parseEnumeration<$className>(JSC::ExecState&, JSC::JSValue);\n";
+ $result .= "template<> $className convertEnumeration<$className>(JSC::ExecState&, JSC::JSValue);\n";
</ins><span class="cx"> $result .= "template<> const char* expectedEnumerationValues<$className>();\n\n";
</span><span class="cx">
</span><span class="cx"> $result .= "#endif\n\n" if $conditionalString;
</span><span class="lines">@@ -1098,9 +1108,10 @@
</span><span class="cx"> # For each dictionary member member declared on dictionary, in lexicographical order:
</span><span class="cx"> my @sortedMembers = sort { $a->name cmp $b->name } @{$dictionary->members};
</span><span class="cx"> foreach my $member (@sortedMembers) {
</span><del>- $member->default("undefined") if $member->type eq "any" and !defined($member->default); # Use undefined as default value for member of type 'any' unless specified otherwise.
</del><ins>+ $member->default("undefined") if $member->idlType->name eq "any" and !defined($member->default); # Use undefined as default value for member of type 'any' unless specified otherwise.
</ins><span class="cx">
</span><del>- my $type = $member->type;
</del><ins>+ my $idlType = $member->idlType;
+ AddToImplIncludesForIDLType($idlType);
</ins><span class="cx">
</span><span class="cx"> # 5.1. Let key be the identifier of member.
</span><span class="cx"> my $key = $member->name;
</span><span class="lines">@@ -1108,36 +1119,21 @@
</span><span class="cx"> # 5.2. Let value be an ECMAScript value, depending on Type(V):
</span><span class="cx"> $result .= " JSValue ${key}Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, \"${key}\"));\n";
</span><span class="cx">
</span><del>- my $nativeType = GetNativeTypeFromSignature($interface, $member);
</del><ins>+ my $IDLType = GetIDLType($interface, $idlType);
</ins><span class="cx">
</span><span class="cx"> # 5.3. If value is not undefined, then:
</span><span class="cx"> $result .= " if (!${key}Value.isUndefined()) {\n";
</span><del>- # FIXME: Eventually we will want this to share a lot more code with JSValueToNative.
- if ($codeGenerator->IsWrapperType($type)) {
- AddToImplIncludes("JS${type}.h");
- die "Dictionary members of non-nullable wrapper types must be marked as required" if !$member->isNullable && $member->isOptional;
- my $nullableParameter = $member->isNullable ? "IsNullable::Yes" : "IsNullable::No";
- $result .= " result.$key = convertWrapperType<$type, JS${type}>(state, ${key}Value, $nullableParameter);\n";
</del><ins>+
+ # FIXME: We should figure out a way to merge these two cases.
+ if ($codeGenerator->IsDictionaryType($idlType->name)) {
+ $result .= " auto ${key}Optional = convert<${IDLType}>(state, ${key}Value);\n";
</ins><span class="cx"> $result .= " RETURN_IF_EXCEPTION(throwScope, Nullopt);\n";
</span><del>- } elsif ($codeGenerator->IsDictionaryType($type)) {
- my $nativeType = GetNativeType($interface, $type);
- $result .= " Optional<${nativeType}> $key = convertDictionary<${nativeType}>(state, ${key}Value).value();\n";
- $result .= " RETURN_IF_EXCEPTION(throwScope, Nullopt);\n";
- $result .= " result.$key = $key.value();\n";
- } elsif ($codeGenerator->IsSequenceOrFrozenArrayType($type)) {
- my $innerType = $codeGenerator->GetSequenceOrFrozenArrayInnerType($type);
- if ($codeGenerator->IsWrapperType($innerType)) {
- $result .= " result.$key = convertWrapperTypeSequence<$innerType, JS$innerType, $nativeType>(state, ${key}Value);\n";
- } else {
- $result .= " result.$key = convert<${nativeType}>(state, ${key}Value);\n";
- }
- $result .= " RETURN_IF_EXCEPTION(throwScope, Nullopt);\n";
</del><ins>+ $result .= " result.$key = ${key}Optional.value();\n";
</ins><span class="cx"> } else {
</span><del>- my $conversionRuleWithLeadingComma = GenerateConversionRuleWithLeadingComma($interface, $member);
- my $convertFunction = $member->isNullable ? "convertNullable" : "convert";
- $result .= " result.$key = $convertFunction<${nativeType}>(state, ${key}Value${conversionRuleWithLeadingComma});\n";
</del><ins>+ $result .= " result.$key = convert<${IDLType}>(state, ${key}Value);\n";
</ins><span class="cx"> $result .= " RETURN_IF_EXCEPTION(throwScope, Nullopt);\n";
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> # Value is undefined.
</span><span class="cx"> # 5.4. Otherwise, if value is undefined but the dictionary member has a default value, then:
</span><span class="cx"> if ($member->isOptional && defined $member->default) {
</span><span class="lines">@@ -2123,7 +2119,7 @@
</span><span class="cx"> $overload = GetOverloadThatMatches($S, $d, \&$isObjectOrCallbackFunctionParameter);
</span><span class="cx"> &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isFunction()");
</span><span class="cx">
</span><del>- # FIXME: Avoid invoking GetMethod(object, Symbol.iterator) again in toNativeArray and toRefPtrNativeArray.
</del><ins>+ # FIXME: Avoid invoking GetMethod(object, Symbol.iterator) again in convert<IDLSequence<T>>(...).
</ins><span class="cx"> $overload = GetOverloadThatMatches($S, $d, \&$isSequenceOrFrozenArrayParameter);
</span><span class="cx"> &$generateOverloadCallIfNecessary($overload, "hasIteratorMethod(*state, distinguishingArg)");
</span><span class="cx">
</span><span class="lines">@@ -4176,7 +4172,7 @@
</span><span class="cx"> $implIncludes{"JSDOMConvert.h"} = 1;
</span><span class="cx"> AddToImplIncludesForIDLType($idlType, $function->signature->extendedAttributes->{Conditional});
</span><span class="cx">
</span><del>- my $metaType = $codeGenerator->GetIDLType($interface, $idlType);
</del><ins>+ my $metaType = GetIDLType($interface, $idlType);
</ins><span class="cx"> push(@$outputArray, " auto $name = convertVariadicArguments<$metaType>(*state, $argumentIndex);\n");
</span><span class="cx"> push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n");
</span><span class="cx">
</span><span class="lines">@@ -4215,7 +4211,7 @@
</span><span class="cx"> $indent = " ";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- push(@$outputArray, "$indent $defineOptionalValue = parse<$className>(*state, ${name}Value);\n");
</del><ins>+ push(@$outputArray, "$indent $defineOptionalValue = parseEnumeration<$className>(*state, ${name}Value);\n");
</ins><span class="cx"> push(@$outputArray, "$indent RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n");
</span><span class="cx"> push(@$outputArray, "$indent if (UNLIKELY(!$optionalValue))\n");
</span><span class="cx"> push(@$outputArray, "$indent return throwArgumentMustBeEnumError(*state, throwScope, $argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName, expectedEnumerationValues<$className>());\n");
</span><span class="lines">@@ -4821,6 +4817,99 @@
</span><span class="cx"> return "Vector<" . GetNativeVectorInnerType($innerType) . ">";
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+# http://heycam.github.io/webidl/#dfn-flattened-union-member-types
+sub GetFlattenedMemberTypes
+{
+ my ($idlUnionType) = @_;
+
+ my @flattenedMemberTypes = ();
+
+ foreach my $memberType (@{$idlUnionType->subtypes}) {
+ if ($memberType->isUnion) {
+ push(@flattenedMemberTypes, GetFlattenedMemberTypes($memberType));
+ } else {
+ push(@flattenedMemberTypes, $memberType);
+ }
+ }
+
+ return @flattenedMemberTypes;
+}
+
+# http://heycam.github.io/webidl/#dfn-number-of-nullable-member-types
+sub GetNumberOfNullableMemberTypes
+{
+ my ($idlUnionType) = @_;
+
+ my $count = 0;
+
+ foreach my $memberType (@{$idlUnionType->subtypes}) {
+ $count++ if $memberType->isNullable;
+ $count += GetNumberOfNullableMemberTypes($memberType) if $memberType->isUnion;
+ }
+
+ return $count;
+}
+
+sub GetIDLUnionMemberTypes
+{
+ my ($interface, $idlUnionType) = @_;
+
+ my $numberOfNullableMembers = GetNumberOfNullableMemberTypes($idlUnionType);
+ assert("Union types must only have 0 or 1 nullable types.") if $numberOfNullableMembers > 1;
+
+ my @idlUnionMemberTypes = ();
+
+ push(@idlUnionMemberTypes, "IDLNull") if $numberOfNullableMembers == 1;
+
+ foreach my $memberType (GetFlattenedMemberTypes($idlUnionType)) {
+ push(@idlUnionMemberTypes, GetBaseIDLType($interface, $memberType));
+ }
+
+ return @idlUnionMemberTypes;
+}
+
+sub GetBaseIDLType
+{
+ my ($interface, $idlType) = @_;
+
+ my %IDLTypes = (
+ "any" => "IDLAny",
+ "boolean" => "IDLBoolean",
+ "byte" => "IDLByte",
+ "octet" => "IDLOctet",
+ "short" => "IDLShort",
+ "unsigned short" => "IDLUnsignedShort",
+ "long" => "IDLLong",
+ "unsigned long" => "IDLUnsignedLong",
+ "long long" => "IDLLongLong",
+ "unsigned long long" => "IDLUnsignedLongLong",
+ "float" => "IDLFloat",
+ "unrestricted float" => "IDLUnrestrictedFloat",
+ "double" => "IDLDouble",
+ "unrestricted double" => "IDLUnrestrictedDouble",
+ "DOMString" => "IDLDOMString",
+ "ByteString" => "IDLByteString",
+ "USVString" => "IDLUSVString",
+ );
+
+ return $IDLTypes{$idlType->name} if exists $IDLTypes{$idlType->name};
+ return "IDLEnumeration<" . GetEnumerationClassName($idlType->name, $interface) . ">" if $codeGenerator->IsEnumType($idlType->name);
+ return "IDLDictionary<" . GetDictionaryClassName($idlType->name, $interface) . ">" if $codeGenerator->IsDictionaryType($idlType->name);
+ return "IDLSequence<" . GetIDLType($interface, @{$idlType->subtypes}[0]) . ">" if $codeGenerator->IsSequenceType($idlType->name);
+ return "IDLFrozenArray<" . GetIDLType($interface, @{$idlType->subtypes}[0]) . ">" if $codeGenerator->IsFrozenArrayType($idlType->name);
+ return "IDLUnion<" . join(", ", GetIDLUnionMemberTypes($interface, $idlType)) . ">" if $idlType->isUnion;
+ return "IDLInterface<" . $idlType->name . ">";
+}
+
+sub GetIDLType
+{
+ my ($interface, $idlType) = @_;
+
+ my $baseIDLType = GetBaseIDLType($interface, $idlType);
+ return "IDLNullable<" . $baseIDLType . ">" if $idlType->isNullable;
+ return $baseIDLType;
+}
+
</ins><span class="cx"> sub GetNativeType
</span><span class="cx"> {
</span><span class="cx"> my ($interface, $type) = @_;
</span><span class="lines">@@ -4925,6 +5014,20 @@
</span><span class="cx"> return "NormalConversion";
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub IsHandledByDOMConvert
+{
+ my $idlType = shift;
+
+ return 1 if $idlType->isUnion;
+ return 1 if $idlType->name eq "any";
+ return 1 if $idlType->name eq "boolean";
+ return 1 if $codeGenerator->IsIntegerType($idlType->name);
+ return 1 if $codeGenerator->IsFloatingPointType($idlType->name);
+ return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($idlType->name);
+ return 1 if $codeGenerator->IsDictionaryType($idlType->name);
+ return 0;
+}
+
</ins><span class="cx"> # Returns (convertString, mayThrowException).
</span><span class="cx"> sub JSValueToNative
</span><span class="cx"> {
</span><span class="lines">@@ -4931,12 +5034,20 @@
</span><span class="cx"> my ($interface, $signature, $value, $conditional) = @_;
</span><span class="cx">
</span><span class="cx"> my $type = $signature->type;
</span><ins>+ my $idlType = $signature->idlType;
</ins><span class="cx">
</span><del>- if ($codeGenerator->IsIntegerType($type)) {
- my $nativeType = GetNativeType($interface, $type);
- my $conversionType = GetIntegerConversionConfiguration($signature);
</del><ins>+ if (IsHandledByDOMConvert($idlType)) {
</ins><span class="cx"> AddToImplIncludes("JSDOMConvert.h");
</span><del>- return ("convert<$nativeType>(*state, $value, $conversionType)", 1);
</del><ins>+ AddToImplIncludesForIDLType($idlType, $conditional);
+
+ my $IDLType = GetIDLType($interface, $idlType);
+
+ if ($codeGenerator->IsIntegerType($type)) {
+ my $conversionType = GetIntegerConversionConfiguration($signature);
+ return ("convert<$IDLType>(*state, $value, $conversionType)", 1);
+ }
+
+ return ("convert<$IDLType>(*state, $value)", 1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($type eq "DOMString") {
</span><span class="lines">@@ -4965,35 +5076,9 @@
</span><span class="cx"> return ("Dictionary(state, $value)", 0);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($codeGenerator->IsSequenceOrFrozenArrayType($type)) {
- my $innerType = $codeGenerator->GetSequenceOrFrozenArrayInnerType($type);
- if ($codeGenerator->IsRefPtrType($innerType)) {
- AddToImplIncludes("JS${innerType}.h");
- return ("toRefPtrNativeArray<${innerType}, JS${innerType}>(*state, $value)", 1);
- }
- return ("toNativeArray<" . GetNativeVectorInnerType($innerType) . ">(*state, $value)", 1);
- }
-
- return ($value, 0) if $type eq "any";
-
- return ("$value.toBoolean(state)", 1) if $type eq "boolean";
-
- if ($codeGenerator->IsFloatingPointType($type)) {
- AddToImplIncludes("JSDOMConvert.h");
- my $allowNonFinite = ShouldAllowNonFiniteForFloatingPointType($type) ? "ShouldAllowNonFinite::Yes" : "ShouldAllowNonFinite::No";
- my $nativeType = GetNativeType($interface, $type);
- return ("convert<$nativeType>(*state, $value, $allowNonFinite)", 1);
- }
-
</del><span class="cx"> return ("valueToDate(state, $value)", 1) if $type eq "Date";
</span><del>-
</del><span class="cx"> return ("to$type($value)", 1) if $codeGenerator->IsTypedArrayType($type);
</span><del>- return ("parse<" . GetEnumerationClassName($type, $interface) . ">(*state, $value)", 1) if $codeGenerator->IsEnumType($type);
- if ($codeGenerator->IsDictionaryType($type)) {
- my $dictionary = $codeGenerator->GetDictionaryByName($type);
- AddToImplIncludes("JS$type.h", $conditional) if $codeGenerator->IsExternalDictionaryType($type);
- return ("convertDictionary<" . GetDictionaryClassName($type, $interface) . ">(*state, $value)", 1);
- }
</del><ins>+ return ("parseEnumeration<" . GetEnumerationClassName($type, $interface) . ">(*state, $value)", 1) if $codeGenerator->IsEnumType($type);
</ins><span class="cx">
</span><span class="cx"> AddToImplIncludes("JS$type.h", $conditional);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLParserpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx">
</span><span class="cx"> struct( Typedef => {
</span><span class="cx"> extendedAttributes => '$', # Extended attributes
</span><del>- type => '$', # Type of data
</del><ins>+ idlType => '$', # Type of data
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> # Maps 'typedef name' -> Typedef
</span><span class="lines">@@ -421,7 +421,7 @@
</span><span class="cx"> if (exists $typedefs{$constant->type}) {
</span><span class="cx"> my $typedef = $typedefs{$constant->type};
</span><span class="cx"> $self->assertNoExtendedAttributesInTypedef($constant->type, __LINE__);
</span><del>- $constant->type($typedef->type);
</del><ins>+ $constant->type($typedef->idlType->name);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> foreach my $attribute (@{$definition->attributes}) {
</span><span class="lines">@@ -441,37 +441,89 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub cloneType
+{
+ my $self = shift;
+ my $type = shift;
+
+ my $clonedType = domType->new();
+ $clonedType->name($type->name);
+ $clonedType->isNullable($type->isNullable);
+ $clonedType->isUnion($type->isUnion);
+ foreach my $subtype (@{$type->subtypes}) {
+ push(@{$clonedType->subtypes}, $self->cloneType($subtype));
+ }
+
+ return $clonedType;
+}
+
</ins><span class="cx"> sub applyTypedefsForSignature
</span><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><span class="cx"> my $signature = shift;
</span><span class="cx">
</span><del>- if (!defined ($signature->type)) {
</del><ins>+ if (!defined ($signature->idlType)) {
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- my $type = $signature->type;
- $type =~ s/[\?\[\]]+$//g;
- my $typeSuffix = $signature->type;
- $typeSuffix =~ s/^[^\?\[\]]+//g;
- if (exists $typedefs{$type}) {
- my $typedef = $typedefs{$type};
- $signature->type($typedef->type . $typeSuffix);
- copyExtendedAttributes($signature->extendedAttributes, $typedef->extendedAttributes);
- }
</del><ins>+ my $typeName = $signature->idlType->name;
</ins><span class="cx">
</span><span class="cx"> # Handle union types, sequences and etc.
</span><del>- foreach my $name (%typedefs) {
- if (!exists $typedefs{$name}) {
- next;
</del><ins>+ # FIXME: This should be recursive.
+ my $numberOfSubtypes = scalar @{$signature->idlType->subtypes};
+ if ($numberOfSubtypes) {
+ my $typeUpdated = 0;
+
+ for my $i (0..$numberOfSubtypes - 1) {
+ my $subtype = @{$signature->idlType->subtypes}[$i];
+ my $subtypeName = $subtype->name;
+
+ if (exists $typedefs{$subtypeName}) {
+ my $typedef = $typedefs{$subtypeName};
+
+ my $clonedType = $self->cloneType($typedef->idlType);
+
+ # Retain nullability from the original type.
+ $clonedType->isNullable($subtype->isNullable);
+
+ @{$signature->idlType->subtypes}[$i] = $clonedType;
+
+ $typeUpdated = 1;
+ }
</ins><span class="cx"> }
</span><del>- my $typedef = $typedefs{$name};
- my $regex = '\\b' . $name . '\\b';
- my $replacement = $typedef->type;
- my $type = $signature->type;
- $type =~ s/($regex)/$replacement/g;
- $signature->type($type);
</del><ins>+
+ # FIXME: This can be removed when we use domTypes in the CodeGenerators everywhere.
+ if ($typeUpdated) {
+ my $subtype = @{$signature->idlType->subtypes}[0];
+ my $subtypeName = $subtype->name;
+
+ if ($signature->idlType->name =~ /^sequence</) {
+ $signature->idlType->name("sequence<${subtypeName}>");
+ $signature->type($signature->idlType->name);
+ }
+ if ($signature->idlType->name =~ /^FrozenArray</) {
+ $signature->idlType->name("FrozenArray<${subtypeName}>");
+ $signature->type($signature->idlType->name);
+ }
+ }
+
+ return;
</ins><span class="cx"> }
</span><ins>+
+ if (exists $typedefs{$typeName}) {
+ my $typedef = $typedefs{$typeName};
+
+ my $clonedType = $self->cloneType($typedef->idlType);
+
+ # Retain nullability from the original type.
+ $clonedType->isNullable($signature->idlType->isNullable);
+
+ $signature->idlType($clonedType);
+ $signature->type($clonedType->name);
+ $signature->isNullable($clonedType->isNullable);
+
+ copyExtendedAttributes($signature->extendedAttributes, $typedef->extendedAttributes);
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub parseDefinition
</span><span class="lines">@@ -920,13 +972,13 @@
</span><span class="cx"> $typedef->extendedAttributes($self->parseExtendedAttributeListAllowEmpty());
</span><span class="cx">
</span><span class="cx"> my $type = $self->parseType();
</span><del>- $typedef->type($type->name);
</del><ins>+ $typedef->idlType($type);
</ins><span class="cx">
</span><span class="cx"> my $nameToken = $self->getToken();
</span><span class="cx"> $self->assertTokenType($nameToken, IdentifierToken);
</span><span class="cx"> $self->assertTokenValue($self->getToken(), ";", __LINE__);
</span><span class="cx"> my $name = $nameToken->value();
</span><del>- die "typedef redefinition for " . $name . " at " . $self->{Line} if (exists $typedefs{$name} && $typedef->type ne $typedefs{$name}->type);
</del><ins>+ die "typedef redefinition for " . $name . " at " . $self->{Line} if (exists $typedefs{$name} && $typedef->idlType->name ne $typedefs{$name}->idlType->name);
</ins><span class="cx"> $typedefs{$name} = $typedef;
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -1314,6 +1366,7 @@
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->type() == IdentifierToken || $next->value() eq "(") {
</span><span class="cx"> my $operation = $self->parseOperationRest($extendedAttributeList);
</span><ins>+ $operation->signature->idlType($returnType);
</ins><span class="cx"> $operation->signature->type($returnType->name);
</span><span class="cx"> $operation->signature->isNullable($returnType->isNullable);
</span><span class="cx">
</span><span class="lines">@@ -1335,6 +1388,7 @@
</span><span class="cx"> my $returnType = $self->parseReturnType();
</span><span class="cx"> my $interface = $self->parseOperationRest($extendedAttributeList);
</span><span class="cx"> if (defined ($interface)) {
</span><ins>+ $interface->signature->idlType($returnType);
</ins><span class="cx"> $interface->signature->type($returnType->name);
</span><span class="cx"> $interface->signature->isNullable($returnType->isNullable);
</span><span class="cx"> $interface->signature->specials(\@specials);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -213,7 +213,7 @@
</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 index = convert<uint32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> JSValue result = toJS(state, castedThis->globalObject(), impl.item(WTFMove(index)));
</span><span class="cx"> return JSValue::encode(result);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -416,7 +416,7 @@
</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 testParam = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto testParam = convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.enabledAtRuntimeOperation(WTFMove(testParam));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -110,7 +110,7 @@
</span><span class="cx"> return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> Optional<TestObj::EnumType> parse<TestObj::EnumType>(ExecState& state, JSValue value)
</del><ins>+template<> Optional<TestObj::EnumType> parseEnumeration<TestObj::EnumType>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> auto stringValue = value.toWTFString(&state);
</span><span class="cx"> if (stringValue.isEmpty())
</span><span class="lines">@@ -124,11 +124,11 @@
</span><span class="cx"> return Nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> TestObj::EnumType convert<TestObj::EnumType>(ExecState& state, JSValue value)
</del><ins>+template<> TestObj::EnumType convertEnumeration<TestObj::EnumType>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = state.vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>- auto result = parse<TestObj::EnumType>(state, value);
</del><ins>+ auto result = parseEnumeration<TestObj::EnumType>(state, value);
</ins><span class="cx"> if (UNLIKELY(!result)) {
</span><span class="cx"> throwTypeError(&state, throwScope);
</span><span class="cx"> return { };
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx"> return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> Optional<TestObj::Optional> parse<TestObj::Optional>(ExecState& state, JSValue value)
</del><ins>+template<> Optional<TestObj::Optional> parseEnumeration<TestObj::Optional>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> auto stringValue = value.toWTFString(&state);
</span><span class="cx"> if (stringValue.isEmpty())
</span><span class="lines">@@ -171,11 +171,11 @@
</span><span class="cx"> return Nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> TestObj::Optional convert<TestObj::Optional>(ExecState& state, JSValue value)
</del><ins>+template<> TestObj::Optional convertEnumeration<TestObj::Optional>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = state.vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>- auto result = parse<TestObj::Optional>(state, value);
</del><ins>+ auto result = parseEnumeration<TestObj::Optional>(state, value);
</ins><span class="cx"> if (UNLIKELY(!result)) {
</span><span class="cx"> throwTypeError(&state, throwScope);
</span><span class="cx"> return { };
</span><span class="lines">@@ -200,7 +200,7 @@
</span><span class="cx"> return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> Optional<AlternateEnumName> parse<AlternateEnumName>(ExecState& state, JSValue value)
</del><ins>+template<> Optional<AlternateEnumName> parseEnumeration<AlternateEnumName>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> auto stringValue = value.toWTFString(&state);
</span><span class="cx"> if (stringValue == "enumValue1")
</span><span class="lines">@@ -210,11 +210,11 @@
</span><span class="cx"> return Nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> AlternateEnumName convert<AlternateEnumName>(ExecState& state, JSValue value)
</del><ins>+template<> AlternateEnumName convertEnumeration<AlternateEnumName>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = state.vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>- auto result = parse<AlternateEnumName>(state, value);
</del><ins>+ auto result = parseEnumeration<AlternateEnumName>(state, value);
</ins><span class="cx"> if (UNLIKELY(!result)) {
</span><span class="cx"> throwTypeError(&state, throwScope);
</span><span class="cx"> return { };
</span><span class="lines">@@ -239,7 +239,7 @@
</span><span class="cx"> return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> Optional<TestObj::EnumA> parse<TestObj::EnumA>(ExecState& state, JSValue value)
</del><ins>+template<> Optional<TestObj::EnumA> parseEnumeration<TestObj::EnumA>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> auto stringValue = value.toWTFString(&state);
</span><span class="cx"> if (stringValue == "A")
</span><span class="lines">@@ -247,11 +247,11 @@
</span><span class="cx"> return Nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> TestObj::EnumA convert<TestObj::EnumA>(ExecState& state, JSValue value)
</del><ins>+template<> TestObj::EnumA convertEnumeration<TestObj::EnumA>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = state.vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>- auto result = parse<TestObj::EnumA>(state, value);
</del><ins>+ auto result = parseEnumeration<TestObj::EnumA>(state, value);
</ins><span class="cx"> if (UNLIKELY(!result)) {
</span><span class="cx"> throwTypeError(&state, throwScope);
</span><span class="cx"> return { };
</span><span class="lines">@@ -278,7 +278,7 @@
</span><span class="cx"> return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> Optional<TestObj::EnumB> parse<TestObj::EnumB>(ExecState& state, JSValue value)
</del><ins>+template<> Optional<TestObj::EnumB> parseEnumeration<TestObj::EnumB>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> auto stringValue = value.toWTFString(&state);
</span><span class="cx"> if (stringValue == "B")
</span><span class="lines">@@ -286,11 +286,11 @@
</span><span class="cx"> return Nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> TestObj::EnumB convert<TestObj::EnumB>(ExecState& state, JSValue value)
</del><ins>+template<> TestObj::EnumB convertEnumeration<TestObj::EnumB>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = state.vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>- auto result = parse<TestObj::EnumB>(state, value);
</del><ins>+ auto result = parseEnumeration<TestObj::EnumB>(state, value);
</ins><span class="cx"> if (UNLIKELY(!result)) {
</span><span class="cx"> throwTypeError(&state, throwScope);
</span><span class="cx"> return { };
</span><span class="lines">@@ -317,7 +317,7 @@
</span><span class="cx"> return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> Optional<TestObj::EnumC> parse<TestObj::EnumC>(ExecState& state, JSValue value)
</del><ins>+template<> Optional<TestObj::EnumC> parseEnumeration<TestObj::EnumC>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> auto stringValue = value.toWTFString(&state);
</span><span class="cx"> if (stringValue == "C")
</span><span class="lines">@@ -325,11 +325,11 @@
</span><span class="cx"> return Nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> TestObj::EnumC convert<TestObj::EnumC>(ExecState& state, JSValue value)
</del><ins>+template<> TestObj::EnumC convertEnumeration<TestObj::EnumC>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = state.vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>- auto result = parse<TestObj::EnumC>(state, value);
</del><ins>+ auto result = parseEnumeration<TestObj::EnumC>(state, value);
</ins><span class="cx"> if (UNLIKELY(!result)) {
</span><span class="cx"> throwTypeError(&state, throwScope);
</span><span class="cx"> return { };
</span><span class="lines">@@ -356,7 +356,7 @@
</span><span class="cx"> return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> Optional<TestObj::Kind> parse<TestObj::Kind>(ExecState& state, JSValue value)
</del><ins>+template<> Optional<TestObj::Kind> parseEnumeration<TestObj::Kind>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> auto stringValue = value.toWTFString(&state);
</span><span class="cx"> if (stringValue == "quick")
</span><span class="lines">@@ -366,11 +366,11 @@
</span><span class="cx"> return Nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> TestObj::Kind convert<TestObj::Kind>(ExecState& state, JSValue value)
</del><ins>+template<> TestObj::Kind convertEnumeration<TestObj::Kind>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = state.vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>- auto result = parse<TestObj::Kind>(state, value);
</del><ins>+ auto result = parseEnumeration<TestObj::Kind>(state, value);
</ins><span class="cx"> if (UNLIKELY(!result)) {
</span><span class="cx"> throwTypeError(&state, throwScope);
</span><span class="cx"> return { };
</span><span class="lines">@@ -395,7 +395,7 @@
</span><span class="cx"> return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> Optional<TestObj::Size> parse<TestObj::Size>(ExecState& state, JSValue value)
</del><ins>+template<> Optional<TestObj::Size> parseEnumeration<TestObj::Size>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> auto stringValue = value.toWTFString(&state);
</span><span class="cx"> if (stringValue == "small")
</span><span class="lines">@@ -405,11 +405,11 @@
</span><span class="cx"> return Nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> TestObj::Size convert<TestObj::Size>(ExecState& state, JSValue value)
</del><ins>+template<> TestObj::Size convertEnumeration<TestObj::Size>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = state.vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>- auto result = parse<TestObj::Size>(state, value);
</del><ins>+ auto result = parseEnumeration<TestObj::Size>(state, value);
</ins><span class="cx"> if (UNLIKELY(!result)) {
</span><span class="cx"> throwTypeError(&state, throwScope);
</span><span class="cx"> return { };
</span><span class="lines">@@ -434,7 +434,7 @@
</span><span class="cx"> return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> Optional<TestObj::Confidence> parse<TestObj::Confidence>(ExecState& state, JSValue value)
</del><ins>+template<> Optional<TestObj::Confidence> parseEnumeration<TestObj::Confidence>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> auto stringValue = value.toWTFString(&state);
</span><span class="cx"> if (stringValue == "high")
</span><span class="lines">@@ -444,11 +444,11 @@
</span><span class="cx"> return Nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> TestObj::Confidence convert<TestObj::Confidence>(ExecState& state, JSValue value)
</del><ins>+template<> TestObj::Confidence convertEnumeration<TestObj::Confidence>(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = state.vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>- auto result = parse<TestObj::Confidence>(state, value);
</del><ins>+ auto result = parseEnumeration<TestObj::Confidence>(state, value);
</ins><span class="cx"> if (UNLIKELY(!result)) {
</span><span class="cx"> throwTypeError(&state, throwScope);
</span><span class="cx"> return { };
</span><span class="lines">@@ -478,75 +478,75 @@
</span><span class="cx"> TestObj::Dictionary result;
</span><span class="cx"> JSValue anyTypedefValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyTypedefValue"));
</span><span class="cx"> if (!anyTypedefValueValue.isUndefined()) {
</span><del>- result.anyTypedefValue = convert<JSC::JSValue>(state, anyTypedefValueValue);
</del><ins>+ result.anyTypedefValue = convert<IDLAny>(state, anyTypedefValueValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.anyTypedefValue = jsUndefined();
</span><span class="cx"> JSValue anyValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyValue"));
</span><span class="cx"> if (!anyValueValue.isUndefined()) {
</span><del>- result.anyValue = convert<JSC::JSValue>(state, anyValueValue);
</del><ins>+ result.anyValue = convert<IDLAny>(state, anyValueValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.anyValue = jsUndefined();
</span><span class="cx"> JSValue anyValueWithNullDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyValueWithNullDefault"));
</span><span class="cx"> if (!anyValueWithNullDefaultValue.isUndefined()) {
</span><del>- result.anyValueWithNullDefault = convert<JSC::JSValue>(state, anyValueWithNullDefaultValue);
</del><ins>+ result.anyValueWithNullDefault = convert<IDLAny>(state, anyValueWithNullDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.anyValueWithNullDefault = jsNull();
</span><span class="cx"> JSValue booleanWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithDefault"));
</span><span class="cx"> if (!booleanWithDefaultValue.isUndefined()) {
</span><del>- result.booleanWithDefault = convert<bool>(state, booleanWithDefaultValue);
</del><ins>+ result.booleanWithDefault = convert<IDLBoolean>(state, booleanWithDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.booleanWithDefault = false;
</span><span class="cx"> JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
</span><span class="cx"> if (!booleanWithoutDefaultValue.isUndefined()) {
</span><del>- result.booleanWithoutDefault = convert<bool>(state, booleanWithoutDefaultValue);
</del><ins>+ result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue dictionaryMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "dictionaryMember"));
</span><span class="cx"> if (!dictionaryMemberValue.isUndefined()) {
</span><del>- Optional<TestObj::DictionaryThatShouldTolerateNull> dictionaryMember = convertDictionary<TestObj::DictionaryThatShouldTolerateNull>(state, dictionaryMemberValue).value();
</del><ins>+ auto dictionaryMemberOptional = convert<IDLDictionary<TestObj::DictionaryThatShouldTolerateNull>>(state, dictionaryMemberValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><del>- result.dictionaryMember = dictionaryMember.value();
</del><ins>+ result.dictionaryMember = dictionaryMemberOptional.value();
</ins><span class="cx"> }
</span><span class="cx"> JSValue enumerationValueWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithDefault"));
</span><span class="cx"> if (!enumerationValueWithDefaultValue.isUndefined()) {
</span><del>- result.enumerationValueWithDefault = convert<TestObj::EnumType>(state, enumerationValueWithDefaultValue);
</del><ins>+ result.enumerationValueWithDefault = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueWithDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.enumerationValueWithDefault = TestObj::EnumType::EnumValue1;
</span><span class="cx"> JSValue enumerationValueWithEmptyStringDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithEmptyStringDefault"));
</span><span class="cx"> if (!enumerationValueWithEmptyStringDefaultValue.isUndefined()) {
</span><del>- result.enumerationValueWithEmptyStringDefault = convert<TestObj::EnumType>(state, enumerationValueWithEmptyStringDefaultValue);
</del><ins>+ result.enumerationValueWithEmptyStringDefault = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueWithEmptyStringDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.enumerationValueWithEmptyStringDefault = TestObj::EnumType::EmptyString;
</span><span class="cx"> JSValue enumerationValueWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithoutDefault"));
</span><span class="cx"> if (!enumerationValueWithoutDefaultValue.isUndefined()) {
</span><del>- result.enumerationValueWithoutDefault = convert<TestObj::EnumType>(state, enumerationValueWithoutDefaultValue);
</del><ins>+ result.enumerationValueWithoutDefault = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueWithoutDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue integerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "integer"));
</span><span class="cx"> if (!integerValue.isUndefined()) {
</span><del>- result.integer = convert<int32_t>(state, integerValue, NormalConversion);
</del><ins>+ result.integer = convert<IDLLong>(state, integerValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue integerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "integerWithDefault"));
</span><span class="cx"> if (!integerWithDefaultValue.isUndefined()) {
</span><del>- result.integerWithDefault = convert<int32_t>(state, integerWithDefaultValue, NormalConversion);
</del><ins>+ result.integerWithDefault = convert<IDLLong>(state, integerWithDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.integerWithDefault = 0;
</span><span class="cx"> JSValue largeIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "largeInteger"));
</span><span class="cx"> if (!largeIntegerValue.isUndefined()) {
</span><del>- result.largeInteger = convert<int64_t>(state, largeIntegerValue, NormalConversion);
</del><ins>+ result.largeInteger = convert<IDLLongLong>(state, largeIntegerValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue largeIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "largeIntegerWithDefault"));
</span><span class="cx"> if (!largeIntegerWithDefaultValue.isUndefined()) {
</span><del>- result.largeIntegerWithDefault = convert<int64_t>(state, largeIntegerWithDefaultValue, NormalConversion);
</del><ins>+ result.largeIntegerWithDefault = convert<IDLLongLong>(state, largeIntegerWithDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.largeIntegerWithDefault = 0;
</span><span class="lines">@@ -558,7 +558,7 @@
</span><span class="cx"> result.nullableIntegerWithDefault = Nullopt;
</span><span class="cx"> JSValue nullableNodeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableNode"));
</span><span class="cx"> if (!nullableNodeValue.isUndefined()) {
</span><del>- result.nullableNode = convertWrapperType<Node, JSNode>(state, nullableNodeValue, IsNullable::Yes);
</del><ins>+ result.nullableNode = convert<IDLNullable<IDLInterface<Node>>>(state, nullableNodeValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.nullableNode = nullptr;
</span><span class="lines">@@ -570,104 +570,104 @@
</span><span class="cx"> result.nullableStringWithDefault = String();
</span><span class="cx"> JSValue restrictedDoubleValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedDouble"));
</span><span class="cx"> if (!restrictedDoubleValue.isUndefined()) {
</span><del>- result.restrictedDouble = convert<double>(state, restrictedDoubleValue, ShouldAllowNonFinite::No);
</del><ins>+ result.restrictedDouble = convert<IDLDouble>(state, restrictedDoubleValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue restrictedDoubleWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedDoubleWithDefault"));
</span><span class="cx"> if (!restrictedDoubleWithDefaultValue.isUndefined()) {
</span><del>- result.restrictedDoubleWithDefault = convert<double>(state, restrictedDoubleWithDefaultValue, ShouldAllowNonFinite::No);
</del><ins>+ result.restrictedDoubleWithDefault = convert<IDLDouble>(state, restrictedDoubleWithDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.restrictedDoubleWithDefault = 0;
</span><span class="cx"> JSValue restrictedFloatValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedFloat"));
</span><span class="cx"> if (!restrictedFloatValue.isUndefined()) {
</span><del>- result.restrictedFloat = convert<float>(state, restrictedFloatValue, ShouldAllowNonFinite::No);
</del><ins>+ result.restrictedFloat = convert<IDLFloat>(state, restrictedFloatValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue restrictedFloatWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedFloatWithDefault"));
</span><span class="cx"> if (!restrictedFloatWithDefaultValue.isUndefined()) {
</span><del>- result.restrictedFloatWithDefault = convert<float>(state, restrictedFloatWithDefaultValue, ShouldAllowNonFinite::No);
</del><ins>+ result.restrictedFloatWithDefault = convert<IDLFloat>(state, restrictedFloatWithDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.restrictedFloatWithDefault = 0;
</span><span class="cx"> JSValue sequenceOfStringsValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "sequenceOfStrings"));
</span><span class="cx"> if (!sequenceOfStringsValue.isUndefined()) {
</span><del>- result.sequenceOfStrings = convert<Vector<String>>(state, sequenceOfStringsValue);
</del><ins>+ result.sequenceOfStrings = convert<IDLSequence<IDLDOMString>>(state, sequenceOfStringsValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue smallIntegerClampedValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallIntegerClamped"));
</span><span class="cx"> if (!smallIntegerClampedValue.isUndefined()) {
</span><del>- result.smallIntegerClamped = convert<int8_t>(state, smallIntegerClampedValue, Clamp);
</del><ins>+ result.smallIntegerClamped = convert<IDLByte>(state, smallIntegerClampedValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue smallIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallIntegerWithDefault"));
</span><span class="cx"> if (!smallIntegerWithDefaultValue.isUndefined()) {
</span><del>- result.smallIntegerWithDefault = convert<int8_t>(state, smallIntegerWithDefaultValue, NormalConversion);
</del><ins>+ result.smallIntegerWithDefault = convert<IDLByte>(state, smallIntegerWithDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue smallUnsignedIntegerEnforcedRangeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerEnforcedRange"));
</span><span class="cx"> if (!smallUnsignedIntegerEnforcedRangeValue.isUndefined()) {
</span><del>- result.smallUnsignedIntegerEnforcedRange = convert<uint8_t>(state, smallUnsignedIntegerEnforcedRangeValue, EnforceRange);
</del><ins>+ result.smallUnsignedIntegerEnforcedRange = convert<IDLOctet>(state, smallUnsignedIntegerEnforcedRangeValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue smallUnsignedIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerWithDefault"));
</span><span class="cx"> if (!smallUnsignedIntegerWithDefaultValue.isUndefined()) {
</span><del>- result.smallUnsignedIntegerWithDefault = convert<uint8_t>(state, smallUnsignedIntegerWithDefaultValue, NormalConversion);
</del><ins>+ result.smallUnsignedIntegerWithDefault = convert<IDLOctet>(state, smallUnsignedIntegerWithDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.smallUnsignedIntegerWithDefault = 0;
</span><span class="cx"> JSValue stringWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithDefault"));
</span><span class="cx"> if (!stringWithDefaultValue.isUndefined()) {
</span><del>- result.stringWithDefault = convert<String>(state, stringWithDefaultValue);
</del><ins>+ result.stringWithDefault = convert<IDLDOMString>(state, stringWithDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.stringWithDefault = "defaultString";
</span><span class="cx"> JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
</span><span class="cx"> if (!stringWithoutDefaultValue.isUndefined()) {
</span><del>- result.stringWithoutDefault = convert<String>(state, stringWithoutDefaultValue);
</del><ins>+ result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue unrestrictedDoubleValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedDouble"));
</span><span class="cx"> if (!unrestrictedDoubleValue.isUndefined()) {
</span><del>- result.unrestrictedDouble = convert<double>(state, unrestrictedDoubleValue, ShouldAllowNonFinite::Yes);
</del><ins>+ result.unrestrictedDouble = convert<IDLUnrestrictedDouble>(state, unrestrictedDoubleValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue unrestrictedDoubleWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedDoubleWithDefault"));
</span><span class="cx"> if (!unrestrictedDoubleWithDefaultValue.isUndefined()) {
</span><del>- result.unrestrictedDoubleWithDefault = convert<double>(state, unrestrictedDoubleWithDefaultValue, ShouldAllowNonFinite::Yes);
</del><ins>+ result.unrestrictedDoubleWithDefault = convert<IDLUnrestrictedDouble>(state, unrestrictedDoubleWithDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.unrestrictedDoubleWithDefault = 0;
</span><span class="cx"> JSValue unrestrictedFloatValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedFloat"));
</span><span class="cx"> if (!unrestrictedFloatValue.isUndefined()) {
</span><del>- result.unrestrictedFloat = convert<float>(state, unrestrictedFloatValue, ShouldAllowNonFinite::Yes);
</del><ins>+ result.unrestrictedFloat = convert<IDLUnrestrictedFloat>(state, unrestrictedFloatValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue unrestrictedFloatWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedFloatWithDefault"));
</span><span class="cx"> if (!unrestrictedFloatWithDefaultValue.isUndefined()) {
</span><del>- result.unrestrictedFloatWithDefault = convert<float>(state, unrestrictedFloatWithDefaultValue, ShouldAllowNonFinite::Yes);
</del><ins>+ result.unrestrictedFloatWithDefault = convert<IDLUnrestrictedFloat>(state, unrestrictedFloatWithDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.unrestrictedFloatWithDefault = 0;
</span><span class="cx"> JSValue unsignedIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedInteger"));
</span><span class="cx"> if (!unsignedIntegerValue.isUndefined()) {
</span><del>- result.unsignedInteger = convert<uint32_t>(state, unsignedIntegerValue, NormalConversion);
</del><ins>+ result.unsignedInteger = convert<IDLUnsignedLong>(state, unsignedIntegerValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue unsignedIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedIntegerWithDefault"));
</span><span class="cx"> if (!unsignedIntegerWithDefaultValue.isUndefined()) {
</span><del>- result.unsignedIntegerWithDefault = convert<uint32_t>(state, unsignedIntegerWithDefaultValue, NormalConversion);
</del><ins>+ result.unsignedIntegerWithDefault = convert<IDLUnsignedLong>(state, unsignedIntegerWithDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.unsignedIntegerWithDefault = 0;
</span><span class="cx"> JSValue unsignedLargeIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedLargeInteger"));
</span><span class="cx"> if (!unsignedLargeIntegerValue.isUndefined()) {
</span><del>- result.unsignedLargeInteger = convert<uint64_t>(state, unsignedLargeIntegerValue, NormalConversion);
</del><ins>+ result.unsignedLargeInteger = convert<IDLUnsignedLongLong>(state, unsignedLargeIntegerValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue unsignedLargeIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedLargeIntegerWithDefault"));
</span><span class="cx"> if (!unsignedLargeIntegerWithDefaultValue.isUndefined()) {
</span><del>- result.unsignedLargeIntegerWithDefault = convert<uint64_t>(state, unsignedLargeIntegerWithDefaultValue, NormalConversion);
</del><ins>+ result.unsignedLargeIntegerWithDefault = convert<IDLUnsignedLongLong>(state, unsignedLargeIntegerWithDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else
</span><span class="cx"> result.unsignedLargeIntegerWithDefault = 0;
</span><span class="lines">@@ -691,12 +691,12 @@
</span><span class="cx"> TestObj::DictionaryThatShouldNotTolerateNull result;
</span><span class="cx"> JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
</span><span class="cx"> if (!booleanWithoutDefaultValue.isUndefined()) {
</span><del>- result.booleanWithoutDefault = convert<bool>(state, booleanWithoutDefaultValue);
</del><ins>+ result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue nonNullableNodeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nonNullableNode"));
</span><span class="cx"> if (!nonNullableNodeValue.isUndefined()) {
</span><del>- result.nonNullableNode = convertWrapperType<Node, JSNode>(state, nonNullableNodeValue, IsNullable::No);
</del><ins>+ result.nonNullableNode = convert<IDLInterface<Node>>(state, nonNullableNodeValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else {
</span><span class="cx"> throwTypeError(&state, throwScope);
</span><span class="lines">@@ -704,9 +704,9 @@
</span><span class="cx"> }
</span><span class="cx"> JSValue requiredDictionaryMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "requiredDictionaryMember"));
</span><span class="cx"> if (!requiredDictionaryMemberValue.isUndefined()) {
</span><del>- Optional<TestObj::Dictionary> requiredDictionaryMember = convertDictionary<TestObj::Dictionary>(state, requiredDictionaryMemberValue).value();
</del><ins>+ auto requiredDictionaryMemberOptional = convert<IDLDictionary<TestObj::Dictionary>>(state, requiredDictionaryMemberValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><del>- result.requiredDictionaryMember = requiredDictionaryMember.value();
</del><ins>+ result.requiredDictionaryMember = requiredDictionaryMemberOptional.value();
</ins><span class="cx"> } else {
</span><span class="cx"> throwTypeError(&state, throwScope);
</span><span class="cx"> return Nullopt;
</span><span class="lines">@@ -713,7 +713,7 @@
</span><span class="cx"> }
</span><span class="cx"> JSValue requiredEnumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "requiredEnumerationValue"));
</span><span class="cx"> if (!requiredEnumerationValueValue.isUndefined()) {
</span><del>- result.requiredEnumerationValue = convert<TestObj::EnumType>(state, requiredEnumerationValueValue);
</del><ins>+ result.requiredEnumerationValue = convert<IDLEnumeration<TestObj::EnumType>>(state, requiredEnumerationValueValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> } else {
</span><span class="cx"> throwTypeError(&state, throwScope);
</span><span class="lines">@@ -739,12 +739,12 @@
</span><span class="cx"> TestObj::DictionaryThatShouldTolerateNull result;
</span><span class="cx"> JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
</span><span class="cx"> if (!booleanWithoutDefaultValue.isUndefined()) {
</span><del>- result.booleanWithoutDefault = convert<bool>(state, booleanWithoutDefaultValue);
</del><ins>+ result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue enumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValue"));
</span><span class="cx"> if (!enumerationValueValue.isUndefined()) {
</span><del>- result.enumerationValue = convert<TestObj::EnumType>(state, enumerationValueValue);
</del><ins>+ result.enumerationValue = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> return WTFMove(result);
</span><span class="lines">@@ -767,12 +767,12 @@
</span><span class="cx"> AlternateDictionaryName result;
</span><span class="cx"> JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
</span><span class="cx"> if (!booleanWithoutDefaultValue.isUndefined()) {
</span><del>- result.booleanWithoutDefault = convert<bool>(state, booleanWithoutDefaultValue);
</del><ins>+ result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue enumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValue"));
</span><span class="cx"> if (!enumerationValueValue.isUndefined()) {
</span><del>- result.enumerationValue = convert<TestObj::EnumType>(state, enumerationValueValue);
</del><ins>+ result.enumerationValue = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> return WTFMove(result);
</span><span class="lines">@@ -795,12 +795,12 @@
</span><span class="cx"> TestObj::ParentDictionary result;
</span><span class="cx"> JSValue parentMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember1"));
</span><span class="cx"> if (!parentMember1Value.isUndefined()) {
</span><del>- result.parentMember1 = convert<bool>(state, parentMember1Value);
</del><ins>+ result.parentMember1 = convert<IDLBoolean>(state, parentMember1Value);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue parentMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember2"));
</span><span class="cx"> if (!parentMember2Value.isUndefined()) {
</span><del>- result.parentMember2 = convert<bool>(state, parentMember2Value);
</del><ins>+ result.parentMember2 = convert<IDLBoolean>(state, parentMember2Value);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> return WTFMove(result);
</span><span class="lines">@@ -823,22 +823,22 @@
</span><span class="cx"> TestObj::ChildDictionary result;
</span><span class="cx"> JSValue parentMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember1"));
</span><span class="cx"> if (!parentMember1Value.isUndefined()) {
</span><del>- result.parentMember1 = convert<bool>(state, parentMember1Value);
</del><ins>+ result.parentMember1 = convert<IDLBoolean>(state, parentMember1Value);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue parentMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember2"));
</span><span class="cx"> if (!parentMember2Value.isUndefined()) {
</span><del>- result.parentMember2 = convert<bool>(state, parentMember2Value);
</del><ins>+ result.parentMember2 = convert<IDLBoolean>(state, parentMember2Value);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue childMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "childMember1"));
</span><span class="cx"> if (!childMember1Value.isUndefined()) {
</span><del>- result.childMember1 = convert<bool>(state, childMember1Value);
</del><ins>+ result.childMember1 = convert<IDLBoolean>(state, childMember1Value);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue childMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "childMember2"));
</span><span class="cx"> if (!childMember2Value.isUndefined()) {
</span><del>- result.childMember2 = convert<bool>(state, childMember2Value);
</del><ins>+ result.childMember2 = convert<IDLBoolean>(state, childMember2Value);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> return WTFMove(result);
</span><span class="lines">@@ -3247,7 +3247,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>- auto nativeValue = parse<TestObj::EnumType>(*state, value);
</del><ins>+ auto nativeValue = parseEnumeration<TestObj::EnumType>(*state, value);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> if (UNLIKELY(!nativeValue))
</span><span class="cx"> return false;
</span><span class="lines">@@ -3268,7 +3268,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>- auto nativeValue = convert<int8_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLByte>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setByteAttr(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3287,7 +3287,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>- auto nativeValue = convert<uint8_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLOctet>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setOctetAttr(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3306,7 +3306,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>- auto nativeValue = convert<int16_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLShort>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setShortAttr(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3325,7 +3325,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>- auto nativeValue = convert<int16_t>(*state, value, Clamp);
</del><ins>+ auto nativeValue = convert<IDLShort>(*state, value, Clamp);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setClampedShortAttr(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3344,7 +3344,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>- auto nativeValue = convert<int16_t>(*state, value, EnforceRange);
</del><ins>+ auto nativeValue = convert<IDLShort>(*state, value, EnforceRange);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setEnforceRangeShortAttr(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3363,7 +3363,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>- auto nativeValue = convert<uint16_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLUnsignedShort>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setUnsignedShortAttr(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3382,7 +3382,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setLongAttr(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3401,7 +3401,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>- auto nativeValue = convert<int64_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLongLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setLongLongAttr(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3420,7 +3420,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>- auto nativeValue = convert<uint64_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLUnsignedLongLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setUnsignedLongLongAttr(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3584,7 +3584,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>- auto nativeValue = parse<AlternateEnumName>(*state, value);
</del><ins>+ auto nativeValue = parseEnumeration<AlternateEnumName>(*state, value);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> if (UNLIKELY(!nativeValue))
</span><span class="cx"> return false;
</span><span class="lines">@@ -3627,7 +3627,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>- auto nativeValue = value.toBoolean(state);
</del><ins>+ auto nativeValue = convert<IDLBoolean>(*state, value);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setCreate(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3684,7 +3684,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3703,7 +3703,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>- auto nativeValue = convert<uint32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLUnsignedLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3722,7 +3722,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>- auto nativeValue = value.toBoolean(state);
</del><ins>+ auto nativeValue = convert<IDLBoolean>(*state, value);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3798,7 +3798,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3817,7 +3817,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>- auto nativeValue = value.toBoolean(state);
</del><ins>+ auto nativeValue = convert<IDLBoolean>(*state, value);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3899,7 +3899,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setAttributeWithGetterException(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3918,7 +3918,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setAttributeWithGetterLegacyException(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3937,7 +3937,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> propagateException(*state, throwScope, impl.setAttributeWithSetterException(WTFMove(nativeValue)));
</span><span class="cx"> return true;
</span><span class="lines">@@ -3957,7 +3957,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setAttributeWithSetterLegacyException(WTFMove(nativeValue), ec);
</span><span class="cx"> setDOMException(state, throwScope, ec);
</span><span class="lines">@@ -4065,7 +4065,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setWithScriptStateAttribute(*state, WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -4084,7 +4084,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setWithCallWithAndSetterCallWithAttribute(*state, activeDOMWindow(state), firstDOMWindow(state), WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -4273,7 +4273,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setConditionalAttr1(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -4294,7 +4294,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setConditionalAttr2(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -4315,7 +4315,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setConditionalAttr3(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -4389,7 +4389,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>- auto nativeValue = value;
</del><ins>+ auto nativeValue = convert<IDLAny>(*state, value);
+ RETURN_IF_EXCEPTION(throwScope, false);
</ins><span class="cx"> impl.setAnyAttribute(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -4457,7 +4458,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setBlueberry(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -4476,7 +4477,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setId(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -4511,7 +4512,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLNullable<IDLLong>>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setNullableLongSettableAttribute(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -4568,7 +4569,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLNullable<IDLLong>>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setNullableStringValue(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -4587,7 +4588,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>- auto nativeValue = parse<TestObj::Optional>(*state, value);
</del><ins>+ auto nativeValue = parseEnumeration<TestObj::Optional>(*state, value);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> if (UNLIKELY(!nativeValue))
</span><span class="cx"> return false;
</span><span class="lines">@@ -4707,7 +4708,7 @@
</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 testParam = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto testParam = convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.enabledAtRuntimeOperation(WTFMove(testParam));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -4764,7 +4765,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 3))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto longArg = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto longArg = convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto strArg = state->uncheckedArgument(1).toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="lines">@@ -4803,7 +4804,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 3))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto byteArg = convert<int8_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto byteArg = convert<IDLByte>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto strArg = state->uncheckedArgument(1).toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="lines">@@ -4842,7 +4843,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 3))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto octetArg = convert<uint8_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto octetArg = convert<IDLOctet>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto strArg = state->uncheckedArgument(1).toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="lines">@@ -4881,7 +4882,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 3))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto longArg = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto longArg = convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto strArg = state->uncheckedArgument(1).toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="lines">@@ -4920,7 +4921,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 3))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto longArg = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto longArg = convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto strArg = state->uncheckedArgument(1).toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="lines">@@ -5023,7 +5024,7 @@
</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 index = convert<uint32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> JSValue result = jsStringOrNull(state, impl.nullableStringSpecialMethod(WTFMove(index)));
</span><span class="cx"> return JSValue::encode(result);
</span><span class="lines">@@ -5044,7 +5045,7 @@
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto enumArgValue = state->uncheckedArgument(0);
</span><span class="cx"> TestObj::EnumType enumArg;
</span><del>- auto optionalValue = parse<TestObj::EnumType>(*state, enumArgValue);
</del><ins>+ auto optionalValue = parseEnumeration<TestObj::EnumType>(*state, enumArgValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> if (UNLIKELY(!optionalValue))
</span><span class="cx"> return throwArgumentMustBeEnumError(*state, throwScope, 0, "enumArg", "TestObject", "methodWithEnumArg", expectedEnumerationValues<TestObj::EnumType>());
</span><span class="lines">@@ -5067,7 +5068,7 @@
</span><span class="cx"> auto enumArgValue = state->argument(0);
</span><span class="cx"> Optional<TestObj::EnumType> enumArg;
</span><span class="cx"> if (!enumArgValue.isUndefined()) {
</span><del>- enumArg = parse<TestObj::EnumType>(*state, enumArgValue);
</del><ins>+ enumArg = parseEnumeration<TestObj::EnumType>(*state, enumArgValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> if (UNLIKELY(!enumArg))
</span><span class="cx"> return throwArgumentMustBeEnumError(*state, throwScope, 0, "enumArg", "TestObject", "methodWithOptionalEnumArg", expectedEnumerationValues<TestObj::EnumType>());
</span><span class="lines">@@ -5092,7 +5093,7 @@
</span><span class="cx"> if (enumArgValue.isUndefined())
</span><span class="cx"> enumArg = TestObj::EnumType::EnumValue1;
</span><span class="cx"> else {
</span><del>- auto optionalValue = parse<TestObj::EnumType>(*state, enumArgValue);
</del><ins>+ auto optionalValue = parseEnumeration<TestObj::EnumType>(*state, enumArgValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> if (UNLIKELY(!optionalValue))
</span><span class="cx"> return throwArgumentMustBeEnumError(*state, throwScope, 0, "enumArg", "TestObject", "methodWithOptionalEnumArgAndDefaultValue", expectedEnumerationValues<TestObj::EnumType>());
</span><span class="lines">@@ -5366,7 +5367,7 @@
</span><span class="cx"> auto listener = JSEventListener::create(state->uncheckedArgument(1), *castedThis, false, currentWorld(state));
</span><span class="cx"> if (UNLIKELY(!listener))
</span><span class="cx"> return throwArgumentTypeError(*state, throwScope, 1, "listener", "TestObject", "addEventListener", "EventListener");
</span><del>- auto useCapture = state->argument(2).toBoolean(state);
</del><ins>+ auto useCapture = convert<IDLBoolean>(*state, state->argument(2));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.addEventListener(WTFMove(type), *listener, WTFMove(useCapture));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5390,7 +5391,7 @@
</span><span class="cx"> auto listener = JSEventListener::create(state->uncheckedArgument(1), *castedThis, false, currentWorld(state));
</span><span class="cx"> if (UNLIKELY(!listener))
</span><span class="cx"> return throwArgumentTypeError(*state, throwScope, 1, "listener", "TestObject", "removeEventListener", "EventListener");
</span><del>- auto useCapture = state->argument(2).toBoolean(state);
</del><ins>+ auto useCapture = convert<IDLBoolean>(*state, state->argument(2));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.removeEventListener(WTFMove(type), *listener, WTFMove(useCapture));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5620,7 +5621,7 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "methodWithOptionalArg");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto opt = state->argument(0).isUndefined() ? Optional<int32_t>() : convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto opt = state->argument(0).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithOptionalArg(WTFMove(opt));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5637,7 +5638,7 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "methodWithOptionalArgAndDefaultValue");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto opt = state->argument(0).isUndefined() ? 666 : convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto opt = state->argument(0).isUndefined() ? 666 : convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithOptionalArgAndDefaultValue(WTFMove(opt));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5656,9 +5657,9 @@
</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 nonOpt = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto nonOpt = convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto opt = state->argument(1).isUndefined() ? Optional<int32_t>() : convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion);
</del><ins>+ auto opt = state->argument(1).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(1), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithNonOptionalArgAndOptionalArg(WTFMove(nonOpt), WTFMove(opt));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5677,11 +5678,11 @@
</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 nonOpt = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto nonOpt = convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto opt1 = state->argument(1).isUndefined() ? Optional<int32_t>() : convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion);
</del><ins>+ auto opt1 = state->argument(1).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(1), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto opt2 = state->argument(2).isUndefined() ? Optional<int32_t>() : convert<int32_t>(*state, state->uncheckedArgument(2), NormalConversion);
</del><ins>+ auto opt2 = state->argument(2).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(2), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithNonOptionalArgAndTwoOptionalArgs(WTFMove(nonOpt), WTFMove(opt1), WTFMove(opt2));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5885,7 +5886,7 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "methodWithOptionalDoubleIsNaN");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto number = convert<double>(*state, state->argument(0), ShouldAllowNonFinite::Yes);
</del><ins>+ auto number = convert<IDLUnrestrictedDouble>(*state, state->argument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithOptionalDoubleIsNaN(WTFMove(number));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5902,7 +5903,7 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "methodWithOptionalFloatIsNaN");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto number = convert<float>(*state, state->argument(0), ShouldAllowNonFinite::Yes);
</del><ins>+ auto number = convert<IDLUnrestrictedFloat>(*state, state->argument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithOptionalFloatIsNaN(WTFMove(number));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5919,7 +5920,7 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "methodWithOptionalLongLong");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto number = state->argument(0).isUndefined() ? Optional<int64_t>() : convert<int64_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto number = state->argument(0).isUndefined() ? Optional<int64_t>() : convert<IDLLongLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithOptionalLongLong(WTFMove(number));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5936,7 +5937,7 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "methodWithOptionalLongLongIsZero");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto number = convert<int64_t>(*state, state->argument(0), NormalConversion);
</del><ins>+ auto number = convert<IDLLongLong>(*state, state->argument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithOptionalLongLongIsZero(WTFMove(number));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5953,7 +5954,7 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "methodWithOptionalUnsignedLongLong");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto number = state->argument(0).isUndefined() ? Optional<uint64_t>() : convert<uint64_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto number = state->argument(0).isUndefined() ? Optional<uint64_t>() : convert<IDLUnsignedLongLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithOptionalUnsignedLongLong(WTFMove(number));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5970,7 +5971,7 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "methodWithOptionalUnsignedLongLongIsZero");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto number = convert<uint64_t>(*state, state->argument(0), NormalConversion);
</del><ins>+ auto number = convert<IDLUnsignedLongLong>(*state, state->argument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithOptionalUnsignedLongLongIsZero(WTFMove(number));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5987,7 +5988,7 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "methodWithOptionalSequence");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto array = state->argument(0).isUndefined() ? Optional<Vector<String>>() : toNativeArray<String>(*state, state->uncheckedArgument(0));
</del><ins>+ auto array = state->argument(0).isUndefined() ? Optional<Vector<String>>() : convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithOptionalSequence(WTFMove(array));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6004,7 +6005,7 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "methodWithOptionalSequenceIsEmpty");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto array = state->argument(0).isUndefined() ? Vector<String>() : toNativeArray<String>(*state, state->uncheckedArgument(0));
</del><ins>+ auto array = state->argument(0).isUndefined() ? Vector<String>() : convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithOptionalSequenceIsEmpty(WTFMove(array));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6021,7 +6022,7 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "methodWithOptionalBoolean");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto b = state->argument(0).isUndefined() ? Optional<bool>() : state->uncheckedArgument(0).toBoolean(state);
</del><ins>+ auto b = state->argument(0).isUndefined() ? Optional<bool>() : convert<IDLBoolean>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithOptionalBoolean(WTFMove(b));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6038,7 +6039,7 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "methodWithOptionalBooleanIsFalse");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto b = state->argument(0).toBoolean(state);
</del><ins>+ auto b = convert<IDLBoolean>(*state, state->argument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithOptionalBooleanIsFalse(WTFMove(b));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6055,7 +6056,8 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "methodWithOptionalAny");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto a = state->argument(0);
</del><ins>+ auto a = convert<IDLAny>(*state, state->argument(0));
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.methodWithOptionalAny(WTFMove(a));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6157,7 +6159,7 @@
</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>- auto nonCallback = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto nonCallback = convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> if (UNLIKELY(!state->uncheckedArgument(1).isObject()))
</span><span class="cx"> return throwArgumentMustBeFunctionError(*state, throwScope, 1, "callback", "TestObject", "methodWithNonCallbackArgAndCallbackArg");
</span><span class="lines">@@ -6220,7 +6222,7 @@
</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>- auto nonCallback = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto nonCallback = convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> if (UNLIKELY(!state->uncheckedArgument(1).isFunction()))
</span><span class="cx"> return throwArgumentMustBeFunctionError(*state, throwScope, 1, "callback", "TestObject", "methodWithNonCallbackArgAndCallbackFunctionArg");
</span><span class="lines">@@ -6377,7 +6379,7 @@
</span><span class="cx"> if (UNLIKELY(!objArg))
</span><span class="cx"> return throwArgumentTypeError(*state, throwScope, 0, "objArg", "TestObject", "overloadedMethod", "TestObj");
</span><span class="cx"> }
</span><del>- auto longArg = state->argument(1).isUndefined() ? Optional<int32_t>() : convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion);
</del><ins>+ auto longArg = state->argument(1).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(1), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.overloadedMethod(WTFMove(objArg), WTFMove(longArg));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6415,7 +6417,7 @@
</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 longArg = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto longArg = convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.overloadedMethod(WTFMove(longArg));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6477,7 +6479,7 @@
</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 arrayArg = toNativeArray<String>(*state, state->uncheckedArgument(0));
</del><ins>+ auto arrayArg = convert<IDLNullable<IDLSequence<IDLDOMString>>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.overloadedMethod(WTFMove(arrayArg));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6536,7 +6538,7 @@
</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 arrayArg = toNativeArray<String>(*state, state->uncheckedArgument(0));
</del><ins>+ auto arrayArg = convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.overloadedMethod(WTFMove(arrayArg));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6555,7 +6557,7 @@
</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 arrayArg = toNativeArray<uint32_t>(*state, state->uncheckedArgument(0));
</del><ins>+ auto arrayArg = convert<IDLSequence<IDLUnsignedLong>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.overloadedMethod(WTFMove(arrayArg));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6687,7 +6689,7 @@
</span><span class="cx"> if (UNLIKELY(!objArg))
</span><span class="cx"> return throwArgumentTypeError(*state, throwScope, 0, "objArg", "TestObject", "overloadedMethodWithOptionalParameter", "TestObj");
</span><span class="cx"> }
</span><del>- auto longArg = state->argument(1).isUndefined() ? Optional<int32_t>() : convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion);
</del><ins>+ auto longArg = state->argument(1).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(1), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.overloadedMethodWithOptionalParameter(WTFMove(objArg), WTFMove(longArg));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6732,7 +6734,7 @@
</span><span class="cx"> VM& vm = state->vm();
</span><span class="cx"> auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><del>- auto arg = state->argument(0).isUndefined() ? Optional<int32_t>() : convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto arg = state->argument(0).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> JSValue result = jsNumber(TestObj::classMethodWithOptional(WTFMove(arg)));
</span><span class="cx"> return JSValue::encode(result);
</span><span class="lines">@@ -6756,7 +6758,7 @@
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto arg = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto arg = convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> TestObj::overloadedMethod1(WTFMove(arg));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6814,9 +6816,9 @@
</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>- auto objArgsShort = convert<uint16_t>(*state, state->uncheckedArgument(0), Clamp);
</del><ins>+ auto objArgsShort = convert<IDLUnsignedShort>(*state, state->uncheckedArgument(0), Clamp);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto objArgsLong = convert<uint32_t>(*state, state->uncheckedArgument(1), Clamp);
</del><ins>+ auto objArgsLong = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(1), Clamp);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.classMethodWithClamp(WTFMove(objArgsShort), WTFMove(objArgsLong));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6835,9 +6837,9 @@
</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>- auto objArgsShort = convert<uint16_t>(*state, state->uncheckedArgument(0), EnforceRange);
</del><ins>+ auto objArgsShort = convert<IDLUnsignedShort>(*state, state->uncheckedArgument(0), EnforceRange);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto objArgsLong = convert<uint32_t>(*state, state->uncheckedArgument(1), EnforceRange);
</del><ins>+ auto objArgsLong = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(1), EnforceRange);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.classMethodWithEnforceRange(WTFMove(objArgsShort), WTFMove(objArgsLong));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6856,7 +6858,7 @@
</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 unsignedLongSequence = toNativeArray<uint32_t>(*state, state->uncheckedArgument(0));
</del><ins>+ auto unsignedLongSequence = convert<IDLSequence<IDLUnsignedLong>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithUnsignedLongSequence(WTFMove(unsignedLongSequence));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6876,7 +6878,7 @@
</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 = toNativeArray<String>(*state, state->uncheckedArgument(0));
</del><ins>+ auto values = convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> JSValue result = jsArray(state, castedThis->globalObject(), impl.stringArrayFunction(WTFMove(values), ec));
</span><span class="cx">
</span><span class="lines">@@ -6920,9 +6922,9 @@
</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>- auto arrayArg = toNativeArray<uint32_t>(*state, state->uncheckedArgument(0));
</del><ins>+ auto arrayArg = convert<IDLSequence<IDLUnsignedLong>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto nullableArrayArg = toNativeArray<uint32_t>(*state, state->uncheckedArgument(1));
</del><ins>+ auto nullableArrayArg = convert<IDLNullable<IDLSequence<IDLUnsignedLong>>>(*state, state->uncheckedArgument(1));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithAndWithoutNullableSequence(WTFMove(arrayArg), WTFMove(nullableArrayArg));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7127,7 +7129,7 @@
</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 = convert<double>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes);
</del><ins>+ auto head = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto tail = convertVariadicArguments<IDLUnrestrictedDouble>(*state, 1);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="lines">@@ -7191,9 +7193,9 @@
</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>- auto a = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes);
</del><ins>+ auto a = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto b = convert<int32_t>(*state, state->uncheckedArgument(1), NormalConversion);
</del><ins>+ auto b = convert<IDLLong>(*state, state->uncheckedArgument(1), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.any(WTFMove(a), WTFMove(b));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7243,7 +7245,7 @@
</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 a = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::No);
</del><ins>+ auto a = convert<IDLFloat>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.testPromiseFunctionWithFloatArgument(WTFMove(a), WTFMove(promise));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7293,7 +7295,7 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "testPromiseFunctionWithOptionalIntArgument");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto a = state->argument(0).isUndefined() ? Optional<int32_t>() : convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto a = state->argument(0).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.testPromiseFunctionWithOptionalIntArgument(WTFMove(a), WTFMove(promise));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7320,7 +7322,7 @@
</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 a = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::No);
</del><ins>+ auto a = convert<IDLFloat>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.testPromiseOverloadedFunction(WTFMove(a), WTFMove(promise));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7474,7 +7476,7 @@
</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 a = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto a = convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.conditionalOverload(WTFMove(a));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7536,7 +7538,7 @@
</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 a = convert<int32_t>(*state, state->uncheckedArgument(0), NormalConversion);
</del><ins>+ auto a = convert<IDLLong>(*state, state->uncheckedArgument(0), NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.singleConditionalOverload(WTFMove(a));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7574,7 +7576,7 @@
</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 init = convertDictionary<TestObj::Dictionary>(*state, state->uncheckedArgument(0));
</del><ins>+ auto init = convert<IDLDictionary<TestObj::Dictionary>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.attachShadowRoot(init.value());
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7593,7 +7595,7 @@
</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 dict = convertDictionary<TestStandaloneDictionary>(*state, state->uncheckedArgument(0));
</del><ins>+ auto dict = convert<IDLDictionary<TestStandaloneDictionary>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.operationWithExternalDictionaryParameter(dict.value());
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -112,8 +112,8 @@
</span><span class="cx"> static JSC::JSString* arrayJSValue(JSC::ExecState* state, JSDOMGlobalObject*, TestObj::EnumType value) { return jsStringWithCache(state, value); }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> Optional<TestObj::EnumType> parse<TestObj::EnumType>(JSC::ExecState&, JSC::JSValue);
-template<> TestObj::EnumType convert<TestObj::EnumType>(JSC::ExecState&, JSC::JSValue);
</del><ins>+template<> Optional<TestObj::EnumType> parseEnumeration<TestObj::EnumType>(JSC::ExecState&, JSC::JSValue);
+template<> TestObj::EnumType convertEnumeration<TestObj::EnumType>(JSC::ExecState&, JSC::JSValue);
</ins><span class="cx"> template<> const char* expectedEnumerationValues<TestObj::EnumType>();
</span><span class="cx">
</span><span class="cx"> JSC::JSString* jsStringWithCache(JSC::ExecState*, TestObj::Optional);
</span><span class="lines">@@ -122,8 +122,8 @@
</span><span class="cx"> static JSC::JSString* arrayJSValue(JSC::ExecState* state, JSDOMGlobalObject*, TestObj::Optional value) { return jsStringWithCache(state, value); }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> Optional<TestObj::Optional> parse<TestObj::Optional>(JSC::ExecState&, JSC::JSValue);
-template<> TestObj::Optional convert<TestObj::Optional>(JSC::ExecState&, JSC::JSValue);
</del><ins>+template<> Optional<TestObj::Optional> parseEnumeration<TestObj::Optional>(JSC::ExecState&, JSC::JSValue);
+template<> TestObj::Optional convertEnumeration<TestObj::Optional>(JSC::ExecState&, JSC::JSValue);
</ins><span class="cx"> template<> const char* expectedEnumerationValues<TestObj::Optional>();
</span><span class="cx">
</span><span class="cx"> JSC::JSString* jsStringWithCache(JSC::ExecState*, AlternateEnumName);
</span><span class="lines">@@ -132,8 +132,8 @@
</span><span class="cx"> static JSC::JSString* arrayJSValue(JSC::ExecState* state, JSDOMGlobalObject*, AlternateEnumName value) { return jsStringWithCache(state, value); }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> Optional<AlternateEnumName> parse<AlternateEnumName>(JSC::ExecState&, JSC::JSValue);
-template<> AlternateEnumName convert<AlternateEnumName>(JSC::ExecState&, JSC::JSValue);
</del><ins>+template<> Optional<AlternateEnumName> parseEnumeration<AlternateEnumName>(JSC::ExecState&, JSC::JSValue);
+template<> AlternateEnumName convertEnumeration<AlternateEnumName>(JSC::ExecState&, JSC::JSValue);
</ins><span class="cx"> template<> const char* expectedEnumerationValues<AlternateEnumName>();
</span><span class="cx">
</span><span class="cx"> #if ENABLE(Condition1)
</span><span class="lines">@@ -144,8 +144,8 @@
</span><span class="cx"> static JSC::JSString* arrayJSValue(JSC::ExecState* state, JSDOMGlobalObject*, TestObj::EnumA value) { return jsStringWithCache(state, value); }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> Optional<TestObj::EnumA> parse<TestObj::EnumA>(JSC::ExecState&, JSC::JSValue);
-template<> TestObj::EnumA convert<TestObj::EnumA>(JSC::ExecState&, JSC::JSValue);
</del><ins>+template<> Optional<TestObj::EnumA> parseEnumeration<TestObj::EnumA>(JSC::ExecState&, JSC::JSValue);
+template<> TestObj::EnumA convertEnumeration<TestObj::EnumA>(JSC::ExecState&, JSC::JSValue);
</ins><span class="cx"> template<> const char* expectedEnumerationValues<TestObj::EnumA>();
</span><span class="cx">
</span><span class="cx"> #endif
</span><span class="lines">@@ -158,8 +158,8 @@
</span><span class="cx"> static JSC::JSString* arrayJSValue(JSC::ExecState* state, JSDOMGlobalObject*, TestObj::EnumB value) { return jsStringWithCache(state, value); }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> Optional<TestObj::EnumB> parse<TestObj::EnumB>(JSC::ExecState&, JSC::JSValue);
-template<> TestObj::EnumB convert<TestObj::EnumB>(JSC::ExecState&, JSC::JSValue);
</del><ins>+template<> Optional<TestObj::EnumB> parseEnumeration<TestObj::EnumB>(JSC::ExecState&, JSC::JSValue);
+template<> TestObj::EnumB convertEnumeration<TestObj::EnumB>(JSC::ExecState&, JSC::JSValue);
</ins><span class="cx"> template<> const char* expectedEnumerationValues<TestObj::EnumB>();
</span><span class="cx">
</span><span class="cx"> #endif
</span><span class="lines">@@ -172,8 +172,8 @@
</span><span class="cx"> static JSC::JSString* arrayJSValue(JSC::ExecState* state, JSDOMGlobalObject*, TestObj::EnumC value) { return jsStringWithCache(state, value); }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> Optional<TestObj::EnumC> parse<TestObj::EnumC>(JSC::ExecState&, JSC::JSValue);
-template<> TestObj::EnumC convert<TestObj::EnumC>(JSC::ExecState&, JSC::JSValue);
</del><ins>+template<> Optional<TestObj::EnumC> parseEnumeration<TestObj::EnumC>(JSC::ExecState&, JSC::JSValue);
+template<> TestObj::EnumC convertEnumeration<TestObj::EnumC>(JSC::ExecState&, JSC::JSValue);
</ins><span class="cx"> template<> const char* expectedEnumerationValues<TestObj::EnumC>();
</span><span class="cx">
</span><span class="cx"> #endif
</span><span class="lines">@@ -184,8 +184,8 @@
</span><span class="cx"> static JSC::JSString* arrayJSValue(JSC::ExecState* state, JSDOMGlobalObject*, TestObj::Kind value) { return jsStringWithCache(state, value); }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> Optional<TestObj::Kind> parse<TestObj::Kind>(JSC::ExecState&, JSC::JSValue);
-template<> TestObj::Kind convert<TestObj::Kind>(JSC::ExecState&, JSC::JSValue);
</del><ins>+template<> Optional<TestObj::Kind> parseEnumeration<TestObj::Kind>(JSC::ExecState&, JSC::JSValue);
+template<> TestObj::Kind convertEnumeration<TestObj::Kind>(JSC::ExecState&, JSC::JSValue);
</ins><span class="cx"> template<> const char* expectedEnumerationValues<TestObj::Kind>();
</span><span class="cx">
</span><span class="cx"> JSC::JSString* jsStringWithCache(JSC::ExecState*, TestObj::Size);
</span><span class="lines">@@ -194,8 +194,8 @@
</span><span class="cx"> static JSC::JSString* arrayJSValue(JSC::ExecState* state, JSDOMGlobalObject*, TestObj::Size value) { return jsStringWithCache(state, value); }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> Optional<TestObj::Size> parse<TestObj::Size>(JSC::ExecState&, JSC::JSValue);
-template<> TestObj::Size convert<TestObj::Size>(JSC::ExecState&, JSC::JSValue);
</del><ins>+template<> Optional<TestObj::Size> parseEnumeration<TestObj::Size>(JSC::ExecState&, JSC::JSValue);
+template<> TestObj::Size convertEnumeration<TestObj::Size>(JSC::ExecState&, JSC::JSValue);
</ins><span class="cx"> template<> const char* expectedEnumerationValues<TestObj::Size>();
</span><span class="cx">
</span><span class="cx"> JSC::JSString* jsStringWithCache(JSC::ExecState*, TestObj::Confidence);
</span><span class="lines">@@ -204,8 +204,8 @@
</span><span class="cx"> static JSC::JSString* arrayJSValue(JSC::ExecState* state, JSDOMGlobalObject*, TestObj::Confidence value) { return jsStringWithCache(state, value); }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<> Optional<TestObj::Confidence> parse<TestObj::Confidence>(JSC::ExecState&, JSC::JSValue);
-template<> TestObj::Confidence convert<TestObj::Confidence>(JSC::ExecState&, JSC::JSValue);
</del><ins>+template<> Optional<TestObj::Confidence> parseEnumeration<TestObj::Confidence>(JSC::ExecState&, JSC::JSValue);
+template<> TestObj::Confidence convertEnumeration<TestObj::Confidence>(JSC::ExecState&, JSC::JSValue);
</ins><span class="cx"> template<> const char* expectedEnumerationValues<TestObj::Confidence>();
</span><span class="cx">
</span><span class="cx"> template<> Optional<TestObj::Dictionary> convertDictionary<TestObj::Dictionary>(JSC::ExecState&, JSC::JSValue);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsWithSequencecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #include "ExceptionCode.h"
</span><span class="cx"> #include "JSDOMBinding.h"
</span><span class="cx"> #include "JSDOMConstructor.h"
</span><ins>+#include "JSDOMConvert.h"
</ins><span class="cx"> #include <runtime/Error.h>
</span><span class="cx"> #include <runtime/FunctionPrototype.h>
</span><span class="cx"> #include <wtf/GetPtr.h>
</span><span class="lines">@@ -71,7 +72,7 @@
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto* castedThis = jsCast<JSTestOverloadedConstructorsWithSequenceConstructor*>(state->callee());
</span><span class="cx"> ASSERT(castedThis);
</span><del>- auto sequenceOfStrings = state->argument(0).isUndefined() ? Vector<String>() : toNativeArray<String>(*state, state->uncheckedArgument(0));
</del><ins>+ auto sequenceOfStrings = state->argument(0).isUndefined() ? Vector<String>() : convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto object = TestOverloadedConstructorsWithSequence::create(WTFMove(sequenceOfStrings));
</span><span class="cx"> return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestStandaloneDictionarycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -43,12 +43,12 @@
</span><span class="cx"> TestStandaloneDictionary result;
</span><span class="cx"> JSValue boolMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "boolMember"));
</span><span class="cx"> if (!boolMemberValue.isUndefined()) {
</span><del>- result.boolMember = convert<bool>(state, boolMemberValue);
</del><ins>+ result.boolMember = convert<IDLBoolean>(state, boolMemberValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> JSValue stringMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringMember"));
</span><span class="cx"> if (!stringMemberValue.isUndefined()) {
</span><del>- result.stringMember = convert<String>(state, stringMemberValue);
</del><ins>+ result.stringMember = convert<IDLDOMString>(state, stringMemberValue);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx"> }
</span><span class="cx"> return WTFMove(result);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include "JSDOMConstructor.h"
</span><span class="cx"> #include "JSDOMConvert.h"
</span><span class="cx"> #include "JSSVGPoint.h"
</span><del>-#include "JSSerializedScriptValue.h"
</del><span class="cx"> #include "JSTestCallback.h"
</span><span class="cx"> #include "JSTestEventTarget.h"
</span><span class="cx"> #include "JSTestSubObj.h"
</span><span class="lines">@@ -38,6 +37,7 @@
</span><span class="cx"> #include <runtime/JSArray.h>
</span><span class="cx"> #include <runtime/JSString.h>
</span><span class="cx"> #include <wtf/GetPtr.h>
</span><ins>+#include <wtf/Variant.h>
</ins><span class="cx">
</span><span class="cx"> using namespace JSC;
</span><span class="cx">
</span><span class="lines">@@ -49,6 +49,9 @@
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionSetShadow(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionMethodWithSequenceArg(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableSequenceArg(JSC::ExecState*);
</span><ins>+JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionSequenceOfNullablesArg(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArg(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionUnionArg(JSC::ExecState*);
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionFuncWithClamp(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionImmutablePointFunction(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionStringSequenceFunction(JSC::ExecState*);
</span><span class="lines">@@ -171,6 +174,9 @@
</span><span class="cx"> { "setShadow", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionSetShadow), (intptr_t) (3) } },
</span><span class="cx"> { "methodWithSequenceArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionMethodWithSequenceArg), (intptr_t) (1) } },
</span><span class="cx"> { "nullableSequenceArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionNullableSequenceArg), (intptr_t) (1) } },
</span><ins>+ { "sequenceOfNullablesArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionSequenceOfNullablesArg), (intptr_t) (1) } },
+ { "nullableSequenceOfNullablesArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArg), (intptr_t) (1) } },
+ { "unionArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionUnionArg), (intptr_t) (1) } },
</ins><span class="cx"> { "funcWithClamp", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionFuncWithClamp), (intptr_t) (1) } },
</span><span class="cx"> { "immutablePointFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionImmutablePointFunction), (intptr_t) (0) } },
</span><span class="cx"> { "stringSequenceFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionStringSequenceFunction), (intptr_t) (1) } },
</span><span class="lines">@@ -365,7 +371,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>- auto nativeValue = convert<uint64_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLUnsignedLongLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setUnsignedLongLongAttr(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -403,7 +409,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setAttrWithGetterException(WTFMove(nativeValue));
</span><span class="cx"> return true;
</span><span class="lines">@@ -423,7 +429,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>- auto nativeValue = convert<int32_t>(*state, value, NormalConversion);
</del><ins>+ auto nativeValue = convert<IDLLong>(*state, value, NormalConversion);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx"> impl.setAttrWithSetterException(WTFMove(nativeValue), ec);
</span><span class="cx"> setDOMException(state, throwScope, ec);
</span><span class="lines">@@ -487,7 +493,7 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestTypedefs", "func");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestTypedefs::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto x = state->argument(0).isUndefined() ? Vector<int32_t>() : toNativeArray<int32_t>(*state, state->uncheckedArgument(0));
</del><ins>+ auto x = state->argument(0).isUndefined() ? Vector<int32_t>() : convert<IDLSequence<IDLLong>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.func(WTFMove(x));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -506,15 +512,15 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 3))
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><del>- auto width = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes);
</del><ins>+ auto width = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto height = convert<float>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes);
</del><ins>+ auto height = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto blur = convert<float>(*state, state->uncheckedArgument(2), ShouldAllowNonFinite::Yes);
</del><ins>+ auto blur = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto color = state->argument(3).isUndefined() ? String() : state->uncheckedArgument(3).toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto alpha = state->argument(4).isUndefined() ? Optional<float>() : convert<float>(*state, state->uncheckedArgument(4), ShouldAllowNonFinite::Yes);
</del><ins>+ auto alpha = state->argument(4).isUndefined() ? Optional<float>() : convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.setShadow(WTFMove(width), WTFMove(height), WTFMove(blur), WTFMove(color), WTFMove(alpha));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -533,7 +539,7 @@
</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 sequenceArg = toRefPtrNativeArray<SerializedScriptValue, JSSerializedScriptValue>(*state, state->uncheckedArgument(0));
</del><ins>+ auto sequenceArg = convert<IDLSequence<IDLInterface<SerializedScriptValue>>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> JSValue result = jsNumber(impl.methodWithSequenceArg(WTFMove(sequenceArg)));
</span><span class="cx"> return JSValue::encode(result);
</span><span class="lines">@@ -552,12 +558,69 @@
</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 sequenceArg = toNativeArray<String>(*state, state->uncheckedArgument(0));
</del><ins>+ auto sequenceArg = convert<IDLNullable<IDLSequence<IDLDOMString>>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.nullableSequenceArg(WTFMove(sequenceArg));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionSequenceOfNullablesArg(ExecState* state)
+{
+ VM& vm = state->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ UNUSED_PARAM(throwScope);
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestTypedefs*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, throwScope, "TestTypedefs", "sequenceOfNullablesArg");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestTypedefs::info());
+ auto& impl = castedThis->wrapped();
+ if (UNLIKELY(state->argumentCount() < 1))
+ return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
+ auto sequenceArg = convert<IDLSequence<IDLNullable<IDLDOMString>>>(*state, state->uncheckedArgument(0));
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+ impl.sequenceOfNullablesArg(WTFMove(sequenceArg));
+ return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArg(ExecState* state)
+{
+ VM& vm = state->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ UNUSED_PARAM(throwScope);
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestTypedefs*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, throwScope, "TestTypedefs", "nullableSequenceOfNullablesArg");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestTypedefs::info());
+ auto& impl = castedThis->wrapped();
+ if (UNLIKELY(state->argumentCount() < 1))
+ return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
+ auto sequenceArg = convert<IDLNullable<IDLSequence<IDLNullable<IDLDOMString>>>>(*state, state->uncheckedArgument(0));
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+ impl.nullableSequenceOfNullablesArg(WTFMove(sequenceArg));
+ return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionUnionArg(ExecState* state)
+{
+ VM& vm = state->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ UNUSED_PARAM(throwScope);
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestTypedefs*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, throwScope, "TestTypedefs", "unionArg");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestTypedefs::info());
+ auto& impl = castedThis->wrapped();
+ if (UNLIKELY(state->argumentCount() < 1))
+ return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
+ auto unionArg = convert<IDLUnion<IDLDOMString, IDLLong>>(*state, state->uncheckedArgument(0));
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+ impl.unionArg(WTFMove(unionArg));
+ return JSValue::encode(jsUndefined());
+}
+
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionFuncWithClamp(ExecState* state)
</span><span class="cx"> {
</span><span class="cx"> VM& vm = state->vm();
</span><span class="lines">@@ -571,9 +634,9 @@
</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 arg1 = convert<uint64_t>(*state, state->uncheckedArgument(0), Clamp);
</del><ins>+ auto arg1 = convert<IDLUnsignedLongLong>(*state, state->uncheckedArgument(0), Clamp);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto arg2 = state->argument(1).isUndefined() ? Optional<uint64_t>() : convert<uint64_t>(*state, state->uncheckedArgument(1), Clamp);
</del><ins>+ auto arg2 = state->argument(1).isUndefined() ? Optional<uint64_t>() : convert<IDLUnsignedLongLong>(*state, state->uncheckedArgument(1), Clamp);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.funcWithClamp(WTFMove(arg1), WTFMove(arg2));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -608,7 +671,7 @@
</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 = toNativeArray<String>(*state, state->uncheckedArgument(0));
</del><ins>+ auto values = convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> JSValue result = jsArray(state, castedThis->globalObject(), impl.stringSequenceFunction(WTFMove(values), ec));
</span><span class="cx">
</span><span class="lines">@@ -630,7 +693,7 @@
</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 = toNativeArray<String>(*state, state->uncheckedArgument(0));
</del><ins>+ auto values = convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> JSValue result = jsArray(state, castedThis->globalObject(), impl.stringSequenceFunction2(WTFMove(values), ec));
</span><span class="cx">
</span><span class="lines">@@ -651,7 +714,7 @@
</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 sequenceArg = toRefPtrNativeArray<TestEventTarget, JSTestEventTarget>(*state, state->uncheckedArgument(0));
</del><ins>+ auto sequenceArg = convert<IDLSequence<IDLInterface<TestEventTarget>>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> JSValue result = jsBoolean(impl.callWithSequenceThatRequiresInclude(WTFMove(sequenceArg)));
</span><span class="cx"> return JSValue::encode(result);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestTypedefsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> // This IDL file is for testing the bindings code generator and for tracking
</span><del>-// changes in its ouput.
</del><ins>+// changes in its output.
</ins><span class="cx">
</span><span class="cx"> [
</span><span class="cx"> Constructor(STRING hello, TEST_CALLBACK testCallback),
</span><span class="lines">@@ -47,7 +47,11 @@
</span><span class="cx"> ULONGLONG methodWithSequenceArg(sequence<SCRIPT_VALUE> sequenceArg);
</span><span class="cx">
</span><span class="cx"> void nullableSequenceArg(SEQUENCE_OF_STRINGS? sequenceArg);
</span><ins>+ void sequenceOfNullablesArg(sequence<STRING?> sequenceArg);
+ void nullableSequenceOfNullablesArg(SEQUENCE_OF_NULLABLE_STRINGS? sequenceArg);
</ins><span class="cx">
</span><ins>+ void unionArg(UNION_STRING_LONG unionArg);
+
</ins><span class="cx"> void funcWithClamp(ULONGLONG_CLAMP arg1, optional ULONGLONG_CLAMP arg2);
</span><span class="cx">
</span><span class="cx"> [Immutable] SVGPOINT immutablePointFunction();
</span><span class="lines">@@ -70,11 +74,14 @@
</span><span class="cx"> typedef [Clamp] unsigned long long ULONGLONG_CLAMP;
</span><span class="cx"> typedef SerializedScriptValue SCRIPT_VALUE;
</span><span class="cx"> typedef sequence<long> SEQUENCE_OF_LONGS;
</span><ins>+typedef long? NULLABLE_LONG;
</ins><span class="cx"> typedef SVGPoint SVGPOINT;
</span><span class="cx"> typedef DOMString STRING;
</span><span class="cx"> typedef sequence<DOMString> SEQUENCE_OF_STRINGS;
</span><ins>+typedef sequence<DOMString?> SEQUENCE_OF_NULLABLE_STRINGS;
</ins><span class="cx"> typedef TestCallback TEST_CALLBACK;
</span><span class="cx"> typedef TestSubObjConstructor T;
</span><span class="cx"> typedef Int32Array ARRAY;
</span><span class="cx"> typedef DOMException E;
</span><span class="cx"> typedef TestEventTarget TEST_EVENT_TARGET;
</span><ins>+typedef (DOMString or long) UNION_STRING_LONG;
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.idl (207149 => 207150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.idl        2016-10-11 17:05:04 UTC (rev 207149)
+++ trunk/Source/WebCore/testing/InternalSettings.idl        2016-10-11 17:33:45 UTC (rev 207150)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">
</span><span class="cx"> // Editing, forms
</span><span class="cx"> [MayThrowLegacyException] void setEditingBehavior(DOMString behavior);
</span><del>- [MayThrowLegacyException] void setShouldConvertPositionStyleOnCopy(boolean convert);
</del><ins>+ [MayThrowLegacyException] void setShouldConvertPositionStyleOnCopy(boolean convertPosition);
</ins><span class="cx"> void setLangAttributeAwareFormControlUIEnabled(boolean enabled);
</span><span class="cx"> [MayThrowLegacyException] void setPreferMIMETypeForImages(boolean preferMimeTypeForImage);
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>