<!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<T> 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<T> 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<unsigned>::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<Vector<T>>::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<T> 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<T> 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 <rniwa@webkit.org>
+
+ Conversion to sequence<T> 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<T> 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 <dabates@apple.com>
</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: ["id"]}) 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: "abc"}) threw exception TypeError: Value is not a sequence.
+PASS x = { [Symbol.iterator]: function* () { yield "foo"; } }; 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: "error", toString: () => "error"}; } }; 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"> <title></title>
</span><span class="cx"> </head>
</span><span class="cx"> <body>
</span><del>-<p id=description></p>
</del><ins>+<p id="description"></p>
</ins><span class="cx"> <div id="console"></div>
</span><span class="cx"> <script>
</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: ["id"]})');
</span><span class="cx">
</span><del>- shouldThrow('observer.observe(document.body, {attributes: false, attributeOldValue: true})');
- shouldThrow('observer.observe(document.body, {attributes: false, attributeFilter: ["id"]})');
- 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: ["id"]})', '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: "abc"})', 'TypeError');
+ shouldNotThrow('x = { [Symbol.iterator]: function* () { yield "foo"; } }; 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: "error", toString: () => "error"}; } }; '
+ + '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: () => 'Some error'}; } }; new FontFaceSet(x) threw exception Some error.
</ins><span class="cx"> PASS fontFaceSet.status is "loaded"
</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("new FontFaceSet()");
</span><span class="cx"> shouldBe("new FontFaceSet([]).size", "0");
</span><span class="cx"> shouldBe("new FontFaceSet([fontFace1]).size", "1");
</span><ins>+shouldThrowErrorName("new FontFaceSet(1)", "TypeError");
+shouldThrowErrorName("new FontFaceSet('hello')", "TypeError");
+shouldBe("new FontFaceSet(new Set([fontFace1])).size", "1");
+shouldBe("x = { [Symbol.iterator]: function*() { yield fontFace1; yield fontFace2; } }; new FontFaceSet(x).size", "2");
+shouldThrowErrorName("x = { [Symbol.iterator]: 1 }; new FontFaceSet(x)", "TypeError");
+shouldThrowErrorName("x = { [Symbol.iterator]: null }; new FontFaceSet(x)", "TypeError");
+shouldThrowErrorName("x = { [Symbol.iterator]: function*() { yield fontFace1; throw {name: 'SomeError', toString: () => 'Some error'}; } }; new FontFaceSet(x)", "SomeError");
</ins><span class="cx">
</span><span class="cx"> var fontFaceSet = new FontFaceSet([]);
</span><span class="cx"> shouldBeEqualToString("fontFaceSet.status", "loaded");
</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 "http://127.0.0.1:8000" from accessing a frame with origin "null". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "about". Protocols must match.
</span><span class="cx">
</span><del>-CONSOLE MESSAGE: line 347: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "null". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "about". Protocols must match.
</del><ins>+CONSOLE MESSAGE: line 526: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "null". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "about". 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 <https://bugs.webkit.org/show_bug.cgi?id=131074>.
+ if (document.createElementNS)
+ return document.createElementNS("http://www.w3.org/1999/xhtml", 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("span");
</del><ins>+ var span = createHTMLElement("span");
</ins><span class="cx"> if (quiet)
</span><span class="cx"> span.innerHTML = '<p>' + msg + '</p><p>On success, you will see no "<span class="fail">FAIL</span>" messages, followed by "<span class="pass">TEST COMPLETE</span>".</p>';
</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("span");
</del><ins>+ var span = createHTMLElement("span");
</ins><span class="cx"> getOrCreate("console", "div").appendChild(span); // insert it first so XHTML knows the namespace
</span><span class="cx"> span.innerHTML = msg + '<br />';
</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("style");
</del><ins>+ var styleElement = createHTMLElement("style");
</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('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>');
</del><ins>+ if (silentTestPass)
+ didPassSomeTestsSilently = true;
+ else
+ debug('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>');
</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('<span><span class="fail">FAIL</span> ' + escapeHTML(msg) + '</span>');
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function areNumbersEqual(_actual, _expected)
+{
+ if (_expected === 0)
+ return _actual === _expected && (1/_actual) === (1/_expected);
+ if (_actual === _expected)
+ return true;
+ if (typeof(_expected) == "number" && isNaN(_expected))
+ return typeof(_actual) == "number" && 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 < _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 && 1/n < 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 && (1/_actual) === (1/_expected);
- if (_actual === _expected)
</del><ins>+ if (areNumbersEqual(_actual, _expected))
</ins><span class="cx"> return true;
</span><del>- if (typeof(_expected) == "number" && isNaN(_expected))
- return typeof(_actual) == "number" && isNaN(_actual);
- if (_expected && (Object.prototype.toString.call(_expected) == Object.prototype.toString.call([])))
</del><ins>+ if (_expected
+ && (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 && 1/v < 0)
</span><span class="cx"> return "-0";
</span><del>- else return "" + v;
</del><ins>+ else if (isTypedArray(v))
+ return v.__proto__.constructor.name + ":[" + Array.prototype.join.call(v, ",") + "]";
+ else
+ return "" + 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 != "string")
</span><span class="cx"> debug("WARN: tryAndLog() expects a string argument");
</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 + " should be " + _bv + ". Threw exception " + exception);
</del><ins>+ testFailed(_a + " should be " + stringify(_bv) + ". Threw exception " + exception);
</ins><span class="cx"> else if (isResultCorrect(_av, _bv)) {
</span><span class="cx"> if (!quiet) {
</span><span class="cx"> testPassed(_a + " is " + _b);
</span><span class="cx"> }
</span><span class="cx"> } else if (typeof(_av) == typeof(_bv))
</span><del>- testFailed(_a + " should be " + _bv + ". Was " + stringify(_av) + ".");
</del><ins>+ testFailed(_a + " should be " + stringify(_bv) + ". Was " + stringify(_av) + ".");
</ins><span class="cx"> else
</span><del>- testFailed(_a + " should be " + _bv + " (of type " + typeof _bv + "). Was " + _av + " (of type " + typeof _av + ").");
</del><ins>+ testFailed(_a + " should be " + stringify(_bv) + " (of type " + typeof _bv + "). Was " + _av + " (of type " + typeof _av + ").");
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+function dfgShouldBe(theFunction, _a, _b)
+{
+ if (typeof theFunction != "function" || typeof _a != "string" || typeof _b != "string")
+ debug("WARN: dfgShouldBe() expects a function and two strings");
+ 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 + " should be " + stringify(_bv) + ". On iteration " + (values.length + 1) + ", threw exception " + exception);
+ else {
+ var allPassed = true;
+ for (var i = 0; i < values.length; ++i) {
+ var _av = values[i];
+ if (isResultCorrect(_av, _bv))
+ continue;
+ if (typeof(_av) == typeof(_bv))
+ testFailed(_a + " should be " + stringify(_bv) + ". On iteration " + (i + 1) + ", was " + stringify(_av) + ".");
+ else
+ testFailed(_a + " should be " + stringify(_bv) + " (of type " + typeof _bv + "). On iteration " + (i + 1) + ", was " + _av + " (of type " + typeof _av + ").");
+ allPassed = false;
+ }
+ if (allPassed)
+ testPassed(_a + " is " + _b + " on all iterations including after DFG tier-up.");
+ }
+
+ 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 != "string" || typeof _b != "string")
+ debug("WARN: shouldBecomeEqual() expects string arguments");
+
+ function condition() {
+ var exception;
+ var _av;
+ try {
+ _av = eval(_a);
+ } catch (e) {
+ exception = e;
+ }
+ var _bv = eval(_b);
+ if (exception)
+ testFailed(_a + " should become " + _bv + ". Threw exception " + exception);
+ if (isResultCorrect(_av, _bv)) {
+ testPassed(_a + " became " + _b);
+ return true;
+ }
+ return false;
+ }
+ setTimeout(_waitForCondition, 0, condition, completionHandler);
+}
+
+function shouldBecomeEqualToString(value, reference, completionHandler)
+{
+ if (typeof value !== "string" || typeof reference !== "string")
+ debug("WARN: shouldBecomeEqualToString() expects string arguments");
+ 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 + " is an instance of " + _type);
+ } else {
+ testFailed(_a + " is not an instance of " + _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 + " should not be " + _bv + ".");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function shouldBecomeDifferent(_a, _b, completionHandler)
+{
+ if (typeof _a != "string" || typeof _b != "string")
+ debug("WARN: shouldBecomeDifferent() expects string arguments");
+
+ function condition() {
+ var exception;
+ var _av;
+ try {
+ _av = eval(_a);
+ } catch (e) {
+ exception = e;
+ }
+ var _bv = eval(_b);
+ if (exception)
+ testFailed(_a + " should became not equal to " + _bv + ". Threw exception " + exception);
+ if (!isResultCorrect(_av, _bv)) {
+ testPassed(_a + " became different from " + _b);
+ return true;
+ }
+ return false;
+ }
+ setTimeout(_waitForCondition, 0, condition, completionHandler);
+}
+
</ins><span class="cx"> function shouldBeTrue(_a) { shouldBe(_a, "true"); }
</span><span class="cx"> function shouldBeTrueQuiet(_a) { shouldBe(_a, "true", true); }
</span><span class="cx"> function shouldBeFalse(_a) { shouldBe(_a, "false"); }
</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 !== "string" || typeof b !== "string")
+ debug("WARN: shouldBeEqualToString() expects string arguments");
+ var unevaledString = JSON.stringify(b);
+ shouldNotBe(a, unevaledString);
+}
</ins><span class="cx"> function shouldBeEmptyString(_a) { shouldBeEqualToString(_a, ""); }
</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 + " is >= " + _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 + " did not throw exception.");
</del><ins>+ typeof _a == "function" ? _a() : eval(_a);
+ testPassed((_message ? _message : _a) + " did not throw exception.");
</ins><span class="cx"> } catch (e) {
</span><del>- testFailed(_a + " should not throw exception. Threw exception " + e + ".");
</del><ins>+ testFailed((_message ? _message : _a) + " should not throw exception. Threw exception " + e + ".");
</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 == "function" ? _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 == "undefined" || exception == _ev)
- testPassed(_a + " threw exception " + exception + ".");
</del><ins>+ if (_exception) {
+ if (typeof _e == "undefined" || _exception == _ev)
+ testPassed((_message ? _message : _a) + " threw exception " + _exception + ".");
+ else
+ testFailed((_message ? _message : _a) + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Threw exception " + _exception + ".");
+ } else if (typeof _av == "undefined")
+ testFailed((_message ? _message : _a) + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Was undefined.");
</ins><span class="cx"> else
</span><del>- testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Threw exception " + exception + ".");
- } else if (typeof _av == "undefined")
- testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Was undefined.");
- else
- testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Was " + _av + ".");
</del><ins>+ testFailed((_message ? _message : _a) + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Was " + _av + ".");
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+function shouldThrowErrorName(_a, _name)
+{
+ var _exception;
+ try {
+ typeof _a == "function" ? _a() : eval(_a);
+ } catch (e) {
+ _exception = e;
+ }
+
+ if (_exception) {
+ if (_exception.name == _name)
+ testPassed(_a + " threw exception " + _exception + ".");
+ else
+ testFailed(_a + " should throw a " + _name + ". Threw a " + _exception.name + ".");
+ } else
+ testFailed(_a + " should throw a " + _name + ". Did not throw.");
+}
+
</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 = "compiles" in argument ? argument.compiles : 1;
+
+ if (!("f" in argument))
+ throw new Error("dfgCompiled called with invalid argument.");
+
+ if (argument.f instanceof Array) {
+ for (var i = 0; i < argument.f.length; ++i) {
+ if (testRunner.numberOfDFGCompiles(argument.f[i]) < numberOfCompiles)
+ return false;
+ }
+ } else {
+ if (testRunner.numberOfDFGCompiles(argument.f) < numberOfCompiles)
+ return false;
+ }
+
+ return true;
+}
+
+function dfgIncrement(argument)
+{
+ if (!self.testRunner)
+ return argument.i;
+
+ if (argument.i < argument.n)
+ return argument.i;
+
+ if (didFailSomeTests)
+ return argument.i;
+
+ if (!dfgCompiled(argument))
+ return "start" 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("successfullyParsed");
</span><ins>+ if (silentTestPass && didPassSomeTestsSilently)
+ debug("Passed some tests silently.");
+ if (silentTestPass && didFailSomeTests)
+ debug("Some tests failed.");
</ins><span class="cx"> debug('<br /><span class="pass">TEST COMPLETE</span>');
</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&enable-full-block=1&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 "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 172: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 176: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 347: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 172: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 176: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
</del><ins>+CONSOLE MESSAGE: line 218: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 218: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 222: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 526: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 218: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 222: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". 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&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 "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
</del><ins>+CONSOLE MESSAGE: line 218: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". 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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS new WebSocket(url, ["a@"]) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS new WebSocket(url, new Set(["b@"])) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS x = { toString: () => "a", [Symbol.iterator]: function* () { yield "c@"; } }; new WebSocket(url, x) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS x = { toString: () => "d@", [Symbol.iterator]: null }; new WebSocket(url, x) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS x = { toString: () => "a", [Symbol.iterator]: 1 }; new WebSocket(url, x) threw exception TypeError: Symbol.iterator property should be callable.
+PASS x = { [Symbol.iterator]: function* () { yield "e@"; } }; 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: "SomeError", toString: () => "Some error" }; } }; 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>+<!DOCTYPE html>
+<body>
+<script src="/resources/js-test-pre.js"></script>
+<script>
+description('Construct a WebSocket with multiple protocols. It should throw an appropriate exception.');
+
+var url = "ws://127.0.0.1:8880/websocket/tests/simple";
+shouldThrowErrorName('new WebSocket(url, ["a@"])', 'SyntaxError');
+shouldThrowErrorName('new WebSocket(url, new Set(["b@"]))', 'SyntaxError');
+shouldThrowErrorName('x = { toString: () => "a", [Symbol.iterator]: function* () { yield "c@"; } }; new WebSocket(url, x)', 'SyntaxError');
+shouldThrowErrorName('x = { toString: () => "d@", [Symbol.iterator]: null }; new WebSocket(url, x)', 'SyntaxError');
+shouldThrowErrorName('x = { toString: () => "a", [Symbol.iterator]: 1 }; new WebSocket(url, x)', 'TypeError');
+shouldThrowErrorName('x = { [Symbol.iterator]: function* () { yield "e@"; } }; new WebSocket(url, x)', 'SyntaxError');
+shouldThrowErrorName('x = { [Symbol.iterator]: function* () { throw {name: "SomeError", toString: () => "Some error" }; } }; new WebSocket(url, x)', 'SomeError');
+
+</script>
+<script src="/resources/js-test-post.js"></script>
+</body>
</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 <rniwa@webkit.org>
+
+ Conversion to sequence<T> 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 <bpoulain@apple.com>
</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&, JSGlobalObject&);
</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 <typename CallBackType>
</span><span class="cx"> void forEachInIterable(ExecState* state, JSValue iterable, const CallBackType& 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 &m_butterfly;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- JSValue getMethod(ExecState* exec, CallData& callData, CallType& callType, const Identifier& ident, const String& errorMessage);
</del><ins>+ JS_EXPORT_PRIVATE JSValue getMethod(ExecState*, CallData&, CallType&, const Identifier&, const String& 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 <rniwa@webkit.org>
+
+ Conversion to sequence<T> 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<T> 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<unsigned>::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<Vector<T>>::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<T> 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 <cdumez@apple.com>
</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& state, JSC::JSValue value)
+{
+ if (!value.isObject())
+ return false;
+
+ auto& vm = state.vm();
+ JSObject* object = JSC::asObject(value);
+ CallData callData;
+ CallType callType;
+ JSValue applyMethod = object->getMethod(&state, callData, callType, vm.propertyNames->iteratorSymbol, ASCIILiteral("Symbol.iterator property should be callable"));
+ 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<JSC::Float32Array> toFloat32Array(JSC::JSValue);
</span><span class="cx"> RefPtr<JSC::Float64Array> toFloat64Array(JSC::JSValue);
</span><span class="cx">
</span><del>-template<typename T, typename JSType> Vector<RefPtr<T>> toRefPtrNativeArray(JSC::ExecState*, JSC::JSValue, T* (*)(JSC::JSValue));
</del><ins>+template<typename T, typename JSType> Vector<RefPtr<T>> toRefPtrNativeArray(JSC::ExecState*, JSC::JSValue);
</ins><span class="cx"> template<typename T> Vector<T> toNativeArray(JSC::ExecState&, JSC::JSValue);
</span><span class="cx"> template<typename T> Vector<T> toNativeArguments(JSC::ExecState&, size_t startIndex = 0);
</span><ins>+bool hasIteratorMethod(JSC::ExecState&, 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<> struct NativeValueTraits<unsigned> {
</span><span class="cx"> static inline bool nativeValue(JSC::ExecState& exec, JSC::JSValue jsValue, unsigned& indexedValue)
</span><span class="cx"> {
</span><del>- if (!jsValue.isNumber())
- return false;
-
</del><span class="cx"> indexedValue = jsValue.toUInt32(&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<typename T, typename JST> Vector<RefPtr<T>> toRefPtrNativeArray(JSC::ExecState* exec, JSC::JSValue value, T* (*toT)(JSC::JSValue value))
</del><ins>+template<typename T, typename JST> Vector<RefPtr<T>> toRefPtrNativeArray(JSC::ExecState& 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<RefPtr<T>>();
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> Vector<RefPtr<T>> result;
</span><del>- JSC::JSArray* array = asArray(value);
- size_t size = array->length();
- result.reserveInitialCapacity(size);
- for (size_t i = 0; i < size; ++i) {
- JSC::JSValue element = array->getIndex(exec, i);
- if (element.inherits(JST::info()))
- result.uncheckedAppend((*toT)(element));
- else {
- throwArrayElementTypeError(*exec);
- return Vector<RefPtr<T>>();
- }
- }
</del><ins>+ forEachInIterable(&exec, value, [&result](JSC::VM&, 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<typename T> Vector<T> toNativeArray(JSC::ExecState& 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<T>();
</span><ins>+ }
</ins><span class="cx">
</span><del>- unsigned length = 0;
- if (isJSArray(value)) {
- JSC::JSArray* array = asArray(value);
- length = array->length();
- } else
- toJSSequence(exec, value, length);
-
</del><span class="cx"> Vector<T> result;
</span><del>- result.reserveInitialCapacity(length);
- typedef NativeValueTraits<T> TraitsType;
-
- for (unsigned i = 0; i < length; ++i) {
- T indexValue;
- if (!TraitsType::nativeValue(exec, object->get(&exec, i), indexValue))
- return Vector<T>();
- result.uncheckedAppend(indexValue);
- }
</del><ins>+ forEachInIterable(&exec, value, [&result](JSC::VM&, JSC::ExecState* state, JSC::JSValue jsValue) {
+ T convertedValue;
+ if (!NativeValueTraits<T>::nativeValue(*state, jsValue, convertedValue))
+ return;
+ ASSERT(!state->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<typename T> struct Converter<Vector<T>> : DefaultConverter<Vector<T>> {
</span><span class="cx"> static Vector<T> convert(JSC::ExecState& 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<T>(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, \&$isObjectOrCallbackFunctionParameter);
</span><span class="cx"> &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isFunction()");
</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, \&$isSequenceParameter);
</span><del>- &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && isJSArray(distinguishingArg)");
</del><ins>+ &$generateOverloadCallIfNecessary($overload, "hasIteratorMethod(*state, distinguishingArg)");
</ins><span class="cx">
</span><span class="cx"> $overload = GetOverloadThatMatches($S, $d, \&$isDictionaryOrObjectOrCallbackInterfaceParameter);
</span><span class="cx"> &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && asObject(distinguishingArg)->type() != RegExpObjectType");
</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 && $automaticallyGeneratedDefaultValue eq $defaultValue;
</span><span class="cx">
</span><del>- # toRefPtrNativeArray() will convert undefined to an empty Vector.
- return 1 if $defaultValue eq "[]" && $codeGenerator->GetSequenceType($parameterType);
-
</del><span class="cx"> return 1 if $defaultValue eq "null" && $codeGenerator->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->IsRefPtrType($sequenceType)) {
</span><span class="cx"> AddToImplIncludes("JS${sequenceType}.h");
</span><del>- return ("(toRefPtrNativeArray<${sequenceType}, JS${sequenceType}>(state, $value, &JS${sequenceType}::toWrapped))", 1);
</del><ins>+ return ("toRefPtrNativeArray<${sequenceType}, JS${sequenceType}>(*state, $value)", 1);
</ins><span class="cx"> }
</span><span class="cx"> return ("toNativeArray<" . GetNativeVectorInnerType($sequenceType) . ">(*state, $value)", 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 "config.h"
+#include "WebKitDOMTestOverloadedConstructorsWithSequence.h"
+
+#include "CSSImportRule.h"
+#include "DOMObjectCache.h"
+#include "Document.h"
+#include "ExceptionCode.h"
+#include "ExceptionCodeDescription.h"
+#include "JSMainThreadExecState.h"
+#include "WebKitDOMPrivate.h"
+#include "WebKitDOMTestOverloadedConstructorsWithSequencePrivate.h"
+#include "gobject/ConvertToUTF8String.h"
+#include <wtf/GetPtr.h>
+#include <wtf/RefPtr.h>
+
+#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<WebCore::TestOverloadedConstructorsWithSequence> 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<WebCore::TestOverloadedConstructorsWithSequence*>(WEBKIT_DOM_OBJECT(request)->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, "core-object", 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->coreObject.get());
+
+ priv->~WebKitDOMTestOverloadedConstructorsWithSequencePrivate();
+ G_OBJECT_CLASS(webkit_dom_test_overloaded_constructors_with_sequence_parent_class)->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)->constructor(type, constructPropertiesCount, constructProperties);
+
+ WebKitDOMTestOverloadedConstructorsWithSequencePrivate* priv = WEBKIT_DOM_TEST_OVERLOADED_CONSTRUCTORS_WITH_SEQUENCE_GET_PRIVATE(object);
+ priv->coreObject = static_cast<WebCore::TestOverloadedConstructorsWithSequence*>(WEBKIT_DOM_OBJECT(object)->coreObject);
+ WebKit::DOMObjectCache::put(priv->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->constructor = webkit_dom_test_overloaded_constructors_with_sequence_constructor;
+ gobjectClass->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 <glib-object.h>
+#include <webkitdom/WebKitDOMObject.h>
+#include <webkitdom/webkitdomdefines-unstable.h>
+
+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 "TestOverloadedConstructorsWithSequence.h"
+#include <webkitdom/WebKitDOMTestOverloadedConstructorsWithSequence.h>
+
+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, "TestObject", "methodWithOptionalSequenceIsEmpty");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto array = toNativeArray<String>(*state, state->argument(0));
</del><ins>+ auto array = state->argument(0).isUndefined() ? Vector<String>() : toNativeArray<String>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> if (UNLIKELY(state->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() && asObject(distinguishingArg)->inherits(JSBlob::info()))
</span><span class="cx"> return jsTestObjPrototypeFunctionOverloadedMethod12(state);
</span><del>- if (distinguishingArg.isObject() && isJSArray(distinguishingArg))
</del><ins>+ if (hasIteratorMethod(*state, distinguishingArg))
</ins><span class="cx"> return jsTestObjPrototypeFunctionOverloadedMethod7(state);
</span><span class="cx"> if (distinguishingArg.isObject() && asObject(distinguishingArg)->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 "config.h"
+#include "JSTestOverloadedConstructorsWithSequence.h"
+
+#include "ExceptionCode.h"
+#include "JSDOMBinding.h"
+#include "JSDOMConstructor.h"
+#include <runtime/Error.h>
+#include <runtime/FunctionPrototype.h>
+#include <wtf/GetPtr.h>
+
+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& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+ {
+ JSTestOverloadedConstructorsWithSequencePrototype* ptr = new (NotNull, JSC::allocateCell<JSTestOverloadedConstructorsWithSequencePrototype>(vm.heap)) JSTestOverloadedConstructorsWithSequencePrototype(vm, globalObject, structure);
+ ptr->finishCreation(vm);
+ return ptr;
+ }
+
+ DECLARE_INFO;
+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+ }
+
+private:
+ JSTestOverloadedConstructorsWithSequencePrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+ : JSC::JSNonFinalObject(vm, structure)
+ {
+ }
+
+ void finishCreation(JSC::VM&);
+};
+
+typedef JSDOMConstructor<JSTestOverloadedConstructorsWithSequence> JSTestOverloadedConstructorsWithSequenceConstructor;
+
+static inline EncodedJSValue constructJSTestOverloadedConstructorsWithSequence1(ExecState* state)
+{
+ auto* castedThis = jsCast<JSTestOverloadedConstructorsWithSequenceConstructor*>(state->callee());
+ auto sequenceOfStrings = state->argument(0).isUndefined() ? Vector<String>() : toNativeArray<String>(*state, state->uncheckedArgument(0));
+ if (UNLIKELY(state->hadException()))
+ return JSValue::encode(jsUndefined());
+ auto object = TestOverloadedConstructorsWithSequence::create(sequenceOfStrings);
+ return JSValue::encode(asObject(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object))));
+}
+
+static inline EncodedJSValue constructJSTestOverloadedConstructorsWithSequence2(ExecState* state)
+{
+ auto* castedThis = jsCast<JSTestOverloadedConstructorsWithSequenceConstructor*>(state->callee());
+ if (UNLIKELY(state->argumentCount() < 1))
+ return throwVMError(state, createNotEnoughArgumentsError(state));
+ auto string = state->argument(0).toWTFString(state);
+ if (UNLIKELY(state->hadException()))
+ return JSValue::encode(jsUndefined());
+ auto object = TestOverloadedConstructorsWithSequence::create(string);
+ return JSValue::encode(asObject(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object))));
+}
+
+template<> EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsWithSequenceConstructor::construct(ExecState* state)
+{
+ size_t argsCount = std::min<size_t>(1, state->argumentCount());
+ if (argsCount == 0) {
+ return constructJSTestOverloadedConstructorsWithSequence1(state);
+ }
+ if (argsCount == 1) {
+ JSValue distinguishingArg = state->uncheckedArgument(0);
+ if (distinguishingArg.isUndefined())
+ return constructJSTestOverloadedConstructorsWithSequence1(state);
+ if (hasIteratorMethod(*state, distinguishingArg))
+ return constructJSTestOverloadedConstructorsWithSequence1(state);
+ return constructJSTestOverloadedConstructorsWithSequence2(state);
+ }
+ return throwVMTypeError(state);
+}
+
+template<> JSValue JSTestOverloadedConstructorsWithSequenceConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+ UNUSED_PARAM(vm);
+ return globalObject.functionPrototype();
+}
+
+template<> void JSTestOverloadedConstructorsWithSequenceConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+ putDirect(vm, vm.propertyNames->prototype, JSTestOverloadedConstructorsWithSequence::prototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum);
+ putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestOverloadedConstructorsWithSequence"))), ReadOnly | DontEnum);
+ putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestOverloadedConstructorsWithSequenceConstructor::s_info = { "TestOverloadedConstructorsWithSequence", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestOverloadedConstructorsWithSequenceConstructor) };
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestOverloadedConstructorsWithSequencePrototypeTableValues[] =
+{
+ { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestOverloadedConstructorsWithSequenceConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestOverloadedConstructorsWithSequenceConstructor) } },
+};
+
+const ClassInfo JSTestOverloadedConstructorsWithSequencePrototype::s_info = { "TestOverloadedConstructorsWithSequencePrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestOverloadedConstructorsWithSequencePrototype) };
+
+void JSTestOverloadedConstructorsWithSequencePrototype::finishCreation(VM& vm)
+{
+ Base::finishCreation(vm);
+ reifyStaticProperties(vm, JSTestOverloadedConstructorsWithSequencePrototypeTableValues, *this);
+}
+
+const ClassInfo JSTestOverloadedConstructorsWithSequence::s_info = { "TestOverloadedConstructorsWithSequence", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestOverloadedConstructorsWithSequence) };
+
+JSTestOverloadedConstructorsWithSequence::JSTestOverloadedConstructorsWithSequence(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestOverloadedConstructorsWithSequence>&& impl)
+ : JSDOMWrapper<TestOverloadedConstructorsWithSequence>(structure, globalObject, WTFMove(impl))
+{
+}
+
+JSObject* JSTestOverloadedConstructorsWithSequence::createPrototype(VM& vm, JSGlobalObject* globalObject)
+{
+ return JSTestOverloadedConstructorsWithSequencePrototype::create(vm, globalObject, JSTestOverloadedConstructorsWithSequencePrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
+}
+
+JSObject* JSTestOverloadedConstructorsWithSequence::prototype(VM& vm, JSGlobalObject* globalObject)
+{
+ return getDOMPrototype<JSTestOverloadedConstructorsWithSequence>(vm, globalObject);
+}
+
+void JSTestOverloadedConstructorsWithSequence::destroy(JSC::JSCell* cell)
+{
+ JSTestOverloadedConstructorsWithSequence* thisObject = static_cast<JSTestOverloadedConstructorsWithSequence*>(cell);
+ thisObject->JSTestOverloadedConstructorsWithSequence::~JSTestOverloadedConstructorsWithSequence();
+}
+
+EncodedJSValue jsTestOverloadedConstructorsWithSequenceConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+ JSTestOverloadedConstructorsWithSequencePrototype* domObject = jsDynamicCast<JSTestOverloadedConstructorsWithSequencePrototype*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!domObject))
+ return throwVMTypeError(state);
+ return JSValue::encode(JSTestOverloadedConstructorsWithSequence::getConstructor(state->vm(), domObject->globalObject()));
+}
+
+bool setJSTestOverloadedConstructorsWithSequenceConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ JSValue value = JSValue::decode(encodedValue);
+ JSTestOverloadedConstructorsWithSequencePrototype* domObject = jsDynamicCast<JSTestOverloadedConstructorsWithSequencePrototype*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!domObject)) {
+ throwVMTypeError(state);
+ return false;
+ }
+ // Shadowing a built-in constructor
+ return domObject->putDirect(state->vm(), state->propertyNames().constructor, value);
+}
+
+JSValue JSTestOverloadedConstructorsWithSequence::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+ return getDOMConstructor<JSTestOverloadedConstructorsWithSequenceConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+bool JSTestOverloadedConstructorsWithSequenceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+ UNUSED_PARAM(handle);
+ UNUSED_PARAM(visitor);
+ return false;
+}
+
+void JSTestOverloadedConstructorsWithSequenceOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+ auto* jsTestOverloadedConstructorsWithSequence = jsCast<JSTestOverloadedConstructorsWithSequence*>(handle.slot()->asCell());
+ auto& world = *static_cast<DOMWrapperWorld*>(context);
+ uncacheWrapper(world, &jsTestOverloadedConstructorsWithSequence->wrapped(), jsTestOverloadedConstructorsWithSequence);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestOverloadedConstructorsWithSequence@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore38TestOverloadedConstructorsWithSequenceE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestOverloadedConstructorsWithSequence>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+ void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
+#if PLATFORM(WIN)
+ void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestOverloadedConstructorsWithSequence@WebCore@@6B@"));
+#else
+ void* expectedVTablePointer = &_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), "TestOverloadedConstructorsWithSequence is not polymorphic");
+#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<JSTestOverloadedConstructorsWithSequence, TestOverloadedConstructorsWithSequence>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestOverloadedConstructorsWithSequence& impl)
+{
+ return wrap(state, globalObject, impl);
+}
+
+TestOverloadedConstructorsWithSequence* JSTestOverloadedConstructorsWithSequence::toWrapped(JSC::JSValue value)
+{
+ if (auto* wrapper = jsDynamicCast<JSTestOverloadedConstructorsWithSequence*>(value))
+ return &wrapper->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 "JSDOMWrapper.h"
+#include "TestOverloadedConstructorsWithSequence.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestOverloadedConstructorsWithSequence : public JSDOMWrapper<TestOverloadedConstructorsWithSequence> {
+public:
+ typedef JSDOMWrapper<TestOverloadedConstructorsWithSequence> Base;
+ static JSTestOverloadedConstructorsWithSequence* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestOverloadedConstructorsWithSequence>&& impl)
+ {
+ JSTestOverloadedConstructorsWithSequence* ptr = new (NotNull, JSC::allocateCell<JSTestOverloadedConstructorsWithSequence>(globalObject->vm().heap)) JSTestOverloadedConstructorsWithSequence(structure, *globalObject, WTFMove(impl));
+ ptr->finishCreation(globalObject->vm());
+ return ptr;
+ }
+
+ static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
+ static JSC::JSObject* prototype(JSC::VM&, JSC::JSGlobalObject*);
+ static TestOverloadedConstructorsWithSequence* toWrapped(JSC::JSValue);
+ static void destroy(JSC::JSCell*);
+
+ DECLARE_INFO;
+
+ static JSC::Structure* createStructure(JSC::VM& 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&, const JSC::JSGlobalObject*);
+protected:
+ JSTestOverloadedConstructorsWithSequence(JSC::Structure*, JSDOMGlobalObject&, Ref<TestOverloadedConstructorsWithSequence>&&);
+
+ void finishCreation(JSC::VM& vm)
+ {
+ Base::finishCreation(vm);
+ ASSERT(inherits(info()));
+ }
+
+};
+
+class JSTestOverloadedConstructorsWithSequenceOwner : public JSC::WeakHandleOwner {
+public:
+ virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+ virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestOverloadedConstructorsWithSequence*)
+{
+ static NeverDestroyed<JSTestOverloadedConstructorsWithSequenceOwner> owner;
+ return &owner.get();
+}
+
+inline void* wrapperKey(TestOverloadedConstructorsWithSequence* wrappableObject)
+{
+ return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestOverloadedConstructorsWithSequence&);
+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<TestOverloadedConstructorsWithSequence>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestOverloadedConstructorsWithSequence>&& 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, "TestTypedefs", "func");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestTypedefs::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto x = toNativeArray<int32_t>(*state, state->argument(0));
</del><ins>+ auto x = state->argument(0).isUndefined() ? Vector<int32_t>() : toNativeArray<int32_t>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> if (UNLIKELY(state->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& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>- auto sequenceArg = (toRefPtrNativeArray<SerializedScriptValue, JSSerializedScriptValue>(state, state->argument(0), &JSSerializedScriptValue::toWrapped));
</del><ins>+ auto sequenceArg = toRefPtrNativeArray<SerializedScriptValue, JSSerializedScriptValue>(*state, state->argument(0));
</ins><span class="cx"> if (UNLIKELY(state->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& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>- auto sequenceArg = (toRefPtrNativeArray<TestEventTarget, JSTestEventTarget>(state, state->argument(0), &JSTestEventTarget::toWrapped));
</del><ins>+ auto sequenceArg = toRefPtrNativeArray<TestEventTarget, JSTestEventTarget>(*state, state->argument(0));
</ins><span class="cx"> if (UNLIKELY(state->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<DOMString> sequenceOfStrings = []),
+ Constructor(DOMString string),
+] interface TestOverloadedConstructorsWithSequence {
+};
</ins></span></pre>
</div>
</div>
</body>
</html>