<!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>[204500] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/204500">204500</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2016-08-15 23:50:58 -0700 (Mon, 15 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Conversion to sequence&lt;T&gt; is broken for iterable objects
https://bugs.webkit.org/show_bug.cgi?id=160801

Reviewed by Darin Adler.

Source/JavaScriptCore:

Export functions used to iterate over iterable objects.

* runtime/IteratorOperations.h:
(JSC::forEachInIterable):

Source/WebCore:

Added the proper iterator support for sequence&lt;T&gt; with one caveat that we don't check for RegExp object
per https://github.com/heycam/webidl/issues/145.

See http://heycam.github.io/webidl/#es-sequence and http://heycam.github.io/webidl/#es-overloads

Tests: bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl

* bindings/js/JSDOMBinding.cpp:
(WebCore::hasIteratorMethod): Added. A helper function for checking whether a JSValue is iterable or not.
* bindings/js/JSDOMBinding.h:
(WebCore::NativeValueTraits&lt;unsigned&gt;::nativeValue): Removed the check for isNumber to match the spec'ed
behavior at http://heycam.github.io/webidl/#es-unsigned-long which calls ToNumber first without checking
whether the value is a number or not.
(WebCore::toRefPtrNativeArray): Replaced isJSArray check by isObject check and throw a TypeError. Deployed
forEachInIterable to support non-JSArray iterable objects. Also removed the function pointer from the third
argument since we were always calling JSCT::toWrapped.
(WebCore::toNativeArray): Ditto.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter&lt;Vector&lt;T&gt;&gt;::convert): Removed the comment about toNativeArray not throwing when value
is not an object.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateOverloadedFunctionOrConstructor): Removed the check for isJSArray for sequence&lt;T&gt; as an iterable
object is not necessary a JSArray.
(WillConvertUndefinedToDefaultParameterValue): Don't return 1 for all sequences since toNativeArray and
toRefPtrNativeArray now throws on undefined due to isObject check.
(JSValueToNative): Removed the third argument from toRefPtrNativeArray.

* bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.cpp: Added.
* bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.h: Added.
* bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequencePrivate.h: Added.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: Added.
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h: Added.
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsPrototypeFunctionFunc):
* bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl: Added.

LayoutTests:

Added test cases for converting non-JSArray objects to sequence&lt;T&gt; for MutationObserver, FontFaceSet, and WebSocket.

