<!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>[212689] 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/212689">212689</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-02-20 17:44:42 -0800 (Mon, 20 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WebIDL] Add support for constructors that have variadic parameters
https://bugs.webkit.org/show_bug.cgi?id=168614

Patch by Sam Weinig &lt;sam@webkit.org&gt; on 2017-02-20
Reviewed by Alex Christensen.

In preparation of removing some more custom bindings, move the constructor calling
code over to using GenerateParametersCheck completely. This required
- Removing special case of NamedConstructors automatically getting a Document passed
  to them. The three named constructors that expected this have been updated to add
  the required attributes.
- Add a version of the GenerateCallWith prologue for constructors.
- Remove now unnecessary argumentCount return value from GenerateParametersCheck.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateCallWithUsingReferences):
(GenerateCallWithUsingPointers):
(GenerateConstructorCallWithUsingPointers):
(GenerateCallWith):
(GenerateParametersCheck):
(GenerateConstructorDefinition):

* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
Update results for more consistent placement of ScriptExecutionContext and Document
accessors, add UNLIKELY to context checks, and remove automatic Document passing
for NamedConstructors.

* html/HTMLAudioElement.idl:
* html/HTMLImageElement.idl:
* html/HTMLOptionElement.idl:
Add ConstructorCallWith=Document.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAudioElementidl">trunk/Source/WebCore/html/HTMLAudioElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLImageElementidl">trunk/Source/WebCore/html/HTMLImageElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLOptionElementidl">trunk/Source/WebCore/html/HTMLOptionElement.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (212688 => 212689)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-02-21 01:22:31 UTC (rev 212688)
+++ trunk/Source/WebCore/ChangeLog        2017-02-21 01:44:42 UTC (rev 212689)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2017-02-20  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        [WebIDL] Add support for constructors that have variadic parameters
+        https://bugs.webkit.org/show_bug.cgi?id=168614
+
+        Reviewed by Alex Christensen.
+
+        In preparation of removing some more custom bindings, move the constructor calling
+        code over to using GenerateParametersCheck completely. This required
+        - Removing special case of NamedConstructors automatically getting a Document passed
+          to them. The three named constructors that expected this have been updated to add
+          the required attributes.
+        - Add a version of the GenerateCallWith prologue for constructors.
+        - Remove now unnecessary argumentCount return value from GenerateParametersCheck.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation):
+        (GenerateCallWithUsingReferences):
+        (GenerateCallWithUsingPointers):
+        (GenerateConstructorCallWithUsingPointers):
+        (GenerateCallWith):
+        (GenerateParametersCheck):
+        (GenerateConstructorDefinition):
+
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
+        Update results for more consistent placement of ScriptExecutionContext and Document
+        accessors, add UNLIKELY to context checks, and remove automatic Document passing
+        for NamedConstructors.
+
+        * html/HTMLAudioElement.idl:
+        * html/HTMLImageElement.idl:
+        * html/HTMLOptionElement.idl:
+        Add ConstructorCallWith=Document.
+
</ins><span class="cx"> 2017-02-20  John Wilander  &lt;wilander@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Resource Load Statistics: Add alternate classification method
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (212688 => 212689)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2017-02-21 01:22:31 UTC (rev 212688)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2017-02-21 01:44:42 UTC (rev 212689)
</span><span class="lines">@@ -4034,7 +4034,7 @@
</span><span class="cx"> 
</span><span class="cx">                     GenerateArgumentsCountCheck(\@implContent, $function, $interface);
</span><span class="cx"> 
</span><del>-                    my ($functionString, $dummy) = GenerateParametersCheck(\@implContent, $function, $interface, $functionImplementationName);
</del><ins>+                    my $functionString = GenerateParametersCheck(\@implContent, $function, $interface, $functionImplementationName);
</ins><span class="cx">                     GenerateImplementationFunctionCall($function, $functionString, &quot;    &quot;, $interface);
</span><span class="cx">                 }
</span><span class="cx">             } else {
</span><span class="lines">@@ -4084,7 +4084,7 @@
</span><span class="cx"> 
</span><span class="cx">                     GenerateArgumentsCountCheck(\@implContent, $function, $interface);
</span><span class="cx"> 
</span><del>-                    my ($functionString, $dummy) = GenerateParametersCheck(\@implContent, $function, $interface, $functionImplementationName);
</del><ins>+                    my $functionString = GenerateParametersCheck(\@implContent, $function, $interface, $functionImplementationName);
</ins><span class="cx">                     GenerateImplementationFunctionCall($function, $functionString, &quot;    &quot;, $interface);
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="lines">@@ -4481,7 +4481,7 @@
</span><span class="cx">     my $stateReference = &quot;state&quot;;
</span><span class="cx">     my $globalObject = &quot;jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject())&quot;;
</span><span class="cx"> 
</span><del>-    return GenerateCallWith($callWith, $outputArray, $returnValue, $function, $statePointer, $stateReference, $globalObject);
</del><ins>+    return GenerateCallWith($callWith, $outputArray, $returnValue, $returnValue, $function, $statePointer, $stateReference, $globalObject, $globalObject);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> # FIXME: We should remove GenerateCallWithUsingPointers and combine GenerateCallWithUsingReferences and GenerateCallWith
</span><span class="lines">@@ -4493,12 +4493,25 @@
</span><span class="cx">     my $stateReference = &quot;*state&quot;;
</span><span class="cx">     my $globalObject = &quot;jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())&quot;;
</span><span class="cx"> 
</span><del>-    return GenerateCallWith($callWith, $outputArray, $returnValue, $function, $statePointer, $stateReference, $globalObject);
</del><ins>+    return GenerateCallWith($callWith, $outputArray, $returnValue, $returnValue, $function, $statePointer, $stateReference, $globalObject, $globalObject);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub GenerateConstructorCallWithUsingPointers
+{
+    my ($callWith, $outputArray, $visibleInterfaceName, $function) = @_;
+
+    my $statePointer = &quot;state&quot;;
+    my $stateReference = &quot;*state&quot;;
+    my $globalObject = &quot;castedThis-&gt;globalObject()&quot;;
+    my $contextMissing = &quot;throwConstructorScriptExecutionContextUnavailableError(*state, throwScope, \&quot;${visibleInterfaceName}\&quot;)&quot;;
+    my $scriptExecutionContextAccessor = &quot;castedThis&quot;;
+
+    return GenerateCallWith($callWith, $outputArray, &quot;&quot;, $contextMissing, $function, $statePointer, $stateReference, $globalObject, $scriptExecutionContextAccessor);
+}
+
</ins><span class="cx"> sub GenerateCallWith
</span><span class="cx"> {
</span><del>-    my ($callWith, $outputArray, $returnValue, $function, $statePointer, $stateReference, $globalObject) = @_;
</del><ins>+    my ($callWith, $outputArray, $returnValue, $contextMissing, $function, $statePointer, $stateReference, $globalObject, $scriptExecutionContextAccessor) = @_;
</ins><span class="cx"> 
</span><span class="cx">     return () unless $callWith;
</span><span class="cx"> 
</span><span class="lines">@@ -4506,16 +4519,16 @@
</span><span class="cx">     push(@callWithArgs, $stateReference) if $codeGenerator-&gt;ExtendedAttributeContains($callWith, &quot;ScriptState&quot;);
</span><span class="cx">     push(@callWithArgs, &quot;*${globalObject}&quot;) if $codeGenerator-&gt;ExtendedAttributeContains($callWith, &quot;GlobalObject&quot;);
</span><span class="cx">     if ($codeGenerator-&gt;ExtendedAttributeContains($callWith, &quot;ScriptExecutionContext&quot;)) {
</span><del>-        push(@$outputArray, &quot;    auto* context = $globalObject-&gt;scriptExecutionContext();\n&quot;);
-        push(@$outputArray, &quot;    if (!context)\n&quot;);
-        push(@$outputArray, &quot;        return&quot; . ($returnValue ? &quot; &quot; . $returnValue : &quot;&quot;) . &quot;;\n&quot;);
</del><ins>+        push(@$outputArray, &quot;    auto* context = ${scriptExecutionContextAccessor}-&gt;scriptExecutionContext();\n&quot;);
+        push(@$outputArray, &quot;    if (UNLIKELY(!context))\n&quot;);
+        push(@$outputArray, &quot;        return&quot; . ($contextMissing ? &quot; &quot; . $contextMissing : &quot;&quot;) . &quot;;\n&quot;);
</ins><span class="cx">         push(@callWithArgs, &quot;*context&quot;);
</span><span class="cx">     }
</span><span class="cx">     if ($codeGenerator-&gt;ExtendedAttributeContains($callWith, &quot;Document&quot;)) {
</span><span class="cx">         $implIncludes{&quot;Document.h&quot;} = 1;
</span><del>-        push(@$outputArray, &quot;    auto* context = $globalObject-&gt;scriptExecutionContext();\n&quot;);
-        push(@$outputArray, &quot;    if (!context)\n&quot;);
-        push(@$outputArray, &quot;        return&quot; . ($returnValue ? &quot; &quot; . $returnValue : &quot;&quot;) . &quot;;\n&quot;);
</del><ins>+        push(@$outputArray, &quot;    auto* context = ${scriptExecutionContextAccessor}-&gt;scriptExecutionContext();\n&quot;);
+        push(@$outputArray, &quot;    if (UNLIKELY(!context))\n&quot;);
+        push(@$outputArray, &quot;        return&quot; . ($contextMissing ? &quot; &quot; . $contextMissing : &quot;&quot;) . &quot;;\n&quot;);
</ins><span class="cx">         push(@$outputArray, &quot;    ASSERT(context-&gt;isDocument());\n&quot;);
</span><span class="cx">         push(@$outputArray, &quot;    auto&amp; document = downcast&lt;Document&gt;(*context);\n&quot;);
</span><span class="cx">         push(@callWithArgs, &quot;document&quot;);
</span><span class="lines">@@ -4537,17 +4550,14 @@
</span><span class="cx">     if ($codeGenerator-&gt;ExtendedAttributeContains($callWith, &quot;ActiveWindow&quot;)) {
</span><span class="cx">         $implIncludes{&quot;JSDOMWindowBase.h&quot;} = 1;
</span><span class="cx">         push(@callWithArgs, &quot;activeDOMWindow($statePointer)&quot;);
</span><del>-        
</del><span class="cx">     }
</span><span class="cx">     if ($codeGenerator-&gt;ExtendedAttributeContains($callWith, &quot;FirstWindow&quot;)) {
</span><span class="cx">         $implIncludes{&quot;JSDOMWindowBase.h&quot;} = 1;
</span><span class="cx">         push(@callWithArgs, &quot;firstDOMWindow($statePointer)&quot;);
</span><del>-        
</del><span class="cx">     }
</span><span class="cx">     if ($codeGenerator-&gt;ExtendedAttributeContains($callWith, &quot;CallerWindow&quot;)) {
</span><span class="cx">         $implIncludes{&quot;JSDOMWindowBase.h&quot;} = 1;
</span><span class="cx">         push(@callWithArgs, &quot;callerDOMWindow($statePointer)&quot;);
</span><del>-        
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return @callWithArgs;
</span><span class="lines">@@ -4632,17 +4642,19 @@
</span><span class="cx"> 
</span><span class="cx">     my $interfaceName = $interface-&gt;type-&gt;name;
</span><span class="cx">     my $visibleInterfaceName = $codeGenerator-&gt;GetVisibleInterfaceName($interface);
</span><del>-    my @arguments;
-    my $functionName;
</del><span class="cx">     my $implementedBy = $function-&gt;extendedAttributes-&gt;{ImplementedBy};
</span><span class="cx">     my $numArguments = @{$function-&gt;arguments};
</span><span class="cx">     my $conditional = $function-&gt;extendedAttributes-&gt;{Conditional};
</span><ins>+    my $isConstructor = $function-&gt;extendedAttributes-&gt;{Constructor} || $function-&gt;extendedAttributes-&gt;{NamedConstructor};
</ins><span class="cx"> 
</span><ins>+    my @arguments;
+    my $functionName;
+
</ins><span class="cx">     if ($implementedBy) {
</span><span class="cx">         AddToImplIncludes(&quot;${implementedBy}.h&quot;, $conditional);
</span><span class="cx">         unshift(@arguments, &quot;impl&quot;) if !$function-&gt;isStatic;
</span><span class="cx">         $functionName = &quot;WebCore::${implementedBy}::${functionImplementationName}&quot;;
</span><del>-    } elsif ($function-&gt;isStatic) {
</del><ins>+    } elsif ($function-&gt;isStatic || $isConstructor) {
</ins><span class="cx">         $functionName = &quot;${interfaceName}::${functionImplementationName}&quot;;
</span><span class="cx">     } else {
</span><span class="cx">         $functionName = &quot;impl.${functionImplementationName}&quot;;
</span><span class="lines">@@ -4649,12 +4661,13 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     my $quotedFunctionName;
</span><del>-    if (!$function-&gt;extendedAttributes-&gt;{Constructor}) {
</del><ins>+    if (!$isConstructor) {
</ins><span class="cx">         my $name = $function-&gt;name;
</span><span class="cx">         $quotedFunctionName = &quot;\&quot;$name\&quot;&quot;;
</span><span class="cx">         push(@arguments, GenerateCallWithUsingPointers($function-&gt;extendedAttributes-&gt;{CallWith}, \@$outputArray, &quot;JSValue::encode(jsUndefined())&quot;, $function));
</span><span class="cx">     } else {
</span><span class="cx">         $quotedFunctionName = &quot;nullptr&quot;;
</span><ins>+        push(@arguments, GenerateConstructorCallWithUsingPointers($function-&gt;extendedAttributes-&gt;{ConstructorCallWith}, \@$outputArray, $visibleInterfaceName, $function));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     my $argumentIndex = 0;
</span><span class="lines">@@ -4783,7 +4796,7 @@
</span><span class="cx">     my $functionString = &quot;$functionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;;
</span><span class="cx">     $functionString = &quot;propagateException(*state, throwScope, $functionString)&quot; if NeedsExplicitPropagateExceptionCall($function);
</span><span class="cx"> 
</span><del>-    return ($functionString, scalar @arguments);
</del><ins>+    return $functionString;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GenerateDictionaryHeader
</span><span class="lines">@@ -6092,53 +6105,14 @@
</span><span class="cx">             push(@$outputArray, &quot;    auto* castedThis = jsCast&lt;${constructorClassName}*&gt;(state-&gt;jsCallee());\n&quot;);
</span><span class="cx">             push(@$outputArray, &quot;    ASSERT(castedThis);\n&quot;);
</span><span class="cx"> 
</span><del>-            my @constructorArgList;
-
</del><span class="cx">             $implIncludes{&quot;&lt;runtime/Error.h&gt;&quot;} = 1;
</span><span class="cx"> 
</span><span class="cx">             GenerateArgumentsCountCheck($outputArray, $function, $interface);
</span><span class="cx"> 
</span><del>-            # FIXME: For now, we do not support SVG constructors.
-            # FIXME: Currently [Constructor(...)] does not yet support optional arguments without [Default=...]
-            my ($dummy, $paramIndex) = GenerateParametersCheck($outputArray, $function, $interface, &quot;constructorCallback&quot;);
</del><ins>+            my $functionImplementationName = $generatingNamedConstructor ? &quot;createForJSConstructor&quot; : &quot;create&quot;;
+            my $functionString = GenerateParametersCheck($outputArray, $function, $interface, $functionImplementationName);
</ins><span class="cx"> 
</span><del>-            push(@constructorArgList, &quot;*state&quot;) if $codeGenerator-&gt;ExtendedAttributeContains($interface-&gt;extendedAttributes-&gt;{ConstructorCallWith}, &quot;ScriptState&quot;);;
-
-            if ($codeGenerator-&gt;ExtendedAttributeContains($interface-&gt;extendedAttributes-&gt;{ConstructorCallWith}, &quot;ScriptExecutionContext&quot;)) {
-                push(@constructorArgList, &quot;*context&quot;);
-                push(@$outputArray, &quot;    ScriptExecutionContext* context = castedThis-&gt;scriptExecutionContext();\n&quot;);
-                push(@$outputArray, &quot;    if (UNLIKELY(!context))\n&quot;);
-                push(@$outputArray, &quot;        return throwConstructorScriptExecutionContextUnavailableError(*state, throwScope, \&quot;${visibleInterfaceName}\&quot;);\n&quot;);
-            }
-
-            if ($codeGenerator-&gt;ExtendedAttributeContains($interface-&gt;extendedAttributes-&gt;{ConstructorCallWith}, &quot;Document&quot;)) {
-                $implIncludes{&quot;Document.h&quot;} = 1;
-                push(@constructorArgList, &quot;document&quot;);
-                push(@$outputArray, &quot;    ScriptExecutionContext* context = castedThis-&gt;scriptExecutionContext();\n&quot;);
-                push(@$outputArray, &quot;    if (UNLIKELY(!context))\n&quot;);
-                push(@$outputArray, &quot;        return throwConstructorScriptExecutionContextUnavailableError(*state, throwScope, \&quot;${visibleInterfaceName}\&quot;);\n&quot;);
-                push(@$outputArray, &quot;    ASSERT(context-&gt;isDocument());\n&quot;);
-                push(@$outputArray, &quot;    auto&amp; document = downcast&lt;Document&gt;(*context);\n&quot;);
-            }
-
-            push(@constructorArgList, &quot;*castedThis-&gt;document()&quot;) if $generatingNamedConstructor;
-
-            my $index = 0;
-            foreach my $argument (@{$function-&gt;arguments}) {
-                last if $index eq $paramIndex;
-
-                push(@constructorArgList, PassArgumentExpression($argument-&gt;name, $argument));
-
-                $index++;
-            }
-
-            my $constructorArg = join(&quot;, &quot;, @constructorArgList);
-            if ($generatingNamedConstructor) {
-                push(@$outputArray, &quot;    auto object = ${interfaceName}::createForJSConstructor(${constructorArg});\n&quot;);
-            } else {
-                push(@$outputArray, &quot;    auto object = ${interfaceName}::create(${constructorArg});\n&quot;);
-            }
-
</del><ins>+            push(@$outputArray, &quot;    auto object = ${functionString};\n&quot;);
</ins><span class="cx">             push(@$outputArray, &quot;    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n&quot;) if $codeGenerator-&gt;ExtendedAttributeContains($interface-&gt;extendedAttributes-&gt;{ConstructorCallWith}, &quot;ScriptState&quot;);
</span><span class="cx"> 
</span><span class="cx">             my $IDLType = GetIDLType($interface, $interface-&gt;type);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (212688 => 212689)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2017-02-21 01:22:31 UTC (rev 212688)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2017-02-21 01:44:42 UTC (rev 212689)
</span><span class="lines">@@ -229,13 +229,13 @@
</span><span class="cx">     ASSERT(castedThis);
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><ins>+    auto* context = castedThis-&gt;scriptExecutionContext();
+    if (UNLIKELY(!context))
+        return throwConstructorScriptExecutionContextUnavailableError(*state, throwScope, &quot;TestInterface&quot;);
</ins><span class="cx">     auto str1 = convert&lt;IDLDOMString&gt;(*state, state-&gt;uncheckedArgument(0), StringConversionConfiguration::Normal);
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx">     auto str2 = state-&gt;argument(1).isUndefined() ? ASCIILiteral(&quot;defaultString&quot;) : convert&lt;IDLDOMString&gt;(*state, state-&gt;uncheckedArgument(1), StringConversionConfiguration::Normal);
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>-    ScriptExecutionContext* context = castedThis-&gt;scriptExecutionContext();
-    if (UNLIKELY(!context))
-        return throwConstructorScriptExecutionContextUnavailableError(*state, throwScope, &quot;TestInterface&quot;);
</del><span class="cx">     auto object = TestInterface::create(*context, WTFMove(str1), WTFMove(str2));
</span><span class="cx">     return JSValue::encode(toJSNewlyCreated&lt;IDLInterface&lt;TestInterface&gt;&gt;(*state, *castedThis-&gt;globalObject(), throwScope, WTFMove(object)));
</span><span class="cx"> }
</span><span class="lines">@@ -867,7 +867,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto strArg = convert&lt;IDLDOMString&gt;(*state, state-&gt;uncheckedArgument(0), StringConversionConfiguration::Normal);
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="lines">@@ -942,7 +942,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto strArg = convert&lt;IDLDOMString&gt;(*state, state-&gt;uncheckedArgument(0), StringConversionConfiguration::Normal);
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp (212688 => 212689)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp        2017-02-21 01:22:31 UTC (rev 212688)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp        2017-02-21 01:44:42 UTC (rev 212689)
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx">     auto str3 = state-&gt;argument(2).isUndefined() ? String() : convert&lt;IDLDOMString&gt;(*state, state-&gt;uncheckedArgument(2), StringConversionConfiguration::Normal);
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>-    auto object = TestNamedConstructor::createForJSConstructor(*castedThis-&gt;document(), WTFMove(str1), WTFMove(str2), WTFMove(str3));
</del><ins>+    auto object = TestNamedConstructor::createForJSConstructor(WTFMove(str1), WTFMove(str2), WTFMove(str3));
</ins><span class="cx">     return JSValue::encode(toJSNewlyCreated&lt;IDLInterface&lt;TestNamedConstructor&gt;&gt;(*state, *castedThis-&gt;globalObject(), throwScope, WTFMove(object)));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (212688 => 212689)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2017-02-21 01:22:31 UTC (rev 212688)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2017-02-21 01:44:42 UTC (rev 212689)
</span><span class="lines">@@ -1550,15 +1550,15 @@
</span><span class="cx">     ASSERT(castedThis);
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><ins>+    auto* context = castedThis-&gt;scriptExecutionContext();
+    if (UNLIKELY(!context))
+        return throwConstructorScriptExecutionContextUnavailableError(*state, throwScope, &quot;TestObject&quot;);
+    ASSERT(context-&gt;isDocument());
+    auto&amp; document = downcast&lt;Document&gt;(*context);
</ins><span class="cx">     auto testCallback = convert&lt;IDLCallbackInterface&lt;JSTestCallbackInterface&gt;&gt;(*state, state-&gt;uncheckedArgument(0), *castedThis-&gt;globalObject(), [](JSC::ExecState&amp; state, JSC::ThrowScope&amp; scope) { throwArgumentMustBeFunctionError(state, scope, 0, &quot;testCallback&quot;, &quot;TestObject&quot;, nullptr); });
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx">     auto testCallbackFunction = convert&lt;IDLCallbackFunction&lt;JSTestCallbackFunction&gt;&gt;(*state, state-&gt;uncheckedArgument(1), *castedThis-&gt;globalObject(), [](JSC::ExecState&amp; state, JSC::ThrowScope&amp; scope) { throwArgumentMustBeFunctionError(state, scope, 1, &quot;testCallbackFunction&quot;, &quot;TestObject&quot;, nullptr); });
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>-    ScriptExecutionContext* context = castedThis-&gt;scriptExecutionContext();
-    if (UNLIKELY(!context))
-        return throwConstructorScriptExecutionContextUnavailableError(*state, throwScope, &quot;TestObject&quot;);
-    ASSERT(context-&gt;isDocument());
-    auto&amp; document = downcast&lt;Document&gt;(*context);
</del><span class="cx">     auto object = TestObj::create(document, testCallback.releaseNonNull(), testCallbackFunction.releaseNonNull());
</span><span class="cx">     return JSValue::encode(toJSNewlyCreated&lt;IDLInterface&lt;TestObj&gt;&gt;(*state, *castedThis-&gt;globalObject(), WTFMove(object)));
</span><span class="cx"> }
</span><span class="lines">@@ -2924,7 +2924,7 @@
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><span class="cx">     UNUSED_PARAM(state);
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     auto&amp; impl = thisObject.wrapped();
</span><span class="cx">     JSValue result = toJS&lt;IDLInterface&lt;TestObj&gt;&gt;(state, *thisObject.globalObject(), impl.withScriptExecutionContextAttribute(*context));
</span><span class="lines">@@ -2959,7 +2959,7 @@
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><span class="cx">     UNUSED_PARAM(state);
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     auto&amp; impl = thisObject.wrapped();
</span><span class="cx">     JSValue result = toJS&lt;IDLInterface&lt;TestObj&gt;&gt;(state, *thisObject.globalObject(), throwScope, impl.withScriptExecutionContextAttributeRaises(*context));
</span><span class="lines">@@ -2978,7 +2978,7 @@
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><span class="cx">     UNUSED_PARAM(state);
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     auto&amp; impl = thisObject.wrapped();
</span><span class="cx">     JSValue result = toJS&lt;IDLInterface&lt;TestObj&gt;&gt;(state, *thisObject.globalObject(), impl.withScriptExecutionContextAndScriptStateAttribute(state, *context));
</span><span class="lines">@@ -2997,7 +2997,7 @@
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><span class="cx">     UNUSED_PARAM(state);
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     auto&amp; impl = thisObject.wrapped();
</span><span class="cx">     JSValue result = toJS&lt;IDLInterface&lt;TestObj&gt;&gt;(state, *thisObject.globalObject(), throwScope, impl.withScriptExecutionContextAndScriptStateAttributeRaises(state, *context));
</span><span class="lines">@@ -3016,7 +3016,7 @@
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><span class="cx">     UNUSED_PARAM(state);
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     auto&amp; impl = thisObject.wrapped();
</span><span class="cx">     JSValue result = toJS&lt;IDLInterface&lt;TestObj&gt;&gt;(state, *thisObject.globalObject(), impl.withScriptExecutionContextAndScriptStateWithSpacesAttribute(state, *context));
</span><span class="lines">@@ -4584,7 +4584,7 @@
</span><span class="cx">     auto nativeValue = convert&lt;IDLInterface&lt;TestObj&gt;&gt;(state, value, [](JSC::ExecState&amp; state, JSC::ThrowScope&amp; scope) { throwAttributeTypeError(state, scope, &quot;TestObject&quot;, &quot;withScriptExecutionContextAttribute&quot;, &quot;TestObj&quot;); });
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setWithScriptExecutionContextAttribute(*context, *nativeValue);
</span><span class="cx">     return true;
</span><span class="lines">@@ -4625,7 +4625,7 @@
</span><span class="cx">     auto nativeValue = convert&lt;IDLInterface&lt;TestObj&gt;&gt;(state, value, [](JSC::ExecState&amp; state, JSC::ThrowScope&amp; scope) { throwAttributeTypeError(state, scope, &quot;TestObject&quot;, &quot;withScriptExecutionContextAttributeRaises&quot;, &quot;TestObj&quot;); });
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setWithScriptExecutionContextAttributeRaises(*context, *nativeValue);
</span><span class="cx">     return true;
</span><span class="lines">@@ -4647,7 +4647,7 @@
</span><span class="cx">     auto nativeValue = convert&lt;IDLInterface&lt;TestObj&gt;&gt;(state, value, [](JSC::ExecState&amp; state, JSC::ThrowScope&amp; scope) { throwAttributeTypeError(state, scope, &quot;TestObject&quot;, &quot;withScriptExecutionContextAndScriptStateAttribute&quot;, &quot;TestObj&quot;); });
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setWithScriptExecutionContextAndScriptStateAttribute(state, *context, *nativeValue);
</span><span class="cx">     return true;
</span><span class="lines">@@ -4669,7 +4669,7 @@
</span><span class="cx">     auto nativeValue = convert&lt;IDLInterface&lt;TestObj&gt;&gt;(state, value, [](JSC::ExecState&amp; state, JSC::ThrowScope&amp; scope) { throwAttributeTypeError(state, scope, &quot;TestObject&quot;, &quot;withScriptExecutionContextAndScriptStateAttributeRaises&quot;, &quot;TestObj&quot;); });
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setWithScriptExecutionContextAndScriptStateAttributeRaises(state, *context, *nativeValue);
</span><span class="cx">     return true;
</span><span class="lines">@@ -4691,7 +4691,7 @@
</span><span class="cx">     auto nativeValue = convert&lt;IDLInterface&lt;TestObj&gt;&gt;(state, value, [](JSC::ExecState&amp; state, JSC::ThrowScope&amp; scope) { throwAttributeTypeError(state, scope, &quot;TestObject&quot;, &quot;withScriptExecutionContextAndScriptStateWithSpacesAttribute&quot;, &quot;TestObj&quot;); });
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, false);
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(state, *context, *nativeValue);
</span><span class="cx">     return true;
</span><span class="lines">@@ -6039,7 +6039,7 @@
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.withScriptExecutionContext(*context);
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6058,7 +6058,7 @@
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.withScriptExecutionContextAndScriptState(*state, *context);
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6077,7 +6077,7 @@
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(toJS&lt;IDLInterface&lt;TestObj&gt;&gt;(*state, *castedThis-&gt;globalObject(), throwScope, impl.withScriptExecutionContextAndScriptStateObjException(*state, *context)));
</span><span class="cx"> }
</span><span class="lines">@@ -6095,7 +6095,7 @@
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(toJS&lt;IDLInterface&lt;TestObj&gt;&gt;(*state, *castedThis-&gt;globalObject(), impl.withScriptExecutionContextAndScriptStateWithSpaces(*state, *context)));
</span><span class="cx"> }
</span><span class="lines">@@ -6130,7 +6130,7 @@
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><del>-    if (!context)
</del><ins>+    if (UNLIKELY(!context))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     ASSERT(context-&gt;isDocument());
</span><span class="cx">     auto&amp; document = downcast&lt;Document&gt;(*context);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (212688 => 212689)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2017-02-21 01:22:31 UTC (rev 212688)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2017-02-21 01:44:42 UTC (rev 212689)
</span><span class="lines">@@ -138,7 +138,7 @@
</span><span class="cx">     ASSERT(castedThis);
</span><span class="cx">     auto longArgs = convertVariadicArguments&lt;IDLLong&gt;(*state, 0);
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>-    auto object = TestOverloadedConstructors::create(WTFMove(longArgs));
</del><ins>+    auto object = TestOverloadedConstructors::create(WTFMove(longArgs.arguments.value()));
</ins><span class="cx">     return JSValue::encode(toJSNewlyCreated&lt;IDLInterface&lt;TestOverloadedConstructors&gt;&gt;(*state, *castedThis-&gt;globalObject(), WTFMove(object)));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAudioElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAudioElement.idl (212688 => 212689)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAudioElement.idl        2017-02-21 01:22:31 UTC (rev 212688)
+++ trunk/Source/WebCore/html/HTMLAudioElement.idl        2017-02-21 01:44:42 UTC (rev 212689)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> [
</span><span class="cx">     EnabledAtRuntime,
</span><span class="cx">     Conditional=VIDEO,
</span><ins>+    ConstructorCallWith=Document,
</ins><span class="cx">     NamedConstructor=Audio(optional DOMString src)
</span><span class="cx"> ] interface HTMLAudioElement : HTMLMediaElement {
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLImageElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLImageElement.idl (212688 => 212689)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLImageElement.idl        2017-02-21 01:22:31 UTC (rev 212688)
+++ trunk/Source/WebCore/html/HTMLImageElement.idl        2017-02-21 01:44:42 UTC (rev 212689)
</span><span class="lines">@@ -21,6 +21,7 @@
</span><span class="cx"> [
</span><span class="cx">     ExportMacro=WEBCORE_EXPORT,
</span><span class="cx">     JSGenerateToNativeObject,
</span><ins>+    ConstructorCallWith=Document,
</ins><span class="cx">     NamedConstructor=Image(optional unsigned long width, optional unsigned long height)
</span><span class="cx"> ] interface HTMLImageElement : HTMLElement {
</span><span class="cx">     [Reflect] attribute DOMString name;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLOptionElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLOptionElement.idl (212688 => 212689)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLOptionElement.idl        2017-02-21 01:22:31 UTC (rev 212688)
+++ trunk/Source/WebCore/html/HTMLOptionElement.idl        2017-02-21 01:44:42 UTC (rev 212689)
</span><span class="lines">@@ -21,6 +21,7 @@
</span><span class="cx"> [
</span><span class="cx">     ConstructorMayThrowException,
</span><span class="cx">     JSGenerateToNativeObject,
</span><ins>+    ConstructorCallWith=Document,
</ins><span class="cx">     NamedConstructor=Option(optional DOMString data, optional DOMString value, optional boolean defaultSelected = false, optional boolean selected = false),
</span><span class="cx"> ] interface HTMLOptionElement : HTMLElement {
</span><span class="cx">     [Reflect] attribute boolean disabled;
</span></span></pre>
</div>
</div>

</body>
</html>