<!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>[206776] trunk/Source/WebCore</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/206776">206776</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-10-04 11:51:44 -0700 (Tue, 04 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Web IDL] Add support for dictionary inheritance
https://bugs.webkit.org/show_bug.cgi?id=162907

Reviewed by Sam Weinig.

Add support for dictionary inheritance to our Web IDL parser and
bindings generator. Leverage this new support for EventTarget's
EventListenerOptions / AddEventListenerOptions dictionaries, in
order to match the DOM specification:
- https://dom.spec.whatwg.org/#interface-eventtarget

Also update the bindings generator to convert the dictionary
members in lexicographical order, as per:
- https://heycam.github.io/webidl/#es-dictionary (Step 5.1)

No new tests, rebaselined bindings tests.

* bindings/scripts/CodeGenerator.pm:
(GetDictionaryByName):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/IDLParser.pm:
(parseDictionary):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary&lt;TestObj::Dictionary&gt;):
(WebCore::convertDictionary&lt;TestObj::DictionaryThatShouldNotTolerateNull&gt;):
(WebCore::convertDictionary&lt;TestObj::DictionaryThatShouldTolerateNull&gt;):
(WebCore::convertDictionary&lt;AlternateDictionaryName&gt;):
(WebCore::convertDictionary&lt;TestObj::ParentDictionary&gt;):
(WebCore::convertDictionary&lt;TestObj::ChildDictionary&gt;):
* bindings/scripts/test/TestObj.idl:
* dom/EventTarget.idl:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
<li><a href="#trunkSourceWebCoredomEventTargetidl">trunk/Source/WebCore/dom/EventTarget.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206775 => 206776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-04 18:45:20 UTC (rev 206775)
+++ trunk/Source/WebCore/ChangeLog        2016-10-04 18:51:44 UTC (rev 206776)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2016-10-04  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        [Web IDL] Add support for dictionary inheritance
+        https://bugs.webkit.org/show_bug.cgi?id=162907
+
+        Reviewed by Sam Weinig.
+
+        Add support for dictionary inheritance to our Web IDL parser and
+        bindings generator. Leverage this new support for EventTarget's
+        EventListenerOptions / AddEventListenerOptions dictionaries, in
+        order to match the DOM specification:
+        - https://dom.spec.whatwg.org/#interface-eventtarget
+
+        Also update the bindings generator to convert the dictionary
+        members in lexicographical order, as per:
+        - https://heycam.github.io/webidl/#es-dictionary (Step 5.1)
+
+        No new tests, rebaselined bindings tests.
+
+        * bindings/scripts/CodeGenerator.pm:
+        (GetDictionaryByName):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateDictionaryImplementationContent):
+        * bindings/scripts/IDLParser.pm:
+        (parseDictionary):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::convertDictionary&lt;TestObj::Dictionary&gt;):
+        (WebCore::convertDictionary&lt;TestObj::DictionaryThatShouldNotTolerateNull&gt;):
+        (WebCore::convertDictionary&lt;TestObj::DictionaryThatShouldTolerateNull&gt;):
+        (WebCore::convertDictionary&lt;AlternateDictionaryName&gt;):
+        (WebCore::convertDictionary&lt;TestObj::ParentDictionary&gt;):
+        (WebCore::convertDictionary&lt;TestObj::ChildDictionary&gt;):
+        * bindings/scripts/test/TestObj.idl:
+        * dom/EventTarget.idl:
+
</ins><span class="cx"> 2016-10-04  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win][Direct2D] Add initial D2D GraphicsContext implementation
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (206775 => 206776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-10-04 18:45:20 UTC (rev 206775)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-10-04 18:51:44 UTC (rev 206776)
</span><span class="lines">@@ -455,6 +455,16 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub GetDictionaryByName
+{
+    my ($object, $name) = @_;
+    return unless defined($name);
+
+    for my $dictionary (@{$useDocument-&gt;dictionaries}) {
+        return $dictionary if $dictionary-&gt;name eq $name;
+    }
+}
+
</ins><span class="cx"> sub HasDictionaryImplementationNameOverride
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (206775 => 206776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-04 18:45:20 UTC (rev 206775)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-04 18:51:44 UTC (rev 206776)
</span><span class="lines">@@ -953,10 +953,10 @@
</span><span class="cx"> 
</span><span class="cx"> sub GenerateDictionaryImplementationContent
</span><span class="cx"> {
</span><del>-    my ($interface, $dictionaries) = @_;
</del><ins>+    my ($interface, $allDictionaries) = @_;
</ins><span class="cx"> 
</span><span class="cx">     my $result = &quot;&quot;;
</span><del>-    foreach my $dictionary (@$dictionaries) {
</del><ins>+    foreach my $dictionary (@$allDictionaries) {
</ins><span class="cx">         my $name = $dictionary-&gt;name;
</span><span class="cx"> 
</span><span class="cx">         my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($dictionary);
</span><span class="lines">@@ -988,79 +988,90 @@
</span><span class="cx">         $result .= &quot;    }\n&quot;;
</span><span class="cx"> 
</span><span class="cx">         # 3. Let dict be an empty dictionary value of type D; every dictionary member is initially considered to be not present.
</span><ins>+
</ins><span class="cx">         # 4. Let dictionaries be a list consisting of D and all of D’s inherited dictionaries, in order from least to most derived.
</span><del>-        # FIXME: We do not support dictionary inheritence yet.
</del><ins>+        my @dictionaries;
+        push(@dictionaries, $dictionary);
+        my $parentDictionary = $codeGenerator-&gt;GetDictionaryByName($dictionary-&gt;parent);
+        while (defined($parentDictionary)) {
+            unshift(@dictionaries, $parentDictionary);
+            $parentDictionary = $codeGenerator-&gt;GetDictionaryByName($parentDictionary-&gt;parent);
+        }
</ins><span class="cx"> 
</span><ins>+        my $arguments = &quot;&quot;;
+        my $comma = &quot;&quot;;
+
</ins><span class="cx">         # 5. For each dictionary dictionary in dictionaries, in order:
</span><del>-        foreach my $member (@{$dictionary-&gt;members}) {
-            $member-&gt;default(&quot;undefined&quot;) if $member-&gt;type eq &quot;any&quot;; # Use undefined as default value for member of type 'any'.
</del><ins>+        foreach my $dictionary (@dictionaries) {
+            # For each dictionary member member declared on dictionary, in lexicographical order:
+            my @sortedMembers = sort { $a-&gt;name cmp $b-&gt;name } @{$dictionary-&gt;members};
+            foreach my $member (@sortedMembers) {
+                $member-&gt;default(&quot;undefined&quot;) if $member-&gt;type eq &quot;any&quot;; # Use undefined as default value for member of type 'any'.
</ins><span class="cx"> 
</span><del>-            my $type = $member-&gt;type;
</del><ins>+                my $type = $member-&gt;type;
</ins><span class="cx"> 
</span><del>-            # 5.1. Let key be the identifier of member.
-            my $key = $member-&gt;name;
</del><ins>+                # 5.1. Let key be the identifier of member.
+                my $key = $member-&gt;name;
</ins><span class="cx"> 
</span><del>-            # 5.2. Let value be an ECMAScript value, depending on Type(V):
-            $result .= &quot;    JSValue ${key}Value = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, \&quot;${key}\&quot;));\n&quot;;
</del><ins>+                # 5.2. Let value be an ECMAScript value, depending on Type(V):
+                $result .= &quot;    JSValue ${key}Value = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, \&quot;${key}\&quot;));\n&quot;;
</ins><span class="cx"> 
</span><del>-            my $nativeType = GetNativeTypeFromSignature($interface, $member);
-            if ($member-&gt;isOptional &amp;&amp; !defined $member-&gt;default) {
-                $result .= &quot;    Converter&lt;$nativeType&gt;::OptionalValue $key;\n&quot;;
-            } else {
-                $result .= &quot;    $nativeType $key;\n&quot;;
-            }
</del><ins>+                my $nativeType = GetNativeTypeFromSignature($interface, $member);
+                if ($member-&gt;isOptional &amp;&amp; !defined $member-&gt;default) {
+                    $result .= &quot;    Converter&lt;$nativeType&gt;::OptionalValue $key;\n&quot;;
+                } else {
+                    $result .= &quot;    $nativeType $key;\n&quot;;
+                }
</ins><span class="cx"> 
</span><del>-            # 5.3. If value is not undefined, then:
-            $result .= &quot;    if (!${key}Value.isUndefined()) {\n&quot;;
-            # FIXME: Eventually we will want this to share a lot more code with JSValueToNative.
-            if ($codeGenerator-&gt;IsWrapperType($type)) {
-                AddToImplIncludes(&quot;JS${type}.h&quot;);
-                die &quot;Dictionary members of non-nullable wrapper types must be marked as required&quot; if !$member-&gt;isNullable &amp;&amp; $member-&gt;isOptional;
-                my $nullableParameter = $member-&gt;isNullable ? &quot;IsNullable::Yes&quot; : &quot;IsNullable::No&quot;;
-                $result .= &quot;        $key = convertWrapperType&lt;$type, JS${type}&gt;(state, ${key}Value, $nullableParameter);\n&quot;;
-            } elsif ($codeGenerator-&gt;IsDictionaryType($type)) {
-                my $nativeType = GetNativeType($interface, $type);
-                $result .= &quot;        $key = convertDictionary&lt;${nativeType}&gt;(state, ${key}Value);\n&quot;;
-            } else {
-                my $conversionRuleWithLeadingComma = GenerateConversionRuleWithLeadingComma($interface, $member);
-                $result .= &quot;        $key = convert&lt;${nativeType}&gt;(state, ${key}Value${conversionRuleWithLeadingComma});\n&quot;;
</del><ins>+                # 5.3. If value is not undefined, then:
+                $result .= &quot;    if (!${key}Value.isUndefined()) {\n&quot;;
+                # FIXME: Eventually we will want this to share a lot more code with JSValueToNative.
+                if ($codeGenerator-&gt;IsWrapperType($type)) {
+                    AddToImplIncludes(&quot;JS${type}.h&quot;);
+                    die &quot;Dictionary members of non-nullable wrapper types must be marked as required&quot; if !$member-&gt;isNullable &amp;&amp; $member-&gt;isOptional;
+                    my $nullableParameter = $member-&gt;isNullable ? &quot;IsNullable::Yes&quot; : &quot;IsNullable::No&quot;;
+                    $result .= &quot;        $key = convertWrapperType&lt;$type, JS${type}&gt;(state, ${key}Value, $nullableParameter);\n&quot;;
+                } elsif ($codeGenerator-&gt;IsDictionaryType($type)) {
+                    my $nativeType = GetNativeType($interface, $type);
+                    $result .= &quot;        $key = convertDictionary&lt;${nativeType}&gt;(state, ${key}Value);\n&quot;;
+                } else {
+                    my $conversionRuleWithLeadingComma = GenerateConversionRuleWithLeadingComma($interface, $member);
+                    $result .= &quot;        $key = convert&lt;${nativeType}&gt;(state, ${key}Value${conversionRuleWithLeadingComma});\n&quot;;
+                }
+                $result .= &quot;        RETURN_IF_EXCEPTION(throwScope, Nullopt);\n&quot;;
+                # Value is undefined.
+                # 5.4. Otherwise, if value is undefined but the dictionary member has a default value, then:
+                if ($member-&gt;isOptional &amp;&amp; defined $member-&gt;default) {
+                    $result .= &quot;    } else\n&quot;;
+                    $result .= &quot;        $key = &quot; . GenerateDefaultValue($interface, $member) . &quot;;\n&quot;;
+                } elsif (!$member-&gt;isOptional) {
+                    # 5.5. Otherwise, if value is undefined and the dictionary member is a required dictionary member, then throw a TypeError.
+                    $result .= &quot;    } else {\n&quot;;
+                    $result .= &quot;        throwTypeError(&amp;state, throwScope);\n&quot;;
+                    $result .= &quot;        return Nullopt;\n&quot;;
+                    $result .= &quot;    }\n&quot;;
+                } else {
+                    $result .= &quot;    }\n&quot;;
+                }
</ins><span class="cx">             }
</span><del>-            $result .= &quot;        RETURN_IF_EXCEPTION(throwScope, Nullopt);\n&quot;;
-            # Value is undefined.
-            # 5.4. Otherwise, if value is undefined but the dictionary member has a default value, then:
-            if ($member-&gt;isOptional &amp;&amp; defined $member-&gt;default) {
-                $result .= &quot;    } else\n&quot;;
-                $result .= &quot;        $key = &quot; . GenerateDefaultValue($interface, $member) . &quot;;\n&quot;;
-            } elsif (!$member-&gt;isOptional) {
-                # 5.5. Otherwise, if value is undefined and the dictionary member is a required dictionary member, then throw a TypeError.
-                $result .= &quot;    } else {\n&quot;;
-                $result .= &quot;        throwTypeError(&amp;state, throwScope);\n&quot;;
-                $result .= &quot;        return Nullopt;\n&quot;;
-                $result .= &quot;    }\n&quot;;
-            } else {
-                $result .= &quot;    }\n&quot;;
-            }
-        }
</del><span class="cx"> 
</span><del>-        # 6. Return dict.
-        my $arguments = &quot;&quot;;
-        my $comma = &quot;&quot;;
-        foreach my $member (@{$dictionary-&gt;members}) {
-            my $value;
-            if ($codeGenerator-&gt;IsWrapperType($member-&gt;type) &amp;&amp; !$member-&gt;isNullable) {
-                $value = &quot;*&quot; . $member-&gt;name;
-            } elsif ($codeGenerator-&gt;IsDictionaryType($member-&gt;type)) {
-                $value = $member-&gt;name . &quot;.value()&quot;;
-            } else {
-                $value = &quot;WTFMove(&quot; . $member-&gt;name . &quot;)&quot;;
</del><ins>+            # 6. Return dict.
+            foreach my $member (@{$dictionary-&gt;members}) {
+                my $value;
+                if ($codeGenerator-&gt;IsWrapperType($member-&gt;type) &amp;&amp; !$member-&gt;isNullable) {
+                    $value = &quot;*&quot; . $member-&gt;name;
+                } elsif ($codeGenerator-&gt;IsDictionaryType($member-&gt;type)) {
+                    $value = $member-&gt;name . &quot;.value()&quot;;
+                } else {
+                    $value = &quot;WTFMove(&quot; . $member-&gt;name . &quot;)&quot;;
+                }
+                $arguments .= $comma . $value;
+                $comma = &quot;, &quot;;
</ins><span class="cx">             }
</span><del>-            $arguments .= $comma . $value;
-            $comma = &quot;, &quot;;
</del><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         $result .= &quot;    return $className { &quot; . $arguments . &quot; };\n&quot;;
</span><span class="cx">         $result .= &quot;}\n\n&quot;;
</span><del>-
</del><span class="cx">         $result .= &quot;#endif\n\n&quot; if $conditionalString;
</span><span class="cx">     }
</span><span class="cx">     return $result;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLParserpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (206775 => 206776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-10-04 18:45:20 UTC (rev 206775)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-10-04 18:51:44 UTC (rev 206776)
</span><span class="lines">@@ -130,6 +130,7 @@
</span><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> struct( domDictionary =&gt; {
</span><ins>+    parent =&gt; '$',  # Parent class identifier
</ins><span class="cx">     name =&gt; '$',
</span><span class="cx">     members =&gt; '@', # List of 'domSignature'
</span><span class="cx">     extendedAttributes =&gt; '$',
</span><span class="lines">@@ -659,7 +660,8 @@
</span><span class="cx">         my $nameToken = $self-&gt;getToken();
</span><span class="cx">         $self-&gt;assertTokenType($nameToken, IdentifierToken);
</span><span class="cx">         $dictionary-&gt;name($nameToken-&gt;value());
</span><del>-        $self-&gt;parseInheritance();
</del><ins>+        my $parents = $self-&gt;parseInheritance();
+        $dictionary-&gt;parent($parents-&gt;[0]);
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;{&quot;, __LINE__);
</span><span class="cx">         $dictionary-&gt;members($self-&gt;parseDictionaryMembers());
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;}&quot;, __LINE__);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (206775 => 206776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-04 18:45:20 UTC (rev 206775)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-04 18:51:44 UTC (rev 206776)
</span><span class="lines">@@ -530,12 +530,39 @@
</span><span class="cx">         throwTypeError(&amp;state, throwScope);
</span><span class="cx">         return Nullopt;
</span><span class="cx">     }
</span><del>-    JSValue enumerationValueWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;enumerationValueWithoutDefault&quot;));
-    Converter&lt;TestObj::EnumType&gt;::OptionalValue enumerationValueWithoutDefault;
-    if (!enumerationValueWithoutDefaultValue.isUndefined()) {
-        enumerationValueWithoutDefault = convert&lt;TestObj::EnumType&gt;(state, enumerationValueWithoutDefaultValue);
</del><ins>+    JSValue anyTypedefValueValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;anyTypedefValue&quot;));
+    JSC::JSValue anyTypedefValue;
+    if (!anyTypedefValueValue.isUndefined()) {
+        anyTypedefValue = convert&lt;JSC::JSValue&gt;(state, anyTypedefValueValue);
</ins><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><ins>+    } else
+        anyTypedefValue = jsUndefined();
+    JSValue anyValueValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;anyValue&quot;));
+    JSC::JSValue anyValue;
+    if (!anyValueValue.isUndefined()) {
+        anyValue = convert&lt;JSC::JSValue&gt;(state, anyValueValue);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    } else
+        anyValue = jsUndefined();
+    JSValue booleanWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithDefault&quot;));
+    bool booleanWithDefault;
+    if (!booleanWithDefaultValue.isUndefined()) {
+        booleanWithDefault = convert&lt;bool&gt;(state, booleanWithDefaultValue);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    } else
+        booleanWithDefault = false;
+    JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithoutDefault&quot;));
+    Converter&lt;bool&gt;::OptionalValue booleanWithoutDefault;
+    if (!booleanWithoutDefaultValue.isUndefined()) {
+        booleanWithoutDefault = convert&lt;bool&gt;(state, booleanWithoutDefaultValue);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
</ins><span class="cx">     }
</span><ins>+    JSValue dictionaryMemberValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;dictionaryMember&quot;));
+    Converter&lt;TestObj::DictionaryThatShouldTolerateNull&gt;::OptionalValue dictionaryMember;
+    if (!dictionaryMemberValue.isUndefined()) {
+        dictionaryMember = convertDictionary&lt;TestObj::DictionaryThatShouldTolerateNull&gt;(state, dictionaryMemberValue);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    }
</ins><span class="cx">     JSValue enumerationValueWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;enumerationValueWithDefault&quot;));
</span><span class="cx">     TestObj::EnumType enumerationValueWithDefault;
</span><span class="cx">     if (!enumerationValueWithDefaultValue.isUndefined()) {
</span><span class="lines">@@ -550,38 +577,45 @@
</span><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx">     } else
</span><span class="cx">         enumerationValueWithEmptyStringDefault = TestObj::EnumType::EmptyString;
</span><del>-    JSValue stringWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;stringWithDefault&quot;));
-    String stringWithDefault;
-    if (!stringWithDefaultValue.isUndefined()) {
-        stringWithDefault = convert&lt;String&gt;(state, stringWithDefaultValue);
</del><ins>+    JSValue enumerationValueWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;enumerationValueWithoutDefault&quot;));
+    Converter&lt;TestObj::EnumType&gt;::OptionalValue enumerationValueWithoutDefault;
+    if (!enumerationValueWithoutDefaultValue.isUndefined()) {
+        enumerationValueWithoutDefault = convert&lt;TestObj::EnumType&gt;(state, enumerationValueWithoutDefaultValue);
</ins><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><del>-    } else
-        stringWithDefault = &quot;defaultString&quot;;
-    JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;stringWithoutDefault&quot;));
-    Converter&lt;String&gt;::OptionalValue stringWithoutDefault;
-    if (!stringWithoutDefaultValue.isUndefined()) {
-        stringWithoutDefault = convert&lt;String&gt;(state, stringWithoutDefaultValue);
</del><ins>+    }
+    JSValue integerValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;integer&quot;));
+    Converter&lt;int32_t&gt;::OptionalValue integer;
+    if (!integerValue.isUndefined()) {
+        integer = convert&lt;int32_t&gt;(state, integerValue, NormalConversion);
</ins><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx">     }
</span><del>-    JSValue booleanWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithDefault&quot;));
-    bool booleanWithDefault;
-    if (!booleanWithDefaultValue.isUndefined()) {
-        booleanWithDefault = convert&lt;bool&gt;(state, booleanWithDefaultValue);
</del><ins>+    JSValue integerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;integerWithDefault&quot;));
+    int32_t integerWithDefault;
+    if (!integerWithDefaultValue.isUndefined()) {
+        integerWithDefault = convert&lt;int32_t&gt;(state, integerWithDefaultValue, NormalConversion);
</ins><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx">     } else
</span><del>-        booleanWithDefault = false;
-    JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithoutDefault&quot;));
-    Converter&lt;bool&gt;::OptionalValue booleanWithoutDefault;
-    if (!booleanWithoutDefaultValue.isUndefined()) {
-        booleanWithoutDefault = convert&lt;bool&gt;(state, booleanWithoutDefaultValue);
</del><ins>+        integerWithDefault = 0;
+    JSValue largeIntegerValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;largeInteger&quot;));
+    Converter&lt;int64_t&gt;::OptionalValue largeInteger;
+    if (!largeIntegerValue.isUndefined()) {
+        largeInteger = convert&lt;int64_t&gt;(state, largeIntegerValue, NormalConversion);
</ins><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx">     }
</span><del>-    JSValue sequenceOfStringsValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;sequenceOfStrings&quot;));
-    Converter&lt;Vector&lt;String&gt;&gt;::OptionalValue sequenceOfStrings;
-    if (!sequenceOfStringsValue.isUndefined()) {
-        sequenceOfStrings = convert&lt;Vector&lt;String&gt;&gt;(state, sequenceOfStringsValue);
</del><ins>+    JSValue largeIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;largeIntegerWithDefault&quot;));
+    int64_t largeIntegerWithDefault;
+    if (!largeIntegerWithDefaultValue.isUndefined()) {
+        largeIntegerWithDefault = convert&lt;int64_t&gt;(state, largeIntegerWithDefaultValue, NormalConversion);
</ins><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><del>-    }
</del><ins>+    } else
+        largeIntegerWithDefault = 0;
+    JSValue nullableNodeValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;nullableNode&quot;));
+    Node* nullableNode;
+    if (!nullableNodeValue.isUndefined()) {
+        nullableNode = convertWrapperType&lt;Node, JSNode&gt;(state, nullableNodeValue, IsNullable::Yes);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    } else
+        nullableNode = nullptr;
</ins><span class="cx">     JSValue restrictedDoubleValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;restrictedDouble&quot;));
</span><span class="cx">     Converter&lt;double&gt;::OptionalValue restrictedDouble;
</span><span class="cx">     if (!restrictedDoubleValue.isUndefined()) {
</span><span class="lines">@@ -588,12 +622,6 @@
</span><span class="cx">         restrictedDouble = convert&lt;double&gt;(state, restrictedDoubleValue, ShouldAllowNonFinite::No);
</span><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx">     }
</span><del>-    JSValue unrestrictedDoubleValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unrestrictedDouble&quot;));
-    Converter&lt;double&gt;::OptionalValue unrestrictedDouble;
-    if (!unrestrictedDoubleValue.isUndefined()) {
-        unrestrictedDouble = convert&lt;double&gt;(state, unrestrictedDoubleValue, ShouldAllowNonFinite::Yes);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
-    }
</del><span class="cx">     JSValue restrictedDoubleWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;restrictedDoubleWithDefault&quot;));
</span><span class="cx">     double restrictedDoubleWithDefault;
</span><span class="cx">     if (!restrictedDoubleWithDefaultValue.isUndefined()) {
</span><span class="lines">@@ -601,13 +629,6 @@
</span><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx">     } else
</span><span class="cx">         restrictedDoubleWithDefault = 0;
</span><del>-    JSValue unrestrictedDoubleWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unrestrictedDoubleWithDefault&quot;));
-    double unrestrictedDoubleWithDefault;
-    if (!unrestrictedDoubleWithDefaultValue.isUndefined()) {
-        unrestrictedDoubleWithDefault = convert&lt;double&gt;(state, unrestrictedDoubleWithDefaultValue, ShouldAllowNonFinite::Yes);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
-    } else
-        unrestrictedDoubleWithDefault = 0;
</del><span class="cx">     JSValue restrictedFloatValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;restrictedFloat&quot;));
</span><span class="cx">     Converter&lt;float&gt;::OptionalValue restrictedFloat;
</span><span class="cx">     if (!restrictedFloatValue.isUndefined()) {
</span><span class="lines">@@ -614,12 +635,6 @@
</span><span class="cx">         restrictedFloat = convert&lt;float&gt;(state, restrictedFloatValue, ShouldAllowNonFinite::No);
</span><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx">     }
</span><del>-    JSValue unrestrictedFloatValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unrestrictedFloat&quot;));
-    Converter&lt;float&gt;::OptionalValue unrestrictedFloat;
-    if (!unrestrictedFloatValue.isUndefined()) {
-        unrestrictedFloat = convert&lt;float&gt;(state, unrestrictedFloatValue, ShouldAllowNonFinite::Yes);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
-    }
</del><span class="cx">     JSValue restrictedFloatWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;restrictedFloatWithDefault&quot;));
</span><span class="cx">     float restrictedFloatWithDefault;
</span><span class="cx">     if (!restrictedFloatWithDefaultValue.isUndefined()) {
</span><span class="lines">@@ -627,13 +642,12 @@
</span><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx">     } else
</span><span class="cx">         restrictedFloatWithDefault = 0;
</span><del>-    JSValue unrestrictedFloatWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unrestrictedFloatWithDefault&quot;));
-    float unrestrictedFloatWithDefault;
-    if (!unrestrictedFloatWithDefaultValue.isUndefined()) {
-        unrestrictedFloatWithDefault = convert&lt;float&gt;(state, unrestrictedFloatWithDefaultValue, ShouldAllowNonFinite::Yes);
</del><ins>+    JSValue sequenceOfStringsValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;sequenceOfStrings&quot;));
+    Converter&lt;Vector&lt;String&gt;&gt;::OptionalValue sequenceOfStrings;
+    if (!sequenceOfStringsValue.isUndefined()) {
+        sequenceOfStrings = convert&lt;Vector&lt;String&gt;&gt;(state, sequenceOfStringsValue);
</ins><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><del>-    } else
-        unrestrictedFloatWithDefault = 0;
</del><ins>+    }
</ins><span class="cx">     JSValue smallIntegerClampedValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;smallIntegerClamped&quot;));
</span><span class="cx">     Converter&lt;int8_t&gt;::OptionalValue smallIntegerClamped;
</span><span class="cx">     if (!smallIntegerClampedValue.isUndefined()) {
</span><span class="lines">@@ -659,19 +673,45 @@
</span><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx">     } else
</span><span class="cx">         smallUnsignedIntegerWithDefault = 0;
</span><del>-    JSValue integerValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;integer&quot;));
-    Converter&lt;int32_t&gt;::OptionalValue integer;
-    if (!integerValue.isUndefined()) {
-        integer = convert&lt;int32_t&gt;(state, integerValue, NormalConversion);
</del><ins>+    JSValue stringWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;stringWithDefault&quot;));
+    String stringWithDefault;
+    if (!stringWithDefaultValue.isUndefined()) {
+        stringWithDefault = convert&lt;String&gt;(state, stringWithDefaultValue);
</ins><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><ins>+    } else
+        stringWithDefault = &quot;defaultString&quot;;
+    JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;stringWithoutDefault&quot;));
+    Converter&lt;String&gt;::OptionalValue stringWithoutDefault;
+    if (!stringWithoutDefaultValue.isUndefined()) {
+        stringWithoutDefault = convert&lt;String&gt;(state, stringWithoutDefaultValue);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
</ins><span class="cx">     }
</span><del>-    JSValue integerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;integerWithDefault&quot;));
-    int32_t integerWithDefault;
-    if (!integerWithDefaultValue.isUndefined()) {
-        integerWithDefault = convert&lt;int32_t&gt;(state, integerWithDefaultValue, NormalConversion);
</del><ins>+    JSValue unrestrictedDoubleValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unrestrictedDouble&quot;));
+    Converter&lt;double&gt;::OptionalValue unrestrictedDouble;
+    if (!unrestrictedDoubleValue.isUndefined()) {
+        unrestrictedDouble = convert&lt;double&gt;(state, unrestrictedDoubleValue, ShouldAllowNonFinite::Yes);
</ins><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><ins>+    }
+    JSValue unrestrictedDoubleWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unrestrictedDoubleWithDefault&quot;));
+    double unrestrictedDoubleWithDefault;
+    if (!unrestrictedDoubleWithDefaultValue.isUndefined()) {
+        unrestrictedDoubleWithDefault = convert&lt;double&gt;(state, unrestrictedDoubleWithDefaultValue, ShouldAllowNonFinite::Yes);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
</ins><span class="cx">     } else
</span><del>-        integerWithDefault = 0;
</del><ins>+        unrestrictedDoubleWithDefault = 0;
+    JSValue unrestrictedFloatValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unrestrictedFloat&quot;));
+    Converter&lt;float&gt;::OptionalValue unrestrictedFloat;
+    if (!unrestrictedFloatValue.isUndefined()) {
+        unrestrictedFloat = convert&lt;float&gt;(state, unrestrictedFloatValue, ShouldAllowNonFinite::Yes);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    }
+    JSValue unrestrictedFloatWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unrestrictedFloatWithDefault&quot;));
+    float unrestrictedFloatWithDefault;
+    if (!unrestrictedFloatWithDefaultValue.isUndefined()) {
+        unrestrictedFloatWithDefault = convert&lt;float&gt;(state, unrestrictedFloatWithDefaultValue, ShouldAllowNonFinite::Yes);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    } else
+        unrestrictedFloatWithDefault = 0;
</ins><span class="cx">     JSValue unsignedIntegerValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unsignedInteger&quot;));
</span><span class="cx">     Converter&lt;uint32_t&gt;::OptionalValue unsignedInteger;
</span><span class="cx">     if (!unsignedIntegerValue.isUndefined()) {
</span><span class="lines">@@ -685,19 +725,6 @@
</span><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx">     } else
</span><span class="cx">         unsignedIntegerWithDefault = 0;
</span><del>-    JSValue largeIntegerValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;largeInteger&quot;));
-    Converter&lt;int64_t&gt;::OptionalValue largeInteger;
-    if (!largeIntegerValue.isUndefined()) {
-        largeInteger = convert&lt;int64_t&gt;(state, largeIntegerValue, NormalConversion);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
-    }
-    JSValue largeIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;largeIntegerWithDefault&quot;));
-    int64_t largeIntegerWithDefault;
-    if (!largeIntegerWithDefaultValue.isUndefined()) {
-        largeIntegerWithDefault = convert&lt;int64_t&gt;(state, largeIntegerWithDefaultValue, NormalConversion);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
-    } else
-        largeIntegerWithDefault = 0;
</del><span class="cx">     JSValue unsignedLargeIntegerValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unsignedLargeInteger&quot;));
</span><span class="cx">     Converter&lt;uint64_t&gt;::OptionalValue unsignedLargeInteger;
</span><span class="cx">     if (!unsignedLargeIntegerValue.isUndefined()) {
</span><span class="lines">@@ -711,33 +738,6 @@
</span><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx">     } else
</span><span class="cx">         unsignedLargeIntegerWithDefault = 0;
</span><del>-    JSValue nullableNodeValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;nullableNode&quot;));
-    Node* nullableNode;
-    if (!nullableNodeValue.isUndefined()) {
-        nullableNode = convertWrapperType&lt;Node, JSNode&gt;(state, nullableNodeValue, IsNullable::Yes);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
-    } else
-        nullableNode = nullptr;
-    JSValue anyValueValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;anyValue&quot;));
-    JSC::JSValue anyValue;
-    if (!anyValueValue.isUndefined()) {
-        anyValue = convert&lt;JSC::JSValue&gt;(state, anyValueValue);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
-    } else
-        anyValue = jsUndefined();
-    JSValue anyTypedefValueValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;anyTypedefValue&quot;));
-    JSC::JSValue anyTypedefValue;
-    if (!anyTypedefValueValue.isUndefined()) {
-        anyTypedefValue = convert&lt;JSC::JSValue&gt;(state, anyTypedefValueValue);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
-    } else
-        anyTypedefValue = jsUndefined();
-    JSValue dictionaryMemberValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;dictionaryMember&quot;));
-    Converter&lt;TestObj::DictionaryThatShouldTolerateNull&gt;::OptionalValue dictionaryMember;
-    if (!dictionaryMemberValue.isUndefined()) {
-        dictionaryMember = convertDictionary&lt;TestObj::DictionaryThatShouldTolerateNull&gt;(state, dictionaryMemberValue);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
-    }
</del><span class="cx">     return TestObj::Dictionary { WTFMove(enumerationValueWithoutDefault), WTFMove(enumerationValueWithDefault), WTFMove(enumerationValueWithEmptyStringDefault), WTFMove(stringWithDefault), WTFMove(stringWithoutDefault), WTFMove(booleanWithDefault), WTFMove(booleanWithoutDefault), WTFMove(sequenceOfStrings), WTFMove(restrictedDouble), WTFMove(unrestrictedDouble), WTFMove(restrictedDoubleWithDefault), WTFMove(unrestrictedDoubleWithDefault), WTFMove(restrictedFloat), WTFMove(unrestrictedFloat), WTFMove(restrictedFloatWithDefault), WTFMove(unrestrictedFloatWithDefault), WTFMove(smallIntegerClamped), WTFMove(smallIntegerWithDefault), WTFMove(smallUnsignedIntegerEnforcedRange), WTFMove(smallUnsignedIntegerWithDefault), WTFMove(integer), WTFMove(integerWithDefault), WTFMove(unsignedInteger), WTFMove(unsignedIntegerWithDefault), WTFMove(largeInteger), WTFMove(largeIntegerWithDefault), WTFMove(unsignedLargeInteger), WTFMove(unsignedLargeIntegerWithDefault), WTF
 Move(nullableNode), WTFMove(anyValue), WTFMove(anyTypedefValue), dictionaryMember.value() };
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -755,15 +755,6 @@
</span><span class="cx">         throwTypeError(&amp;state, throwScope);
</span><span class="cx">         return Nullopt;
</span><span class="cx">     }
</span><del>-    JSValue requiredEnumerationValueValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;requiredEnumerationValue&quot;));
-    TestObj::EnumType requiredEnumerationValue;
-    if (!requiredEnumerationValueValue.isUndefined()) {
-        requiredEnumerationValue = convert&lt;TestObj::EnumType&gt;(state, requiredEnumerationValueValue);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
-    } else {
-        throwTypeError(&amp;state, throwScope);
-        return Nullopt;
-    }
</del><span class="cx">     JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithoutDefault&quot;));
</span><span class="cx">     Converter&lt;bool&gt;::OptionalValue booleanWithoutDefault;
</span><span class="cx">     if (!booleanWithoutDefaultValue.isUndefined()) {
</span><span class="lines">@@ -788,6 +779,15 @@
</span><span class="cx">         throwTypeError(&amp;state, throwScope);
</span><span class="cx">         return Nullopt;
</span><span class="cx">     }
</span><ins>+    JSValue requiredEnumerationValueValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;requiredEnumerationValue&quot;));
+    TestObj::EnumType requiredEnumerationValue;
+    if (!requiredEnumerationValueValue.isUndefined()) {
+        requiredEnumerationValue = convert&lt;TestObj::EnumType&gt;(state, requiredEnumerationValueValue);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    } else {
+        throwTypeError(&amp;state, throwScope);
+        return Nullopt;
+    }
</ins><span class="cx">     return TestObj::DictionaryThatShouldNotTolerateNull { WTFMove(requiredEnumerationValue), WTFMove(booleanWithoutDefault), *nonNullableNode, requiredDictionaryMember.value() };
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -805,6 +805,12 @@
</span><span class="cx">         throwTypeError(&amp;state, throwScope);
</span><span class="cx">         return Nullopt;
</span><span class="cx">     }
</span><ins>+    JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithoutDefault&quot;));
+    Converter&lt;bool&gt;::OptionalValue booleanWithoutDefault;
+    if (!booleanWithoutDefaultValue.isUndefined()) {
+        booleanWithoutDefault = convert&lt;bool&gt;(state, booleanWithoutDefaultValue);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    }
</ins><span class="cx">     JSValue enumerationValueValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;enumerationValue&quot;));
</span><span class="cx">     Converter&lt;TestObj::EnumType&gt;::OptionalValue enumerationValue;
</span><span class="cx">     if (!enumerationValueValue.isUndefined()) {
</span><span class="lines">@@ -811,12 +817,6 @@
</span><span class="cx">         enumerationValue = convert&lt;TestObj::EnumType&gt;(state, enumerationValueValue);
</span><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx">     }
</span><del>-    JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithoutDefault&quot;));
-    Converter&lt;bool&gt;::OptionalValue booleanWithoutDefault;
-    if (!booleanWithoutDefaultValue.isUndefined()) {
-        booleanWithoutDefault = convert&lt;bool&gt;(state, booleanWithoutDefaultValue);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
-    }
</del><span class="cx">     return TestObj::DictionaryThatShouldTolerateNull { WTFMove(enumerationValue), WTFMove(booleanWithoutDefault) };
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -834,6 +834,12 @@
</span><span class="cx">         throwTypeError(&amp;state, throwScope);
</span><span class="cx">         return Nullopt;
</span><span class="cx">     }
</span><ins>+    JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithoutDefault&quot;));
+    Converter&lt;bool&gt;::OptionalValue booleanWithoutDefault;
+    if (!booleanWithoutDefaultValue.isUndefined()) {
+        booleanWithoutDefault = convert&lt;bool&gt;(state, booleanWithoutDefaultValue);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    }
</ins><span class="cx">     JSValue enumerationValueValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;enumerationValue&quot;));
</span><span class="cx">     Converter&lt;TestObj::EnumType&gt;::OptionalValue enumerationValue;
</span><span class="cx">     if (!enumerationValueValue.isUndefined()) {
</span><span class="lines">@@ -840,15 +846,79 @@
</span><span class="cx">         enumerationValue = convert&lt;TestObj::EnumType&gt;(state, enumerationValueValue);
</span><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx">     }
</span><del>-    JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithoutDefault&quot;));
-    Converter&lt;bool&gt;::OptionalValue booleanWithoutDefault;
-    if (!booleanWithoutDefaultValue.isUndefined()) {
-        booleanWithoutDefault = convert&lt;bool&gt;(state, booleanWithoutDefaultValue);
</del><ins>+    return AlternateDictionaryName { WTFMove(enumerationValue), WTFMove(booleanWithoutDefault) };
+}
+
+template&lt;&gt; Optional&lt;TestObj::ParentDictionary&gt; convertDictionary&lt;TestObj::ParentDictionary&gt;(ExecState&amp; state, JSValue value)
+{
+    VM&amp; vm = state.vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    bool isNullOrUndefined = value.isUndefinedOrNull();
+    auto* object = isNullOrUndefined ? nullptr : value.getObject();
+    if (UNLIKELY(!isNullOrUndefined &amp;&amp; !object)) {
+        throwTypeError(&amp;state, throwScope);
+        return Nullopt;
+    }
+    if (UNLIKELY(object &amp;&amp; object-&gt;type() == RegExpObjectType)) {
+        throwTypeError(&amp;state, throwScope);
+        return Nullopt;
+    }
+    JSValue parentMember1Value = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;parentMember1&quot;));
+    Converter&lt;bool&gt;::OptionalValue parentMember1;
+    if (!parentMember1Value.isUndefined()) {
+        parentMember1 = convert&lt;bool&gt;(state, parentMember1Value);
</ins><span class="cx">         RETURN_IF_EXCEPTION(throwScope, Nullopt);
</span><span class="cx">     }
</span><del>-    return AlternateDictionaryName { WTFMove(enumerationValue), WTFMove(booleanWithoutDefault) };
</del><ins>+    JSValue parentMember2Value = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;parentMember2&quot;));
+    Converter&lt;bool&gt;::OptionalValue parentMember2;
+    if (!parentMember2Value.isUndefined()) {
+        parentMember2 = convert&lt;bool&gt;(state, parentMember2Value);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    }
+    return TestObj::ParentDictionary { WTFMove(parentMember2), WTFMove(parentMember1) };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;&gt; Optional&lt;TestObj::ChildDictionary&gt; convertDictionary&lt;TestObj::ChildDictionary&gt;(ExecState&amp; state, JSValue value)
+{
+    VM&amp; vm = state.vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    bool isNullOrUndefined = value.isUndefinedOrNull();
+    auto* object = isNullOrUndefined ? nullptr : value.getObject();
+    if (UNLIKELY(!isNullOrUndefined &amp;&amp; !object)) {
+        throwTypeError(&amp;state, throwScope);
+        return Nullopt;
+    }
+    if (UNLIKELY(object &amp;&amp; object-&gt;type() == RegExpObjectType)) {
+        throwTypeError(&amp;state, throwScope);
+        return Nullopt;
+    }
+    JSValue parentMember1Value = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;parentMember1&quot;));
+    Converter&lt;bool&gt;::OptionalValue parentMember1;
+    if (!parentMember1Value.isUndefined()) {
+        parentMember1 = convert&lt;bool&gt;(state, parentMember1Value);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    }
+    JSValue parentMember2Value = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;parentMember2&quot;));
+    Converter&lt;bool&gt;::OptionalValue parentMember2;
+    if (!parentMember2Value.isUndefined()) {
+        parentMember2 = convert&lt;bool&gt;(state, parentMember2Value);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    }
+    JSValue childMember1Value = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;childMember1&quot;));
+    Converter&lt;bool&gt;::OptionalValue childMember1;
+    if (!childMember1Value.isUndefined()) {
+        childMember1 = convert&lt;bool&gt;(state, childMember1Value);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    }
+    JSValue childMember2Value = isNullOrUndefined ? jsUndefined() : object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;childMember2&quot;));
+    Converter&lt;bool&gt;::OptionalValue childMember2;
+    if (!childMember2Value.isUndefined()) {
+        childMember2 = convert&lt;bool&gt;(state, childMember2Value);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    }
+    return TestObj::ChildDictionary { WTFMove(parentMember2), WTFMove(parentMember1), WTFMove(childMember2), WTFMove(childMember1) };
+}
+
</ins><span class="cx"> // Functions
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(TEST_FEATURE)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (206775 => 206776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-10-04 18:45:20 UTC (rev 206775)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-10-04 18:51:44 UTC (rev 206776)
</span><span class="lines">@@ -474,3 +474,14 @@
</span><span class="cx">     TestEnumType enumerationValue;
</span><span class="cx">     boolean booleanWithoutDefault;
</span><span class="cx"> };
</span><ins>+
+dictionary ParentDictionary {
+    boolean parentMember2;
+    boolean parentMember1;
+};
+
+dictionary ChildDictionary : ParentDictionary {
+    boolean childMember2;
+    boolean childMember1;
+};
+
</ins></span></pre></div>
<a id="trunkSourceWebCoredomEventTargetidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventTarget.idl (206775 => 206776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventTarget.idl        2016-10-04 18:45:20 UTC (rev 206775)
+++ trunk/Source/WebCore/dom/EventTarget.idl        2016-10-04 18:51:44 UTC (rev 206776)
</span><span class="lines">@@ -42,8 +42,7 @@
</span><span class="cx">     boolean capture = false;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-dictionary AddEventListenerOptions {
-    boolean capture = false;
</del><ins>+dictionary AddEventListenerOptions : EventListenerOptions {
</ins><span class="cx">     boolean passive = false;
</span><span class="cx">     boolean once = false;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>