* fast/dom/MutationObserver/observe-exceptions-expected.txt:
* fast/dom/MutationObserver/observe-exceptions.html:
* fast/text/font-face-set-javascript-expected.txt:
* fast/text/font-face-set-javascript.html:
* http/tests/dom/window-open-about-webkit-org-and-access-document-expected.txt: Rebaselined due to js-test-pre.js change.
* http/tests/resources/js-test-pre.js: Merged ToT from resources/js-test-pre.js.
* http/tests/security/xssAuditor/block-does-not-leak-location-expected.txt: Rebaselined due to js-test-pre.js change.
* http/tests/security/xssAuditor/block-does-not-leak-referrer-expected.txt: Ditto.
* http/tests/websocket/tests/hybi/websocket-constructor-protocols-expected.txt: Added.
* http/tests/websocket/tests/hybi/websocket-constructor-protocols.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomMutationObserverobserveexceptionsexpectedtxt">trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomMutationObserverobserveexceptionshtml">trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions.html</a></li>
<li><a href="#trunkLayoutTestsfasttextfontfacesetjavascriptexpectedtxt">trunk/LayoutTests/fast/text/font-face-set-javascript-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasttextfontfacesetjavascripthtml">trunk/LayoutTests/fast/text/font-face-set-javascript.html</a></li>
<li><a href="#trunkLayoutTestshttptestsdomwindowopenaboutwebkitorgandaccessdocumentexpectedtxt">trunk/LayoutTests/http/tests/dom/window-open-about-webkit-org-and-access-document-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesjstestprejs">trunk/LayoutTests/http/tests/resources/js-test-pre.js</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityxssAuditorblockdoesnotleaklocationexpectedtxt">trunk/LayoutTests/http/tests/security/xssAuditor/block-does-not-leak-location-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityxssAuditorblockdoesnotleakreferrerexpectedtxt">trunk/LayoutTests/http/tests/security/xssAuditor/block-does-not-leak-referrer-expected.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIteratorOperationsh">trunk/Source/JavaScriptCore/runtime/IteratorOperations.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSObjecth">trunk/Source/JavaScriptCore/runtime/JSObject.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingcpp">trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMConverth">trunk/Source/WebCore/bindings/js/JSDOMConvert.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestswebsockettestshybiwebsocketconstructorprotocolsexpectedtxt">trunk/LayoutTests/http/tests/websocket/tests/hybi/websocket-constructor-protocols-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestswebsockettestshybiwebsocketconstructorprotocolshtml">trunk/LayoutTests/http/tests/websocket/tests/hybi/websocket-constructor-protocols.html</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestOverloadedConstructorsWithSequencecpp">trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestOverloadedConstructorsWithSequenceh">trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestOverloadedConstructorsWithSequencePrivateh">trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequencePrivate.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsWithSequencecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsWithSequenceh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestOverloadedConstructorsWithSequenceidl">trunk/Source/WebCore/bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/LayoutTests/ChangeLog        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2016-08-15  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        Conversion to sequence&lt;T&gt; is broken for iterable objects
+        https://bugs.webkit.org/show_bug.cgi?id=160801
+
+        Reviewed by Darin Adler.
+
+        Added test cases for converting non-JSArray objects to sequence&lt;T&gt; for MutationObserver, FontFaceSet, and WebSocket.
+
+        * fast/dom/MutationObserver/observe-exceptions-expected.txt:
+        * fast/dom/MutationObserver/observe-exceptions.html:
+        * fast/text/font-face-set-javascript-expected.txt:
+        * fast/text/font-face-set-javascript.html:
+        * http/tests/dom/window-open-about-webkit-org-and-access-document-expected.txt: Rebaselined due to js-test-pre.js change.
+        * http/tests/resources/js-test-pre.js: Merged ToT from resources/js-test-pre.js.
+        * http/tests/security/xssAuditor/block-does-not-leak-location-expected.txt: Rebaselined due to js-test-pre.js change.
+        * http/tests/security/xssAuditor/block-does-not-leak-referrer-expected.txt: Ditto.
+        * http/tests/websocket/tests/hybi/websocket-constructor-protocols-expected.txt: Added.
+        * http/tests/websocket/tests/hybi/websocket-constructor-protocols.html: Added.
+
</ins><span class="cx"> 2016-08-15  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         ASSERTION FAILURE: [[videoLayer delegate] isKindOfClass:getUIViewClass()] in WebAVPlayerLayerView_videoView()
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomMutationObserverobserveexceptionsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -18,6 +18,12 @@
</span><span class="cx"> PASS observer.observe(document.body, {attributes: false, attributeOldValue: true}) threw exception TypeError: Type error.
</span><span class="cx"> PASS observer.observe(document.body, {attributes: false, attributeFilter: [&quot;id&quot;]}) threw exception TypeError: Type error.
</span><span class="cx"> PASS observer.observe(document.body, {characterData: false, characterDataOldValue: true}) threw exception TypeError: Type error.
</span><ins>+PASS observer.observe(document.body, {attributeFilter: 1}) threw exception TypeError: Value is not a sequence.
+PASS observer.observe(document.body, {attributeFilter: &quot;abc&quot;}) threw exception TypeError: Value is not a sequence.
+PASS x = { [Symbol.iterator]: function* () { yield &quot;foo&quot;; } }; observer.observe(document.body, {attributeFilter: x}) did not throw exception.
+PASS x = { [Symbol.iterator]: 1 }; observer.observe(document.body, {attributeFilter: x}) threw exception TypeError: Type error.
+PASS x = { [Symbol.iterator]: null }; observer.observe(document.body, {attributeFilter: x}) threw exception TypeError: Type error.
+PASS x = { [Symbol.iterator]: function* () { throw {name: &quot;error&quot;, toString: () =&gt; &quot;error&quot;}; } }; observer.observe(document.body, {attributeFilter: x}) threw exception error.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomMutationObserverobserveexceptionshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions.html (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions.html        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions.html        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -6,28 +6,36 @@
</span><span class="cx"> &lt;title&gt;&lt;/title&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><del>-&lt;p id=description&gt;&lt;/p&gt;
</del><ins>+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
</ins><span class="cx"> &lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> 
</span><span class="cx"> function runTest() {
</span><span class="cx">     window.observer = new MutationObserver(function(mutations) { });
</span><del>-    shouldThrow('observer.observe()');
-    shouldThrow('observer.observe(null)');
-    shouldThrow('observer.observe(undefined)');
-    shouldThrow('observer.observe(document.body)');
-    shouldThrow('observer.observe(document.body, null)');
-    shouldThrow('observer.observe(document.body, undefined)');
-    shouldThrow('observer.observe(null, {attributes: true})');
-    shouldThrow('observer.observe(undefined, {attributes: true})');
-    shouldThrow('observer.observe(document.body, {subtree: true})');
</del><ins>+    shouldThrowErrorName('observer.observe()', 'TypeError');
+    shouldThrowErrorName('observer.observe(null)', 'TypeError');
+    shouldThrowErrorName('observer.observe(undefined)', 'TypeError');
+    shouldThrowErrorName('observer.observe(document.body)', 'TypeError');
+    shouldThrowErrorName('observer.observe(document.body, null)', 'TypeError');
+    shouldThrowErrorName('observer.observe(document.body, undefined)', 'TypeError');
+    shouldThrowErrorName('observer.observe(null, {attributes: true})', 'TypeError');
+    shouldThrowErrorName('observer.observe(undefined, {attributes: true})', 'TypeError');
+    shouldThrowErrorName('observer.observe(document.body, {subtree: true})', 'TypeError');
</ins><span class="cx">     shouldNotThrow('observer.observe(document.body, {childList: true, attributeOldValue: true})');
</span><span class="cx">     shouldNotThrow('observer.observe(document.body, {attributes: true, characterDataOldValue: true})');
</span><span class="cx">     shouldNotThrow('observer.observe(document.body, {characterData: true, attributeFilter: [&quot;id&quot;]})');
</span><span class="cx"> 
</span><del>-    shouldThrow('observer.observe(document.body, {attributes: false, attributeOldValue: true})');
-    shouldThrow('observer.observe(document.body, {attributes: false, attributeFilter: [&quot;id&quot;]})');
-    shouldThrow('observer.observe(document.body, {characterData: false, characterDataOldValue: true})');
</del><ins>+    shouldThrowErrorName('observer.observe(document.body, {attributes: false, attributeOldValue: true})', 'TypeError');
+    shouldThrowErrorName('observer.observe(document.body, {attributes: false, attributeFilter: [&quot;id&quot;]})', 'TypeError');
+    shouldThrowErrorName('observer.observe(document.body, {characterData: false, characterDataOldValue: true})', 'TypeError');
+
+    shouldThrowErrorName('observer.observe(document.body, {attributeFilter: 1})', 'TypeError');
+    shouldThrowErrorName('observer.observe(document.body, {attributeFilter: &quot;abc&quot;})', 'TypeError');
+    shouldNotThrow('x = { [Symbol.iterator]: function* () { yield &quot;foo&quot;; } }; observer.observe(document.body, {attributeFilter: x})');
+    shouldThrowErrorName('x = { [Symbol.iterator]: 1 }; observer.observe(document.body, {attributeFilter: x})', 'TypeError');
+    shouldThrowErrorName('x = { [Symbol.iterator]: null }; observer.observe(document.body, {attributeFilter: x})', 'TypeError');
+    shouldThrowErrorName('x = { [Symbol.iterator]: function* () { throw {name: &quot;error&quot;, toString: () =&gt; &quot;error&quot;}; } }; '
+        + 'observer.observe(document.body, {attributeFilter: x})', 'error');
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> description('Test that WebKitMutationObserver.observe throws exceptions appropriately');
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextfontfacesetjavascriptexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/text/font-face-set-javascript-expected.txt (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/font-face-set-javascript-expected.txt        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/LayoutTests/fast/text/font-face-set-javascript-expected.txt        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -1,6 +1,13 @@
</span><span class="cx"> PASS new FontFaceSet() threw exception TypeError: Not enough arguments.
</span><span class="cx"> PASS new FontFaceSet([]).size is 0
</span><span class="cx"> PASS new FontFaceSet([fontFace1]).size is 1
</span><ins>+PASS new FontFaceSet(1) threw exception TypeError: Value is not a sequence.
+PASS new FontFaceSet('hello') threw exception TypeError: Value is not a sequence.
+PASS new FontFaceSet(new Set([fontFace1])).size is 1
+PASS x = { [Symbol.iterator]: function*() { yield fontFace1; yield fontFace2; } }; new FontFaceSet(x).size is 2
+PASS x = { [Symbol.iterator]: 1 }; new FontFaceSet(x) threw exception TypeError: Type error.
+PASS x = { [Symbol.iterator]: null }; new FontFaceSet(x) threw exception TypeError: Type error.
+PASS x = { [Symbol.iterator]: function*() { yield fontFace1; throw {name: 'SomeError', toString: () =&gt; 'Some error'}; } }; new FontFaceSet(x) threw exception Some error.
</ins><span class="cx"> PASS fontFaceSet.status is &quot;loaded&quot;
</span><span class="cx"> PASS item.done is false
</span><span class="cx"> PASS item.value.length is 2
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextfontfacesetjavascripthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/text/font-face-set-javascript.html (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/font-face-set-javascript.html        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/LayoutTests/fast/text/font-face-set-javascript.html        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -16,6 +16,13 @@
</span><span class="cx"> shouldThrow(&quot;new FontFaceSet()&quot;);
</span><span class="cx"> shouldBe(&quot;new FontFaceSet([]).size&quot;, &quot;0&quot;);
</span><span class="cx"> shouldBe(&quot;new FontFaceSet([fontFace1]).size&quot;, &quot;1&quot;);
</span><ins>+shouldThrowErrorName(&quot;new FontFaceSet(1)&quot;, &quot;TypeError&quot;);
+shouldThrowErrorName(&quot;new FontFaceSet('hello')&quot;, &quot;TypeError&quot;);
+shouldBe(&quot;new FontFaceSet(new Set([fontFace1])).size&quot;, &quot;1&quot;);
+shouldBe(&quot;x = { [Symbol.iterator]: function*() { yield fontFace1; yield fontFace2; } }; new FontFaceSet(x).size&quot;, &quot;2&quot;);
+shouldThrowErrorName(&quot;x = { [Symbol.iterator]: 1 }; new FontFaceSet(x)&quot;, &quot;TypeError&quot;);
+shouldThrowErrorName(&quot;x = { [Symbol.iterator]: null }; new FontFaceSet(x)&quot;, &quot;TypeError&quot;);
+shouldThrowErrorName(&quot;x = { [Symbol.iterator]: function*() { yield fontFace1; throw {name: 'SomeError', toString: () =&gt; 'Some error'}; } }; new FontFaceSet(x)&quot;, &quot;SomeError&quot;);
</ins><span class="cx"> 
</span><span class="cx"> var fontFaceSet = new FontFaceSet([]);
</span><span class="cx"> shouldBeEqualToString(&quot;fontFaceSet.status&quot;, &quot;loaded&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsdomwindowopenaboutwebkitorgandaccessdocumentexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/dom/window-open-about-webkit-org-and-access-document-expected.txt (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/dom/window-open-about-webkit-org-and-access-document-expected.txt        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/LayoutTests/http/tests/dom/window-open-about-webkit-org-and-access-document-expected.txt        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> CONSOLE MESSAGE: line 34: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;null&quot;.  The frame requesting access has a protocol of &quot;http&quot;, the frame being accessed has a protocol of &quot;about&quot;. Protocols must match.
</span><span class="cx"> 
</span><del>-CONSOLE MESSAGE: line 347: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;null&quot;.  The frame requesting access has a protocol of &quot;http&quot;, the frame being accessed has a protocol of &quot;about&quot;. Protocols must match.
</del><ins>+CONSOLE MESSAGE: line 526: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;null&quot;.  The frame requesting access has a protocol of &quot;http&quot;, the frame being accessed has a protocol of &quot;about&quot;. Protocols must match.
</ins><span class="cx"> 
</span><span class="cx"> PASS newWindow.document is undefined.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsresourcesjstestprejs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/resources/js-test-pre.js (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/resources/js-test-pre.js        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/LayoutTests/http/tests/resources/js-test-pre.js        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -2,10 +2,25 @@
</span><span class="cx"> if (self.testRunner)
</span><span class="cx">     testRunner.dumpAsText(self.enablePixelTesting);
</span><span class="cx"> 
</span><del>-var description, debug, successfullyParsed, errorMessage;
</del><ins>+var description, debug, successfullyParsed, errorMessage, silentTestPass, didPassSomeTestsSilently, didFailSomeTests;
</ins><span class="cx"> 
</span><ins>+silentTestPass = false;
+didPassSomeTestsSilently = false;
+didFailSomeTests = false;
+
</ins><span class="cx"> (function() {
</span><span class="cx"> 
</span><ins>+    function createHTMLElement(tagName)
+    {
+        // FIXME: In an XML document, document.createElement() creates an element with a null namespace URI.
+        // So, we need use document.createElementNS() to explicitly create an element with the specified
+        // tag name in the HTML namespace. We can remove this function and use document.createElement()
+        // directly once we fix &lt;https://bugs.webkit.org/show_bug.cgi?id=131074&gt;.
+        if (document.createElementNS)
+            return document.createElementNS(&quot;http://www.w3.org/1999/xhtml&quot;, tagName);
+        return document.createElement(tagName);
+    }
+
</ins><span class="cx">     function getOrCreate(id, tagName)
</span><span class="cx">     {
</span><span class="cx">         var element = document.getElementById(id);
</span><span class="lines">@@ -12,7 +27,7 @@
</span><span class="cx">         if (element)
</span><span class="cx">             return element;
</span><span class="cx"> 
</span><del>-        element = document.createElement(tagName);
</del><ins>+        element = createHTMLElement(tagName);
</ins><span class="cx">         element.id = id;
</span><span class="cx">         var refNode;
</span><span class="cx">         var parent = document.body || document.documentElement;
</span><span class="lines">@@ -28,7 +43,7 @@
</span><span class="cx">     description = function description(msg, quiet)
</span><span class="cx">     {
</span><span class="cx">         // For MSIE 6 compatibility
</span><del>-        var span = document.createElement(&quot;span&quot;);
</del><ins>+        var span = createHTMLElement(&quot;span&quot;);
</ins><span class="cx">         if (quiet)
</span><span class="cx">             span.innerHTML = '&lt;p&gt;' + msg + '&lt;/p&gt;&lt;p&gt;On success, you will see no &quot;&lt;span class=&quot;fail&quot;&gt;FAIL&lt;/span&gt;&quot; messages, followed by &quot;&lt;span class=&quot;pass&quot;&gt;TEST COMPLETE&lt;/span&gt;&quot;.&lt;/p&gt;';
</span><span class="cx">         else
</span><span class="lines">@@ -43,7 +58,7 @@
</span><span class="cx"> 
</span><span class="cx">     debug = function debug(msg)
</span><span class="cx">     {
</span><del>-        var span = document.createElement(&quot;span&quot;);
</del><ins>+        var span = createHTMLElement(&quot;span&quot;);
</ins><span class="cx">         getOrCreate(&quot;console&quot;, &quot;div&quot;).appendChild(span); // insert it first so XHTML knows the namespace
</span><span class="cx">         span.innerHTML = msg + '&lt;br /&gt;';
</span><span class="cx">     };
</span><span class="lines">@@ -64,7 +79,7 @@
</span><span class="cx"> 
</span><span class="cx">     function insertStyleSheet()
</span><span class="cx">     {
</span><del>-        var styleElement = document.createElement(&quot;style&quot;);
</del><ins>+        var styleElement = createHTMLElement(&quot;style&quot;);
</ins><span class="cx">         styleElement.textContent = css;
</span><span class="cx">         (document.head || document.documentElement).appendChild(styleElement);
</span><span class="cx">     }
</span><span class="lines">@@ -96,14 +111,29 @@
</span><span class="cx"> 
</span><span class="cx"> function testPassed(msg)
</span><span class="cx"> {
</span><del>-    debug('&lt;span&gt;&lt;span class=&quot;pass&quot;&gt;PASS&lt;/span&gt; ' + escapeHTML(msg) + '&lt;/span&gt;');
</del><ins>+    if (silentTestPass)
+        didPassSomeTestsSilently = true;
+    else
+        debug('&lt;span&gt;&lt;span class=&quot;pass&quot;&gt;PASS&lt;/span&gt; ' + escapeHTML(msg) + '&lt;/span&gt;');
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function testFailed(msg)
</span><span class="cx"> {
</span><ins>+    didFailSomeTests = true;
</ins><span class="cx">     debug('&lt;span&gt;&lt;span class=&quot;fail&quot;&gt;FAIL&lt;/span&gt; ' + escapeHTML(msg) + '&lt;/span&gt;');
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function areNumbersEqual(_actual, _expected)
+{
+    if (_expected === 0)
+        return _actual === _expected &amp;&amp; (1/_actual) === (1/_expected);
+    if (_actual === _expected)
+        return true;
+    if (typeof(_expected) == &quot;number&quot; &amp;&amp; isNaN(_expected))
+        return typeof(_actual) == &quot;number&quot; &amp;&amp; isNaN(_actual);
+    return false;
+}
+
</ins><span class="cx"> function areArraysEqual(_a, _b)
</span><span class="cx"> {
</span><span class="cx">     try {
</span><span class="lines">@@ -110,7 +140,7 @@
</span><span class="cx">         if (_a.length !== _b.length)
</span><span class="cx">             return false;
</span><span class="cx">         for (var i = 0; i &lt; _a.length; i++)
</span><del>-            if (_a[i] !== _b[i])
</del><ins>+            if (!areNumbersEqual(_a[i], _b[i]))
</ins><span class="cx">                 return false;
</span><span class="cx">     } catch (ex) {
</span><span class="cx">         return false;
</span><span class="lines">@@ -125,15 +155,27 @@
</span><span class="cx">     return n === 0 &amp;&amp; 1/n &lt; 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function isTypedArray(array)
+{
+    return array instanceof Int8Array
+        || array instanceof Int16Array
+        || array instanceof Int32Array
+        || array instanceof Uint8Array
+        || array instanceof Uint8ClampedArray
+        || array instanceof Uint16Array
+        || array instanceof Uint32Array
+        || array instanceof Float32Array
+        || array instanceof Float64Array;
+}
+
</ins><span class="cx"> function isResultCorrect(_actual, _expected)
</span><span class="cx"> {
</span><del>-    if (_expected === 0)
-        return _actual === _expected &amp;&amp; (1/_actual) === (1/_expected);
-    if (_actual === _expected)
</del><ins>+    if (areNumbersEqual(_actual, _expected))
</ins><span class="cx">         return true;
</span><del>-    if (typeof(_expected) == &quot;number&quot; &amp;&amp; isNaN(_expected))
-        return typeof(_actual) == &quot;number&quot; &amp;&amp; isNaN(_actual);
-    if (_expected &amp;&amp; (Object.prototype.toString.call(_expected) == Object.prototype.toString.call([])))
</del><ins>+    if (_expected
+        &amp;&amp; (Object.prototype.toString.call(_expected) ==
+            Object.prototype.toString.call([])
+            || isTypedArray(_expected)))
</ins><span class="cx">         return areArraysEqual(_actual, _expected);
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="lines">@@ -142,16 +184,20 @@
</span><span class="cx"> {
</span><span class="cx">     if (v === 0 &amp;&amp; 1/v &lt; 0)
</span><span class="cx">         return &quot;-0&quot;;
</span><del>-    else return &quot;&quot; + v;
</del><ins>+    else if (isTypedArray(v))
+        return v.__proto__.constructor.name + &quot;:[&quot; + Array.prototype.join.call(v, &quot;,&quot;) + &quot;]&quot;;
+    else
+        return &quot;&quot; + v;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-function evalAndLog(_a)
</del><ins>+function evalAndLog(_a, _quiet)
</ins><span class="cx"> {
</span><span class="cx">   if (typeof _a != &quot;string&quot;)
</span><span class="cx">     debug(&quot;WARN: tryAndLog() expects a string argument&quot;);
</span><span class="cx"> 
</span><span class="cx">   // Log first in case things go horribly wrong or this causes a sync event.
</span><del>-  debug(_a);
</del><ins>+  if (!_quiet)
+    debug(_a);
</ins><span class="cx"> 
</span><span class="cx">   var _av;
</span><span class="cx">   try {
</span><span class="lines">@@ -176,17 +222,118 @@
</span><span class="cx">   var _bv = eval(_b);
</span><span class="cx"> 
</span><span class="cx">   if (exception)
</span><del>-    testFailed(_a + &quot; should be &quot; + _bv + &quot;. Threw exception &quot; + exception);
</del><ins>+    testFailed(_a + &quot; should be &quot; + stringify(_bv) + &quot;. Threw exception &quot; + exception);
</ins><span class="cx">   else if (isResultCorrect(_av, _bv)) {
</span><span class="cx">     if (!quiet) {
</span><span class="cx">         testPassed(_a + &quot; is &quot; + _b);
</span><span class="cx">     }
</span><span class="cx">   } else if (typeof(_av) == typeof(_bv))
</span><del>-    testFailed(_a + &quot; should be &quot; + _bv + &quot;. Was &quot; + stringify(_av) + &quot;.&quot;);
</del><ins>+    testFailed(_a + &quot; should be &quot; + stringify(_bv) + &quot;. Was &quot; + stringify(_av) + &quot;.&quot;);
</ins><span class="cx">   else
</span><del>-    testFailed(_a + &quot; should be &quot; + _bv + &quot; (of type &quot; + typeof _bv + &quot;). Was &quot; + _av + &quot; (of type &quot; + typeof _av + &quot;).&quot;);
</del><ins>+    testFailed(_a + &quot; should be &quot; + stringify(_bv) + &quot; (of type &quot; + typeof _bv + &quot;). Was &quot; + _av + &quot; (of type &quot; + typeof _av + &quot;).&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function dfgShouldBe(theFunction, _a, _b)
+{
+  if (typeof theFunction != &quot;function&quot; || typeof _a != &quot;string&quot; || typeof _b != &quot;string&quot;)
+    debug(&quot;WARN: dfgShouldBe() expects a function and two strings&quot;);
+  noInline(theFunction);
+  var exception;
+  var values = [];
+
+  // Defend against tests that muck with numeric properties on array.prototype.
+  values.__proto__ = null;
+  values.push = Array.prototype.push;
+  
+  try {
+    while (!dfgCompiled({f:theFunction}))
+      values.push(eval(_a));
+    values.push(eval(_a));
+  } catch (e) {
+    exception = e;
+  }
+
+  var _bv = eval(_b);
+  if (exception)
+    testFailed(_a + &quot; should be &quot; + stringify(_bv) + &quot;. On iteration &quot; + (values.length + 1) + &quot;, threw exception &quot; + exception);
+  else {
+    var allPassed = true;
+    for (var i = 0; i &lt; values.length; ++i) {
+      var _av = values[i];
+      if (isResultCorrect(_av, _bv))
+        continue;
+      if (typeof(_av) == typeof(_bv))
+        testFailed(_a + &quot; should be &quot; + stringify(_bv) + &quot;. On iteration &quot; + (i + 1) + &quot;, was &quot; + stringify(_av) + &quot;.&quot;);
+      else
+        testFailed(_a + &quot; should be &quot; + stringify(_bv) + &quot; (of type &quot; + typeof _bv + &quot;). On iteration &quot; + (i + 1) + &quot;, was &quot; + _av + &quot; (of type &quot; + typeof _av + &quot;).&quot;);
+      allPassed = false;
+    }
+    if (allPassed)
+      testPassed(_a + &quot; is &quot; + _b + &quot; on all iterations including after DFG tier-up.&quot;);
+  }
+  
+  return values.length;
+}
+
+// Execute condition every 5 milliseconds until it succeeds.
+function _waitForCondition(condition, completionHandler)
+{
+  if (condition())
+    completionHandler();
+  else
+    setTimeout(_waitForCondition, 5, condition, completionHandler);
+}
+
+function shouldBecomeEqual(_a, _b, completionHandler)
+{
+  if (typeof _a != &quot;string&quot; || typeof _b != &quot;string&quot;)
+    debug(&quot;WARN: shouldBecomeEqual() expects string arguments&quot;);
+
+  function condition() {
+    var exception;
+    var _av;
+    try {
+      _av = eval(_a);
+    } catch (e) {
+      exception = e;
+    }
+    var _bv = eval(_b);
+    if (exception)
+      testFailed(_a + &quot; should become &quot; + _bv + &quot;. Threw exception &quot; + exception);
+    if (isResultCorrect(_av, _bv)) {
+      testPassed(_a + &quot; became &quot; + _b);
+      return true;
+    }
+    return false;
+  }
+  setTimeout(_waitForCondition, 0, condition, completionHandler);
+}
+
+function shouldBecomeEqualToString(value, reference, completionHandler)
+{
+  if (typeof value !== &quot;string&quot; || typeof reference !== &quot;string&quot;)
+    debug(&quot;WARN: shouldBecomeEqualToString() expects string arguments&quot;);
+  var unevaledString = JSON.stringify(reference);
+  shouldBecomeEqual(value, unevaledString, completionHandler);
+}
+
+function shouldBeType(_a, _type) {
+  var exception;
+  var _av;
+  try {
+    _av = eval(_a);
+  } catch (e) {
+    exception = e;
+  }
+
+  var _typev = eval(_type);
+  if (_av instanceof _typev) {
+    testPassed(_a + &quot; is an instance of &quot; + _type);
+  } else {
+    testFailed(_a + &quot; is not an instance of &quot; + _type);
+  }
+}
+
</ins><span class="cx"> // Variant of shouldBe()--confirms that result of eval(_to_eval) is within
</span><span class="cx"> // numeric _tolerance of numeric _target.
</span><span class="cx"> function shouldBeCloseTo(_to_eval, _target, _tolerance, quiet)
</span><span class="lines">@@ -249,6 +396,31 @@
</span><span class="cx">     testFailed(_a + &quot; should not be &quot; + _bv + &quot;.&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function shouldBecomeDifferent(_a, _b, completionHandler)
+{
+  if (typeof _a != &quot;string&quot; || typeof _b != &quot;string&quot;)
+    debug(&quot;WARN: shouldBecomeDifferent() expects string arguments&quot;);
+
+  function condition() {
+    var exception;
+    var _av;
+    try {
+      _av = eval(_a);
+    } catch (e) {
+      exception = e;
+    }
+    var _bv = eval(_b);
+    if (exception)
+      testFailed(_a + &quot; should became not equal to &quot; + _bv + &quot;. Threw exception &quot; + exception);
+    if (!isResultCorrect(_av, _bv)) {
+      testPassed(_a + &quot; became different from &quot; + _b);
+      return true;
+    }
+    return false;
+  }
+  setTimeout(_waitForCondition, 0, condition, completionHandler);
+}
+
</ins><span class="cx"> function shouldBeTrue(_a) { shouldBe(_a, &quot;true&quot;); }
</span><span class="cx"> function shouldBeTrueQuiet(_a) { shouldBe(_a, &quot;true&quot;, true); }
</span><span class="cx"> function shouldBeFalse(_a) { shouldBe(_a, &quot;false&quot;); }
</span><span class="lines">@@ -264,6 +436,13 @@
</span><span class="cx">   shouldBe(a, unevaledString);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function shouldNotBeEqualToString(a, b)
+{
+  if (typeof a !== &quot;string&quot; || typeof b !== &quot;string&quot;)
+    debug(&quot;WARN: shouldBeEqualToString() expects string arguments&quot;);
+  var unevaledString = JSON.stringify(b);
+  shouldNotBe(a, unevaledString);
+}
</ins><span class="cx"> function shouldBeEmptyString(_a) { shouldBeEqualToString(_a, &quot;&quot;); }
</span><span class="cx"> 
</span><span class="cx"> function shouldEvaluateTo(actual, expected) {
</span><span class="lines">@@ -396,40 +575,66 @@
</span><span class="cx">         testPassed(_a + &quot; is &gt;= &quot; + _b);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function shouldNotThrow(_a) {
</del><ins>+function expectTrue(v, msg) {
+  if (v) {
+    testPassed(msg);
+  } else {
+    testFailed(msg);
+  }
+}
+
+function shouldNotThrow(_a, _message) {
</ins><span class="cx">     try {
</span><del>-        eval(_a);
-        testPassed(_a + &quot; did not throw exception.&quot;);
</del><ins>+        typeof _a == &quot;function&quot; ? _a() : eval(_a);
+        testPassed((_message ? _message : _a) + &quot; did not throw exception.&quot;);
</ins><span class="cx">     } catch (e) {
</span><del>-        testFailed(_a + &quot; should not throw exception. Threw exception &quot; + e + &quot;.&quot;);
</del><ins>+        testFailed((_message ? _message : _a) + &quot; should not throw exception. Threw exception &quot; + e + &quot;.&quot;);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function shouldThrow(_a, _e)
</del><ins>+function shouldThrow(_a, _e, _message)
</ins><span class="cx"> {
</span><del>-  var exception;
-  var _av;
-  try {
-     _av = eval(_a);
-  } catch (e) {
-     exception = e;
-  }
</del><ins>+    var _exception;
+    var _av;
+    try {
+        _av = typeof _a == &quot;function&quot; ? _a() : eval(_a);
+    } catch (e) {
+        _exception = e;
+    }
</ins><span class="cx"> 
</span><del>-  var _ev;
-  if (_e)
-      _ev =  eval(_e);
</del><ins>+    var _ev;
+    if (_e)
+        _ev = eval(_e);
</ins><span class="cx"> 
</span><del>-  if (exception) {
-    if (typeof _e == &quot;undefined&quot; || exception == _ev)
-      testPassed(_a + &quot; threw exception &quot; + exception + &quot;.&quot;);
</del><ins>+    if (_exception) {
+        if (typeof _e == &quot;undefined&quot; || _exception == _ev)
+            testPassed((_message ? _message : _a) + &quot; threw exception &quot; + _exception + &quot;.&quot;);
+        else
+            testFailed((_message ? _message : _a) + &quot; should throw &quot; + (typeof _e == &quot;undefined&quot; ? &quot;an exception&quot; : _ev) + &quot;. Threw exception &quot; + _exception + &quot;.&quot;);
+    } else if (typeof _av == &quot;undefined&quot;)
+        testFailed((_message ? _message : _a) + &quot; should throw &quot; + (typeof _e == &quot;undefined&quot; ? &quot;an exception&quot; : _ev) + &quot;. Was undefined.&quot;);
</ins><span class="cx">     else
</span><del>-      testFailed(_a + &quot; should throw &quot; + (typeof _e == &quot;undefined&quot; ? &quot;an exception&quot; : _ev) + &quot;. Threw exception &quot; + exception + &quot;.&quot;);
-  } else if (typeof _av == &quot;undefined&quot;)
-    testFailed(_a + &quot; should throw &quot; + (typeof _e == &quot;undefined&quot; ? &quot;an exception&quot; : _ev) + &quot;. Was undefined.&quot;);
-  else
-    testFailed(_a + &quot; should throw &quot; + (typeof _e == &quot;undefined&quot; ? &quot;an exception&quot; : _ev) + &quot;. Was &quot; + _av + &quot;.&quot;);
</del><ins>+        testFailed((_message ? _message : _a) + &quot; should throw &quot; + (typeof _e == &quot;undefined&quot; ? &quot;an exception&quot; : _ev) + &quot;. Was &quot; + _av + &quot;.&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function shouldThrowErrorName(_a, _name)
+{
+    var _exception;
+    try {
+        typeof _a == &quot;function&quot; ? _a() : eval(_a);
+    } catch (e) {
+        _exception = e;
+    }
+
+    if (_exception) {
+        if (_exception.name == _name)
+            testPassed(_a + &quot; threw exception &quot; + _exception + &quot;.&quot;);
+        else
+            testFailed(_a + &quot; should throw a &quot; + _name + &quot;. Threw a &quot; + _exception.name + &quot;.&quot;);
+    } else
+        testFailed(_a + &quot; should throw a &quot; + _name + &quot;. Did not throw.&quot;);
+}
+
</ins><span class="cx"> function shouldHaveHadError(message)
</span><span class="cx"> {
</span><span class="cx">     if (errorMessage) {
</span><span class="lines">@@ -460,6 +665,51 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function dfgCompiled(argument)
+{
+    var numberOfCompiles = &quot;compiles&quot; in argument ? argument.compiles : 1;
+    
+    if (!(&quot;f&quot; in argument))
+        throw new Error(&quot;dfgCompiled called with invalid argument.&quot;);
+    
+    if (argument.f instanceof Array) {
+        for (var i = 0; i &lt; argument.f.length; ++i) {
+            if (testRunner.numberOfDFGCompiles(argument.f[i]) &lt; numberOfCompiles)
+                return false;
+        }
+    } else {
+        if (testRunner.numberOfDFGCompiles(argument.f) &lt; numberOfCompiles)
+            return false;
+    }
+    
+    return true;
+}
+
+function dfgIncrement(argument)
+{
+    if (!self.testRunner)
+        return argument.i;
+    
+    if (argument.i &lt; argument.n)
+        return argument.i;
+    
+    if (didFailSomeTests)
+        return argument.i;
+    
+    if (!dfgCompiled(argument))
+        return &quot;start&quot; in argument ? argument.start : 0;
+    
+    return argument.i;
+}
+
+function noInline(theFunction)
+{
+    if (!self.testRunner)
+        return;
+    
+    testRunner.neverInlineFunction(theFunction);
+}
+
</ins><span class="cx"> function isSuccessfullyParsed()
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Remove this and only report unexpected syntax errors.
</span><span class="lines">@@ -466,6 +716,10 @@
</span><span class="cx">     if (!errorMessage)
</span><span class="cx">         successfullyParsed = true;
</span><span class="cx">     shouldBeTrue(&quot;successfullyParsed&quot;);
</span><ins>+    if (silentTestPass &amp;&amp; didPassSomeTestsSilently)
+        debug(&quot;Passed some tests silently.&quot;);
+    if (silentTestPass &amp;&amp; didFailSomeTests)
+        debug(&quot;Some tests failed.&quot;);
</ins><span class="cx">     debug('&lt;br /&gt;&lt;span class=&quot;pass&quot;&gt;TEST COMPLETE&lt;/span&gt;');
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityxssAuditorblockdoesnotleaklocationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/xssAuditor/block-does-not-leak-location-expected.txt (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/xssAuditor/block-does-not-leak-location-expected.txt        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/LayoutTests/http/tests/security/xssAuditor/block-does-not-leak-location-expected.txt        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -1,10 +1,10 @@
</span><span class="cx"> CONSOLE MESSAGE: line 7: The XSS Auditor blocked access to 'http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?test=/security/xssAuditor/block-does-not-leak-location.html&amp;enable-full-block=1&amp;q=%3Cscript%3Ealert(String.fromCharCode(0x58,0x53,0x53));%3C/script%3E' because the source code of a script was found within the request. The server sent an 'X-XSS-Protection' header requesting this behavior.
</span><del>-CONSOLE MESSAGE: line 172: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 172: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 176: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 347: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 172: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 176: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</del><ins>+CONSOLE MESSAGE: line 218: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 218: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 222: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 526: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 218: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 222: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</ins><span class="cx"> PASS xssed.contentDocument is null
</span><span class="cx"> PASS xssed.contentDocument is crossorigin.contentDocument
</span><span class="cx"> PASS xssed.contentWindow.location.href is undefined.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityxssAuditorblockdoesnotleakreferrerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/xssAuditor/block-does-not-leak-referrer-expected.txt (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/xssAuditor/block-does-not-leak-referrer-expected.txt        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/LayoutTests/http/tests/security/xssAuditor/block-does-not-leak-referrer-expected.txt        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> CONSOLE MESSAGE: line 4: The XSS Auditor blocked access to 'http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?enable-full-block=1&amp;q=%3Cscript%3Ealert(String.fromCharCode(0x58,0x53,0x53))%3C/script%3E' because the source code of a script was found within the request. The server sent an 'X-XSS-Protection' header requesting this behavior.
</span><del>-CONSOLE MESSAGE: line 172: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</del><ins>+CONSOLE MESSAGE: line 218: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</ins><span class="cx"> PASS frame.contentDocument is null
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestswebsockettestshybiwebsocketconstructorprotocolsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/websocket/tests/hybi/websocket-constructor-protocols-expected.txt (0 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/websocket/tests/hybi/websocket-constructor-protocols-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/websocket-constructor-protocols-expected.txt        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+CONSOLE MESSAGE: line 1: Wrong protocol for WebSocket 'a@'
+CONSOLE MESSAGE: line 1: Wrong protocol for WebSocket 'b@'
+CONSOLE MESSAGE: line 1: Wrong protocol for WebSocket 'c@'
+CONSOLE MESSAGE: line 1: Wrong protocol for WebSocket 'd@'
+CONSOLE MESSAGE: line 1: Wrong protocol for WebSocket 'e@'
+Construct a WebSocket with multiple protocols. It should throw an appropriate exception.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS new WebSocket(url, [&quot;a@&quot;]) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS new WebSocket(url, new Set([&quot;b@&quot;])) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS x = { toString: () =&gt; &quot;a&quot;, [Symbol.iterator]: function* () { yield &quot;c@&quot;; } }; new WebSocket(url, x) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS x = { toString: () =&gt; &quot;d@&quot;, [Symbol.iterator]: null }; new WebSocket(url, x) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS x = { toString: () =&gt; &quot;a&quot;, [Symbol.iterator]: 1 }; new WebSocket(url, x) threw exception TypeError: Symbol.iterator property should be callable.
+PASS x = { [Symbol.iterator]: function* () { yield &quot;e@&quot;; } }; new WebSocket(url, x) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS x = { [Symbol.iterator]: function* () { throw {name: &quot;SomeError&quot;, toString: () =&gt; &quot;Some error&quot; }; } }; new WebSocket(url, x) threw exception Some error.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestswebsockettestshybiwebsocketconstructorprotocolshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/websocket/tests/hybi/websocket-constructor-protocols.html (0 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/websocket/tests/hybi/websocket-constructor-protocols.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/websocket-constructor-protocols.html        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;body&gt;
+&lt;script src=&quot;/resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description('Construct a WebSocket with multiple protocols. It should throw an appropriate exception.');
+
+var url = &quot;ws://127.0.0.1:8880/websocket/tests/simple&quot;;
+shouldThrowErrorName('new WebSocket(url, [&quot;a@&quot;])', 'SyntaxError');
+shouldThrowErrorName('new WebSocket(url, new Set([&quot;b@&quot;]))', 'SyntaxError');
+shouldThrowErrorName('x = { toString: () =&gt; &quot;a&quot;, [Symbol.iterator]: function* () { yield &quot;c@&quot;; } }; new WebSocket(url, x)', 'SyntaxError');
+shouldThrowErrorName('x = { toString: () =&gt; &quot;d@&quot;, [Symbol.iterator]: null }; new WebSocket(url, x)', 'SyntaxError');
+shouldThrowErrorName('x = { toString: () =&gt; &quot;a&quot;, [Symbol.iterator]: 1 }; new WebSocket(url, x)', 'TypeError');
+shouldThrowErrorName('x = { [Symbol.iterator]: function* () { yield &quot;e@&quot;; } }; new WebSocket(url, x)', 'SyntaxError');
+shouldThrowErrorName('x = { [Symbol.iterator]: function* () { throw {name: &quot;SomeError&quot;, toString: () =&gt; &quot;Some error&quot; }; } }; new WebSocket(url, x)', 'SomeError');
+
+&lt;/script&gt;
+&lt;script src=&quot;/resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-08-15  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        Conversion to sequence&lt;T&gt; is broken for iterable objects
+        https://bugs.webkit.org/show_bug.cgi?id=160801
+
+        Reviewed by Darin Adler.
+
+        Export functions used to iterate over iterable objects.
+
+        * runtime/IteratorOperations.h:
+        (JSC::forEachInIterable):
+
</ins><span class="cx"> 2016-08-15  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Regression 204203-204210] 32-bit ASSERTION FAILED: !m_data[index].name.isValid()
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIteratorOperationsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IteratorOperations.h (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IteratorOperations.h        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/Source/JavaScriptCore/runtime/IteratorOperations.h        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -33,15 +33,15 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue iteratorNext(ExecState*, JSValue iterator, JSValue);
</span><span class="cx"> JSValue iteratorNext(ExecState*, JSValue iterator);
</span><del>-JSValue iteratorValue(ExecState*, JSValue iterator);
</del><ins>+JS_EXPORT_PRIVATE JSValue iteratorValue(ExecState*, JSValue iterator);
</ins><span class="cx"> bool iteratorComplete(ExecState*, JSValue iterator);
</span><del>-JSValue iteratorStep(ExecState*, JSValue iterator);
-void iteratorClose(ExecState*, JSValue iterator);
</del><ins>+JS_EXPORT_PRIVATE JSValue iteratorStep(ExecState*, JSValue iterator);
+JS_EXPORT_PRIVATE void iteratorClose(ExecState*, JSValue iterator);
</ins><span class="cx"> JS_EXPORT_PRIVATE JSObject* createIteratorResultObject(ExecState*, JSValue, bool done);
</span><span class="cx"> 
</span><span class="cx"> Structure* createIteratorResultObjectStructure(VM&amp;, JSGlobalObject&amp;);
</span><span class="cx"> 
</span><del>-JSValue iteratorForIterable(ExecState*, JSValue iterable);
</del><ins>+JS_EXPORT_PRIVATE JSValue iteratorForIterable(ExecState*, JSValue iterable);
</ins><span class="cx"> 
</span><span class="cx"> template &lt;typename CallBackType&gt;
</span><span class="cx"> void forEachInIterable(ExecState* state, JSValue iterable, const CallBackType&amp; callback)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.h (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.h        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.h        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -773,7 +773,7 @@
</span><span class="cx">         return &amp;m_butterfly;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    JSValue getMethod(ExecState* exec, CallData&amp; callData, CallType&amp; callType, const Identifier&amp; ident, const String&amp; errorMessage);
</del><ins>+    JS_EXPORT_PRIVATE JSValue getMethod(ExecState*, CallData&amp;, CallType&amp;, const Identifier&amp;, const String&amp; errorMessage);
</ins><span class="cx"> 
</span><span class="cx">     DECLARE_EXPORT_INFO;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/Source/WebCore/ChangeLog        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2016-08-15  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        Conversion to sequence&lt;T&gt; is broken for iterable objects
+        https://bugs.webkit.org/show_bug.cgi?id=160801
+
+        Reviewed by Darin Adler.
+
+        Added the proper iterator support for sequence&lt;T&gt; with one caveat that we don't check for RegExp object
+        per https://github.com/heycam/webidl/issues/145.
+
+        See http://heycam.github.io/webidl/#es-sequence and http://heycam.github.io/webidl/#es-overloads
+
+        Tests: bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl
+
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::hasIteratorMethod): Added. A helper function for checking whether a JSValue is iterable or not.
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::NativeValueTraits&lt;unsigned&gt;::nativeValue): Removed the check for isNumber to match the spec'ed
+        behavior at http://heycam.github.io/webidl/#es-unsigned-long which calls ToNumber first without checking
+        whether the value is a number or not.
+        (WebCore::toRefPtrNativeArray): Replaced isJSArray check by isObject check and throw a TypeError. Deployed
+        forEachInIterable to support non-JSArray iterable objects. Also removed the function pointer from the third
+        argument since we were always calling JSCT::toWrapped.
+        (WebCore::toNativeArray): Ditto.
+        * bindings/js/JSDOMConvert.h:
+        (WebCore::Converter&lt;Vector&lt;T&gt;&gt;::convert): Removed the comment about toNativeArray not throwing when value
+        is not an object.
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateOverloadedFunctionOrConstructor): Removed the check for isJSArray for sequence&lt;T&gt; as an iterable
+        object is not necessary a JSArray.
+        (WillConvertUndefinedToDefaultParameterValue): Don't return 1 for all sequences since toNativeArray and
+        toRefPtrNativeArray now throws on undefined due to isObject check.
+        (JSValueToNative): Removed the third argument from toRefPtrNativeArray.
+
+        * bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.cpp: Added.
+        * bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.h: Added.
+        * bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequencePrivate.h: Added.
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
+        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: Added.
+        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h: Added.
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        (WebCore::jsTestTypedefsPrototypeFunctionFunc):
+        * bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl: Added.
+
</ins><span class="cx"> 2016-08-15  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rename RegisteredEventListener::listener() to callback() for clarity
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -365,6 +365,22 @@
</span><span class="cx"> 
</span><span class="cx"> #undef TRY_TO_CREATE_EXCEPTION
</span><span class="cx"> 
</span><ins>+bool hasIteratorMethod(JSC::ExecState&amp; state, JSC::JSValue value)
+{
+    if (!value.isObject())
+        return false;
+
+    auto&amp; vm = state.vm();
+    JSObject* object = JSC::asObject(value);
+    CallData callData;
+    CallType callType;
+    JSValue applyMethod = object-&gt;getMethod(&amp;state, callData, callType, vm.propertyNames-&gt;iteratorSymbol, ASCIILiteral(&quot;Symbol.iterator property should be callable&quot;));
+    if (vm.exception())
+        return false;
+
+    return !applyMethod.isUndefined();
+}
+
</ins><span class="cx"> bool shouldAllowAccessToNode(ExecState* exec, Node* node)
</span><span class="cx"> {
</span><span class="cx">     return BindingSecurity::shouldAllowAccessToNode(exec, node);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -285,9 +285,10 @@
</span><span class="cx"> RefPtr&lt;JSC::Float32Array&gt; toFloat32Array(JSC::JSValue);
</span><span class="cx"> RefPtr&lt;JSC::Float64Array&gt; toFloat64Array(JSC::JSValue);
</span><span class="cx"> 
</span><del>-template&lt;typename T, typename JSType&gt; Vector&lt;RefPtr&lt;T&gt;&gt; toRefPtrNativeArray(JSC::ExecState*, JSC::JSValue, T* (*)(JSC::JSValue));
</del><ins>+template&lt;typename T, typename JSType&gt; Vector&lt;RefPtr&lt;T&gt;&gt; toRefPtrNativeArray(JSC::ExecState*, JSC::JSValue);
</ins><span class="cx"> template&lt;typename T&gt; Vector&lt;T&gt; toNativeArray(JSC::ExecState&amp;, JSC::JSValue);
</span><span class="cx"> template&lt;typename T&gt; Vector&lt;T&gt; toNativeArguments(JSC::ExecState&amp;, size_t startIndex = 0);
</span><ins>+bool hasIteratorMethod(JSC::ExecState&amp;, JSC::JSValue);
</ins><span class="cx"> 
</span><span class="cx"> bool shouldAllowAccessToNode(JSC::ExecState*, Node*);
</span><span class="cx"> bool shouldAllowAccessToFrame(JSC::ExecState*, Frame*);
</span><span class="lines">@@ -674,14 +675,8 @@
</span><span class="cx"> template&lt;&gt; struct NativeValueTraits&lt;unsigned&gt; {
</span><span class="cx">     static inline bool nativeValue(JSC::ExecState&amp; exec, JSC::JSValue jsValue, unsigned&amp; indexedValue)
</span><span class="cx">     {
</span><del>-        if (!jsValue.isNumber())
-            return false;
-
</del><span class="cx">         indexedValue = jsValue.toUInt32(&amp;exec);
</span><del>-        if (exec.hadException())
-            return false;
-
-        return true;
</del><ins>+        return !exec.hadException();
</ins><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -701,50 +696,38 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template&lt;typename T, typename JST&gt; Vector&lt;RefPtr&lt;T&gt;&gt; toRefPtrNativeArray(JSC::ExecState* exec, JSC::JSValue value, T* (*toT)(JSC::JSValue value))
</del><ins>+template&lt;typename T, typename JST&gt; Vector&lt;RefPtr&lt;T&gt;&gt; toRefPtrNativeArray(JSC::ExecState&amp; exec, JSC::JSValue value)
</ins><span class="cx"> {
</span><del>-    if (!isJSArray(value))
</del><ins>+    if (!value.isObject()) {
+        throwSequenceTypeError(exec);
</ins><span class="cx">         return Vector&lt;RefPtr&lt;T&gt;&gt;();
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;RefPtr&lt;T&gt;&gt; result;
</span><del>-    JSC::JSArray* array = asArray(value);
-    size_t size = array-&gt;length();
-    result.reserveInitialCapacity(size);
-    for (size_t i = 0; i &lt; size; ++i) {
-        JSC::JSValue element = array-&gt;getIndex(exec, i);
-        if (element.inherits(JST::info()))
-            result.uncheckedAppend((*toT)(element));
-        else {
-            throwArrayElementTypeError(*exec);
-            return Vector&lt;RefPtr&lt;T&gt;&gt;();
-        }
-    }
</del><ins>+    forEachInIterable(&amp;exec, value, [&amp;result](JSC::VM&amp;, JSC::ExecState* state, JSC::JSValue jsValue) {
+        if (jsValue.inherits(JST::info()))
+            result.append(JST::toWrapped(jsValue));
+        else
+            throwArrayElementTypeError(*state);
+    });
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt; Vector&lt;T&gt; toNativeArray(JSC::ExecState&amp; exec, JSC::JSValue value)
</span><span class="cx"> {
</span><del>-    JSC::JSObject* object = value.getObject();
-    if (!object)
</del><ins>+    if (!value.isObject()) {
+        throwSequenceTypeError(exec);
</ins><span class="cx">         return Vector&lt;T&gt;();
</span><ins>+    }
</ins><span class="cx"> 
</span><del>-    unsigned length = 0;
-    if (isJSArray(value)) {
-        JSC::JSArray* array = asArray(value);
-        length = array-&gt;length();
-    } else
-        toJSSequence(exec, value, length);
-
</del><span class="cx">     Vector&lt;T&gt; result;
</span><del>-    result.reserveInitialCapacity(length);
-    typedef NativeValueTraits&lt;T&gt; TraitsType;
-
-    for (unsigned i = 0; i &lt; length; ++i) {
-        T indexValue;
-        if (!TraitsType::nativeValue(exec, object-&gt;get(&amp;exec, i), indexValue))
-            return Vector&lt;T&gt;();
-        result.uncheckedAppend(indexValue);
-    }
</del><ins>+    forEachInIterable(&amp;exec, value, [&amp;result](JSC::VM&amp;, JSC::ExecState* state, JSC::JSValue jsValue) {
+        T convertedValue;
+        if (!NativeValueTraits&lt;T&gt;::nativeValue(*state, jsValue, convertedValue))
+            return;
+        ASSERT(!state-&gt;hadException());
+        result.append(convertedValue);
+    });
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMConverth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMConvert.h (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -142,7 +142,6 @@
</span><span class="cx"> template&lt;typename T&gt; struct Converter&lt;Vector&lt;T&gt;&gt; : DefaultConverter&lt;Vector&lt;T&gt;&gt; {
</span><span class="cx">     static Vector&lt;T&gt; convert(JSC::ExecState&amp; state, JSC::JSValue value)
</span><span class="cx">     {
</span><del>-        // FIXME: The toNativeArray function doesn't throw a type error if the value is not an object. Is that OK?
</del><span class="cx">         return toNativeArray&lt;T&gt;(state, value);
</span><span class="cx">     }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -1924,8 +1924,9 @@
</span><span class="cx">             $overload = GetOverloadThatMatches($S, $d, \&amp;$isObjectOrCallbackFunctionParameter);
</span><span class="cx">             &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isFunction()&quot;);
</span><span class="cx"> 
</span><ins>+            # FIXME: Avoid invoking GetMethod(object, Symbol.iterator) again in toNativeArray and toRefPtrNativeArray.
</ins><span class="cx">             $overload = GetOverloadThatMatches($S, $d, \&amp;$isSequenceParameter);
</span><del>-            &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isObject() &amp;&amp; isJSArray(distinguishingArg)&quot;);
</del><ins>+            &amp;$generateOverloadCallIfNecessary($overload, &quot;hasIteratorMethod(*state, distinguishingArg)&quot;);
</ins><span class="cx"> 
</span><span class="cx">             $overload = GetOverloadThatMatches($S, $d, \&amp;$isDictionaryOrObjectOrCallbackInterfaceParameter);
</span><span class="cx">             &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;type() != RegExpObjectType&quot;);
</span><span class="lines">@@ -3781,9 +3782,6 @@
</span><span class="cx">     my $automaticallyGeneratedDefaultValue = $automaticallyGeneratedDefaultValues{$parameterType};
</span><span class="cx">     return 1 if defined $automaticallyGeneratedDefaultValue &amp;&amp; $automaticallyGeneratedDefaultValue eq $defaultValue;
</span><span class="cx"> 
</span><del>-    # toRefPtrNativeArray() will convert undefined to an empty Vector.
-    return 1 if $defaultValue eq &quot;[]&quot; &amp;&amp; $codeGenerator-&gt;GetSequenceType($parameterType);
-
</del><span class="cx">     return 1 if $defaultValue eq &quot;null&quot; &amp;&amp; $codeGenerator-&gt;IsWrapperType($parameterType);
</span><span class="cx"> 
</span><span class="cx">     return 0;
</span><span class="lines">@@ -4667,7 +4665,7 @@
</span><span class="cx">     if ($sequenceType) {
</span><span class="cx">         if ($codeGenerator-&gt;IsRefPtrType($sequenceType)) {
</span><span class="cx">             AddToImplIncludes(&quot;JS${sequenceType}.h&quot;);
</span><del>-            return (&quot;(toRefPtrNativeArray&lt;${sequenceType}, JS${sequenceType}&gt;(state, $value, &amp;JS${sequenceType}::toWrapped))&quot;, 1);
</del><ins>+            return (&quot;toRefPtrNativeArray&lt;${sequenceType}, JS${sequenceType}&gt;(*state, $value)&quot;, 1);
</ins><span class="cx">         }
</span><span class="cx">         return (&quot;toNativeArray&lt;&quot; . GetNativeVectorInnerType($sequenceType) . &quot;&gt;(*state, $value)&quot;, 1);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestOverloadedConstructorsWithSequencecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.cpp (0 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.cpp        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -0,0 +1,104 @@
</span><ins>+/*
+ *  This file is part of the WebKit open source project.
+ *  This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebKitDOMTestOverloadedConstructorsWithSequence.h&quot;
+
+#include &quot;CSSImportRule.h&quot;
+#include &quot;DOMObjectCache.h&quot;
+#include &quot;Document.h&quot;
+#include &quot;ExceptionCode.h&quot;
+#include &quot;ExceptionCodeDescription.h&quot;
+#include &quot;JSMainThreadExecState.h&quot;
+#include &quot;WebKitDOMPrivate.h&quot;
+#include &quot;WebKitDOMTestOverloadedConstructorsWithSequencePrivate.h&quot;
+#include &quot;gobject/ConvertToUTF8String.h&quot;
+#include &lt;wtf/GetPtr.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+
+#define WEBKIT_DOM_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE_GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE(obj, WEBKIT_DOM_TYPE_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE, WebKitDOMTestOverloadedConstructorsWithSequencePrivate)
+
+typedef struct _WebKitDOMTestOverloadedConstructorsWithSequencePrivate {
+    RefPtr&lt;WebCore::TestOverloadedConstructorsWithSequence&gt; coreObject;
+} WebKitDOMTestOverloadedConstructorsWithSequencePrivate;
+
+namespace WebKit {
+
+WebKitDOMTestOverloadedConstructorsWithSequence* kit(WebCore::TestOverloadedConstructorsWithSequence* obj)
+{
+    if (!obj)
+        return 0;
+
+    if (gpointer ret = DOMObjectCache::get(obj))
+        return WEBKIT_DOM_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE(ret);
+
+    return wrapTestOverloadedConstructorsWithSequence(obj);
+}
+
+WebCore::TestOverloadedConstructorsWithSequence* core(WebKitDOMTestOverloadedConstructorsWithSequence* request)
+{
+    return request ? static_cast&lt;WebCore::TestOverloadedConstructorsWithSequence*&gt;(WEBKIT_DOM_OBJECT(request)-&gt;coreObject) : 0;
+}
+
+WebKitDOMTestOverloadedConstructorsWithSequence* wrapTestOverloadedConstructorsWithSequence(WebCore::TestOverloadedConstructorsWithSequence* coreObject)
+{
+    ASSERT(coreObject);
+    return WEBKIT_DOM_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE(g_object_new(WEBKIT_DOM_TYPE_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE, &quot;core-object&quot;, coreObject, nullptr));
+}
+
+} // namespace WebKit
+
+G_DEFINE_TYPE(WebKitDOMTestOverloadedConstructorsWithSequence, webkit_dom_test_overloaded_constructors_with_sequence, WEBKIT_DOM_TYPE_OBJECT)
+
+static void webkit_dom_test_overloaded_constructors_with_sequence_finalize(GObject* object)
+{
+    WebKitDOMTestOverloadedConstructorsWithSequencePrivate* priv = WEBKIT_DOM_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE_GET_PRIVATE(object);
+
+    WebKit::DOMObjectCache::forget(priv-&gt;coreObject.get());
+
+    priv-&gt;~WebKitDOMTestOverloadedConstructorsWithSequencePrivate();
+    G_OBJECT_CLASS(webkit_dom_test_overloaded_constructors_with_sequence_parent_class)-&gt;finalize(object);
+}
+
+static GObject* webkit_dom_test_overloaded_constructors_with_sequence_constructor(GType type, guint constructPropertiesCount, GObjectConstructParam* constructProperties)
+{
+    GObject* object = G_OBJECT_CLASS(webkit_dom_test_overloaded_constructors_with_sequence_parent_class)-&gt;constructor(type, constructPropertiesCount, constructProperties);
+
+    WebKitDOMTestOverloadedConstructorsWithSequencePrivate* priv = WEBKIT_DOM_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE_GET_PRIVATE(object);
+    priv-&gt;coreObject = static_cast&lt;WebCore::TestOverloadedConstructorsWithSequence*&gt;(WEBKIT_DOM_OBJECT(object)-&gt;coreObject);
+    WebKit::DOMObjectCache::put(priv-&gt;coreObject.get(), object);
+
+    return object;
+}
+
+static void webkit_dom_test_overloaded_constructors_with_sequence_class_init(WebKitDOMTestOverloadedConstructorsWithSequenceClass* requestClass)
+{
+    GObjectClass* gobjectClass = G_OBJECT_CLASS(requestClass);
+    g_type_class_add_private(gobjectClass, sizeof(WebKitDOMTestOverloadedConstructorsWithSequencePrivate));
+    gobjectClass-&gt;constructor = webkit_dom_test_overloaded_constructors_with_sequence_constructor;
+    gobjectClass-&gt;finalize = webkit_dom_test_overloaded_constructors_with_sequence_finalize;
+}
+
+static void webkit_dom_test_overloaded_constructors_with_sequence_init(WebKitDOMTestOverloadedConstructorsWithSequence* request)
+{
+    WebKitDOMTestOverloadedConstructorsWithSequencePrivate* priv = WEBKIT_DOM_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE_GET_PRIVATE(request);
+    new (priv) WebKitDOMTestOverloadedConstructorsWithSequencePrivate();
+}
+
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestOverloadedConstructorsWithSequenceh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.h (0 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.h                                (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.h        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+/*
+ *  This file is part of the WebKit open source project.
+ *  This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitDOMTestOverloadedConstructorsWithSequence_h
+#define WebKitDOMTestOverloadedConstructorsWithSequence_h
+
+#ifdef WEBKIT_DOM_USE_UNSTABLE_API
+
+#include &lt;glib-object.h&gt;
+#include &lt;webkitdom/WebKitDOMObject.h&gt;
+#include &lt;webkitdom/webkitdomdefines-unstable.h&gt;
+
+G_BEGIN_DECLS
+
+#define WEBKIT_DOM_TYPE_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE            (webkit_dom_test_overloaded_constructors_with_sequence_get_type())
+#define WEBKIT_DOM_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_DOM_TYPE_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE, WebKitDOMTestOverloadedConstructorsWithSequence))
+#define WEBKIT_DOM_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_DOM_TYPE_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE, WebKitDOMTestOverloadedConstructorsWithSequenceClass)
+#define WEBKIT_DOM_IS_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_DOM_TYPE_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE))
+#define WEBKIT_DOM_IS_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_DOM_TYPE_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE))
+#define WEBKIT_DOM_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_DOM_TYPE_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE, WebKitDOMTestOverloadedConstructorsWithSequenceClass))
+
+struct _WebKitDOMTestOverloadedConstructorsWithSequence {
+    WebKitDOMObject parent_instance;
+};
+
+struct _WebKitDOMTestOverloadedConstructorsWithSequenceClass {
+    WebKitDOMObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_dom_test_overloaded_constructors_with_sequence_get_type(void);
+
+G_END_DECLS
+
+#endif /* WEBKIT_DOM_USE_UNSTABLE_API */
+#endif /* WebKitDOMTestOverloadedConstructorsWithSequence_h */
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestOverloadedConstructorsWithSequencePrivateh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequencePrivate.h (0 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequencePrivate.h                                (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequencePrivate.h        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ *  This file is part of the WebKit open source project.
+ *  This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitDOMTestOverloadedConstructorsWithSequencePrivate_h
+#define WebKitDOMTestOverloadedConstructorsWithSequencePrivate_h
+
+#include &quot;TestOverloadedConstructorsWithSequence.h&quot;
+#include &lt;webkitdom/WebKitDOMTestOverloadedConstructorsWithSequence.h&gt;
+
+namespace WebKit {
+WebKitDOMTestOverloadedConstructorsWithSequence* wrapTestOverloadedConstructorsWithSequence(WebCore::TestOverloadedConstructorsWithSequence*);
+WebKitDOMTestOverloadedConstructorsWithSequence* kit(WebCore::TestOverloadedConstructorsWithSequence*);
+WebCore::TestOverloadedConstructorsWithSequence* core(WebKitDOMTestOverloadedConstructorsWithSequence*);
+} // namespace WebKit
+
+#endif /* WebKitDOMTestOverloadedConstructorsWithSequencePrivate_h */
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -5172,7 +5172,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObject&quot;, &quot;methodWithOptionalSequenceIsEmpty&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto array = toNativeArray&lt;String&gt;(*state, state-&gt;argument(0));
</del><ins>+    auto array = state-&gt;argument(0).isUndefined() ? Vector&lt;String&gt;() : toNativeArray&lt;String&gt;(*state, state-&gt;uncheckedArgument(0));
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalSequenceIsEmpty(WTFMove(array));
</span><span class="lines">@@ -5701,7 +5701,7 @@
</span><span class="cx">             return jsTestObjPrototypeFunctionOverloadedMethod8(state);
</span><span class="cx">         if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSBlob::info()))
</span><span class="cx">             return jsTestObjPrototypeFunctionOverloadedMethod12(state);
</span><del>-        if (distinguishingArg.isObject() &amp;&amp; isJSArray(distinguishingArg))
</del><ins>+        if (hasIteratorMethod(*state, distinguishingArg))
</ins><span class="cx">             return jsTestObjPrototypeFunctionOverloadedMethod7(state);
</span><span class="cx">         if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;type() != RegExpObjectType)
</span><span class="cx">             return jsTestObjPrototypeFunctionOverloadedMethod5(state);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsWithSequencecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp (0 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -0,0 +1,243 @@
</span><ins>+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include &quot;config.h&quot;
+#include &quot;JSTestOverloadedConstructorsWithSequence.h&quot;
+
+#include &quot;ExceptionCode.h&quot;
+#include &quot;JSDOMBinding.h&quot;
+#include &quot;JSDOMConstructor.h&quot;
+#include &lt;runtime/Error.h&gt;
+#include &lt;runtime/FunctionPrototype.h&gt;
+#include &lt;wtf/GetPtr.h&gt;
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Attributes
+
+JSC::EncodedJSValue jsTestOverloadedConstructorsWithSequenceConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestOverloadedConstructorsWithSequenceConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+class JSTestOverloadedConstructorsWithSequencePrototype : public JSC::JSNonFinalObject {
+public:
+    typedef JSC::JSNonFinalObject Base;
+    static JSTestOverloadedConstructorsWithSequencePrototype* create(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestOverloadedConstructorsWithSequencePrototype* ptr = new (NotNull, JSC::allocateCell&lt;JSTestOverloadedConstructorsWithSequencePrototype&gt;(vm.heap)) JSTestOverloadedConstructorsWithSequencePrototype(vm, globalObject, structure);
+        ptr-&gt;finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestOverloadedConstructorsWithSequencePrototype(JSC::VM&amp; vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&amp;);
+};
+
+typedef JSDOMConstructor&lt;JSTestOverloadedConstructorsWithSequence&gt; JSTestOverloadedConstructorsWithSequenceConstructor;
+
+static inline EncodedJSValue constructJSTestOverloadedConstructorsWithSequence1(ExecState* state)
+{
+    auto* castedThis = jsCast&lt;JSTestOverloadedConstructorsWithSequenceConstructor*&gt;(state-&gt;callee());
+    auto sequenceOfStrings = state-&gt;argument(0).isUndefined() ? Vector&lt;String&gt;() : toNativeArray&lt;String&gt;(*state, state-&gt;uncheckedArgument(0));
+    if (UNLIKELY(state-&gt;hadException()))
+        return JSValue::encode(jsUndefined());
+    auto object = TestOverloadedConstructorsWithSequence::create(sequenceOfStrings);
+    return JSValue::encode(asObject(toJSNewlyCreated(state, castedThis-&gt;globalObject(), WTFMove(object))));
+}
+
+static inline EncodedJSValue constructJSTestOverloadedConstructorsWithSequence2(ExecState* state)
+{
+    auto* castedThis = jsCast&lt;JSTestOverloadedConstructorsWithSequenceConstructor*&gt;(state-&gt;callee());
+    if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
+        return throwVMError(state, createNotEnoughArgumentsError(state));
+    auto string = state-&gt;argument(0).toWTFString(state);
+    if (UNLIKELY(state-&gt;hadException()))
+        return JSValue::encode(jsUndefined());
+    auto object = TestOverloadedConstructorsWithSequence::create(string);
+    return JSValue::encode(asObject(toJSNewlyCreated(state, castedThis-&gt;globalObject(), WTFMove(object))));
+}
+
+template&lt;&gt; EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsWithSequenceConstructor::construct(ExecState* state)
+{
+    size_t argsCount = std::min&lt;size_t&gt;(1, state-&gt;argumentCount());
+    if (argsCount == 0) {
+        return constructJSTestOverloadedConstructorsWithSequence1(state);
+    }
+    if (argsCount == 1) {
+        JSValue distinguishingArg = state-&gt;uncheckedArgument(0);
+        if (distinguishingArg.isUndefined())
+            return constructJSTestOverloadedConstructorsWithSequence1(state);
+        if (hasIteratorMethod(*state, distinguishingArg))
+            return constructJSTestOverloadedConstructorsWithSequence1(state);
+        return constructJSTestOverloadedConstructorsWithSequence2(state);
+    }
+    return throwVMTypeError(state);
+}
+
+template&lt;&gt; JSValue JSTestOverloadedConstructorsWithSequenceConstructor::prototypeForStructure(JSC::VM&amp; vm, const JSDOMGlobalObject&amp; globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.functionPrototype();
+}
+
+template&lt;&gt; void JSTestOverloadedConstructorsWithSequenceConstructor::initializeProperties(VM&amp; vm, JSDOMGlobalObject&amp; globalObject)
+{
+    putDirect(vm, vm.propertyNames-&gt;prototype, JSTestOverloadedConstructorsWithSequence::prototype(vm, &amp;globalObject), DontDelete | ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames-&gt;name, jsNontrivialString(&amp;vm, String(ASCIILiteral(&quot;TestOverloadedConstructorsWithSequence&quot;))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames-&gt;length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template&lt;&gt; const ClassInfo JSTestOverloadedConstructorsWithSequenceConstructor::s_info = { &quot;TestOverloadedConstructorsWithSequence&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSTestOverloadedConstructorsWithSequenceConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestOverloadedConstructorsWithSequencePrototypeTableValues[] =
+{
+    { &quot;constructor&quot;, DontEnum, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestOverloadedConstructorsWithSequenceConstructor), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestOverloadedConstructorsWithSequenceConstructor) } },
+};
+
+const ClassInfo JSTestOverloadedConstructorsWithSequencePrototype::s_info = { &quot;TestOverloadedConstructorsWithSequencePrototype&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSTestOverloadedConstructorsWithSequencePrototype) };
+
+void JSTestOverloadedConstructorsWithSequencePrototype::finishCreation(VM&amp; vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestOverloadedConstructorsWithSequencePrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestOverloadedConstructorsWithSequence::s_info = { &quot;TestOverloadedConstructorsWithSequence&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSTestOverloadedConstructorsWithSequence) };
+
+JSTestOverloadedConstructorsWithSequence::JSTestOverloadedConstructorsWithSequence(Structure* structure, JSDOMGlobalObject&amp; globalObject, Ref&lt;TestOverloadedConstructorsWithSequence&gt;&amp;&amp; impl)
+    : JSDOMWrapper&lt;TestOverloadedConstructorsWithSequence&gt;(structure, globalObject, WTFMove(impl))
+{
+}
+
+JSObject* JSTestOverloadedConstructorsWithSequence::createPrototype(VM&amp; vm, JSGlobalObject* globalObject)
+{
+    return JSTestOverloadedConstructorsWithSequencePrototype::create(vm, globalObject, JSTestOverloadedConstructorsWithSequencePrototype::createStructure(vm, globalObject, globalObject-&gt;objectPrototype()));
+}
+
+JSObject* JSTestOverloadedConstructorsWithSequence::prototype(VM&amp; vm, JSGlobalObject* globalObject)
+{
+    return getDOMPrototype&lt;JSTestOverloadedConstructorsWithSequence&gt;(vm, globalObject);
+}
+
+void JSTestOverloadedConstructorsWithSequence::destroy(JSC::JSCell* cell)
+{
+    JSTestOverloadedConstructorsWithSequence* thisObject = static_cast&lt;JSTestOverloadedConstructorsWithSequence*&gt;(cell);
+    thisObject-&gt;JSTestOverloadedConstructorsWithSequence::~JSTestOverloadedConstructorsWithSequence();
+}
+
+EncodedJSValue jsTestOverloadedConstructorsWithSequenceConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    JSTestOverloadedConstructorsWithSequencePrototype* domObject = jsDynamicCast&lt;JSTestOverloadedConstructorsWithSequencePrototype*&gt;(JSValue::decode(thisValue));
+    if (UNLIKELY(!domObject))
+        return throwVMTypeError(state);
+    return JSValue::encode(JSTestOverloadedConstructorsWithSequence::getConstructor(state-&gt;vm(), domObject-&gt;globalObject()));
+}
+
+bool setJSTestOverloadedConstructorsWithSequenceConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    JSValue value = JSValue::decode(encodedValue);
+    JSTestOverloadedConstructorsWithSequencePrototype* domObject = jsDynamicCast&lt;JSTestOverloadedConstructorsWithSequencePrototype*&gt;(JSValue::decode(thisValue));
+    if (UNLIKELY(!domObject)) {
+        throwVMTypeError(state);
+        return false;
+    }
+    // Shadowing a built-in constructor
+    return domObject-&gt;putDirect(state-&gt;vm(), state-&gt;propertyNames().constructor, value);
+}
+
+JSValue JSTestOverloadedConstructorsWithSequence::getConstructor(VM&amp; vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor&lt;JSTestOverloadedConstructorsWithSequenceConstructor&gt;(vm, *jsCast&lt;const JSDOMGlobalObject*&gt;(globalObject));
+}
+
+bool JSTestOverloadedConstructorsWithSequenceOwner::isReachableFromOpaqueRoots(JSC::Handle&lt;JSC::Unknown&gt; handle, void*, SlotVisitor&amp; visitor)
+{
+    UNUSED_PARAM(handle);
+    UNUSED_PARAM(visitor);
+    return false;
+}
+
+void JSTestOverloadedConstructorsWithSequenceOwner::finalize(JSC::Handle&lt;JSC::Unknown&gt; handle, void* context)
+{
+    auto* jsTestOverloadedConstructorsWithSequence = jsCast&lt;JSTestOverloadedConstructorsWithSequence*&gt;(handle.slot()-&gt;asCell());
+    auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
+    uncacheWrapper(world, &amp;jsTestOverloadedConstructorsWithSequence-&gt;wrapped(), jsTestOverloadedConstructorsWithSequence);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern &quot;C&quot; { extern void (*const __identifier(&quot;??_7TestOverloadedConstructorsWithSequence@WebCore@@6B@&quot;)[])(); }
+#else
+extern &quot;C&quot; { extern void* _ZTVN7WebCore38TestOverloadedConstructorsWithSequenceE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestOverloadedConstructorsWithSequence&gt;&amp;&amp; impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+    void* actualVTablePointer = *(reinterpret_cast&lt;void**&gt;(impl.ptr()));
+#if PLATFORM(WIN)
+    void* expectedVTablePointer = reinterpret_cast&lt;void*&gt;(__identifier(&quot;??_7TestOverloadedConstructorsWithSequence@WebCore@@6B@&quot;));
+#else
+    void* expectedVTablePointer = &amp;_ZTVN7WebCore38TestOverloadedConstructorsWithSequenceE[2];
+#if COMPILER(CLANG)
+    // If this fails TestOverloadedConstructorsWithSequence does not have a vtable, so you need to add the
+    // ImplementationLacksVTable attribute to the interface definition
+    static_assert(__is_polymorphic(TestOverloadedConstructorsWithSequence), &quot;TestOverloadedConstructorsWithSequence is not polymorphic&quot;);
+#endif
+#endif
+    // If you hit this assertion you either have a use after free bug, or
+    // TestOverloadedConstructorsWithSequence has subclasses. If TestOverloadedConstructorsWithSequence has subclasses that get passed
+    // to toJS() we currently require TestOverloadedConstructorsWithSequence you to opt out of binding hardening
+    // by adding the SkipVTableValidation attribute to the interface IDL definition
+    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+    return createWrapper&lt;JSTestOverloadedConstructorsWithSequence, TestOverloadedConstructorsWithSequence&gt;(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestOverloadedConstructorsWithSequence&amp; impl)
+{
+    return wrap(state, globalObject, impl);
+}
+
+TestOverloadedConstructorsWithSequence* JSTestOverloadedConstructorsWithSequence::toWrapped(JSC::JSValue value)
+{
+    if (auto* wrapper = jsDynamicCast&lt;JSTestOverloadedConstructorsWithSequence*&gt;(value))
+        return &amp;wrapper-&gt;wrapped();
+    return nullptr;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsWithSequenceh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h (0 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h                                (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -0,0 +1,86 @@
</span><ins>+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include &quot;JSDOMWrapper.h&quot;
+#include &quot;TestOverloadedConstructorsWithSequence.h&quot;
+#include &lt;wtf/NeverDestroyed.h&gt;
+
+namespace WebCore {
+
+class JSTestOverloadedConstructorsWithSequence : public JSDOMWrapper&lt;TestOverloadedConstructorsWithSequence&gt; {
+public:
+    typedef JSDOMWrapper&lt;TestOverloadedConstructorsWithSequence&gt; Base;
+    static JSTestOverloadedConstructorsWithSequence* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&lt;TestOverloadedConstructorsWithSequence&gt;&amp;&amp; impl)
+    {
+        JSTestOverloadedConstructorsWithSequence* ptr = new (NotNull, JSC::allocateCell&lt;JSTestOverloadedConstructorsWithSequence&gt;(globalObject-&gt;vm().heap)) JSTestOverloadedConstructorsWithSequence(structure, *globalObject, WTFMove(impl));
+        ptr-&gt;finishCreation(globalObject-&gt;vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&amp;, JSC::JSGlobalObject*);
+    static JSC::JSObject* prototype(JSC::VM&amp;, JSC::JSGlobalObject*);
+    static TestOverloadedConstructorsWithSequence* toWrapped(JSC::JSValue);
+    static void destroy(JSC::JSCell*);
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::JSValue getConstructor(JSC::VM&amp;, const JSC::JSGlobalObject*);
+protected:
+    JSTestOverloadedConstructorsWithSequence(JSC::Structure*, JSDOMGlobalObject&amp;, Ref&lt;TestOverloadedConstructorsWithSequence&gt;&amp;&amp;);
+
+    void finishCreation(JSC::VM&amp; vm)
+    {
+        Base::finishCreation(vm);
+        ASSERT(inherits(info()));
+    }
+
+};
+
+class JSTestOverloadedConstructorsWithSequenceOwner : public JSC::WeakHandleOwner {
+public:
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle&lt;JSC::Unknown&gt;, void* context, JSC::SlotVisitor&amp;);
+    virtual void finalize(JSC::Handle&lt;JSC::Unknown&gt;, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&amp;, TestOverloadedConstructorsWithSequence*)
+{
+    static NeverDestroyed&lt;JSTestOverloadedConstructorsWithSequenceOwner&gt; owner;
+    return &amp;owner.get();
+}
+
+inline void* wrapperKey(TestOverloadedConstructorsWithSequence* wrappableObject)
+{
+    return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestOverloadedConstructorsWithSequence&amp;);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestOverloadedConstructorsWithSequence* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestOverloadedConstructorsWithSequence&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestOverloadedConstructorsWithSequence&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (204499 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-08-16 06:48:34 UTC (rev 204499)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -453,7 +453,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestTypedefs&quot;, &quot;func&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestTypedefs::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto x = toNativeArray&lt;int32_t&gt;(*state, state-&gt;argument(0));
</del><ins>+    auto x = state-&gt;argument(0).isUndefined() ? Vector&lt;int32_t&gt;() : toNativeArray&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(0));
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.func(WTFMove(x));
</span><span class="lines">@@ -499,7 +499,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto sequenceArg = (toRefPtrNativeArray&lt;SerializedScriptValue, JSSerializedScriptValue&gt;(state, state-&gt;argument(0), &amp;JSSerializedScriptValue::toWrapped));
</del><ins>+    auto sequenceArg = toRefPtrNativeArray&lt;SerializedScriptValue, JSSerializedScriptValue&gt;(*state, state-&gt;argument(0));
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsNumber(impl.methodWithSequenceArg(WTFMove(sequenceArg)));
</span><span class="lines">@@ -605,7 +605,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto sequenceArg = (toRefPtrNativeArray&lt;TestEventTarget, JSTestEventTarget&gt;(state, state-&gt;argument(0), &amp;JSTestEventTarget::toWrapped));
</del><ins>+    auto sequenceArg = toRefPtrNativeArray&lt;TestEventTarget, JSTestEventTarget&gt;(*state, state-&gt;argument(0));
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsBoolean(impl.callWithSequenceThatRequiresInclude(WTFMove(sequenceArg)));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestOverloadedConstructorsWithSequenceidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl (0 => 204500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl                                (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl        2016-08-16 06:50:58 UTC (rev 204500)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+/*
+* Copyright (C) 2016 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+[
+    Constructor(optional sequence&lt;DOMString&gt; sequenceOfStrings = []),
+    Constructor(DOMString string),
+] interface TestOverloadedConstructorsWithSequence {
+};
</ins></span></pre>
</div>
</div>

</body>
</html>