<!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>[170517] 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/170517">170517</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-06-26 20:20:34 -0700 (Thu, 26 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>iOS 8 beta 2 ES6 'Set' clear() broken
https://bugs.webkit.org/show_bug.cgi?id=134346

Reviewed by Oliver Hunt.


Source/JavaScriptCore: 
The object map was not cleared :(.

Kudos to Ashley Gullen for tracking this and making a regression test.
Credit to Oliver for finding the missing code.

* runtime/MapData.h:
(JSC::MapData::clear):

LayoutTests: 
* js/script-tests/set-clear.js: Added.
* js/set-clear-expected.txt: Added.
* js/set-clear.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeMapDatah">trunk/Source/JavaScriptCore/runtime/MapData.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsmapclearexpectedtxt">trunk/LayoutTests/js/map-clear-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsmapclearhtml">trunk/LayoutTests/js/map-clear.html</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsmapclearjs">trunk/LayoutTests/js/script-tests/map-clear.js</a></li>
<li><a href="#trunkLayoutTestsjsscripttestssetclearjs">trunk/LayoutTests/js/script-tests/set-clear.js</a></li>
<li><a href="#trunkLayoutTestsjssetclearexpectedtxt">trunk/LayoutTests/js/set-clear-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjssetclearhtml">trunk/LayoutTests/js/set-clear.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (170516 => 170517)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-06-27 02:43:21 UTC (rev 170516)
+++ trunk/LayoutTests/ChangeLog        2014-06-27 03:20:34 UTC (rev 170517)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-06-26  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        iOS 8 beta 2 ES6 'Set' clear() broken
+        https://bugs.webkit.org/show_bug.cgi?id=134346
+
+        Reviewed by Oliver Hunt.
+
+        * js/script-tests/set-clear.js: Added.
+        * js/set-clear-expected.txt: Added.
+        * js/set-clear.html: Added.
+
</ins><span class="cx"> 2014-06-26  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Grid Layout] Properly support for z-index on grid items
</span></span></pre></div>
<a id="trunkLayoutTestsjsmapclearexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/map-clear-expected.txt (0 => 170517)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/map-clear-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/map-clear-expected.txt        2014-06-27 03:20:34 UTC (rev 170517)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+Tests basic correctness of ES Map's clear() API
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS stringMap.size is 0
+PASS stringMap.values.length is 0
+PASS stringMap.has('Oliver') is false
+PASS stringMap.has('Benjamin') is false
+PASS valueMap.size is 0
+PASS valueMap.values.length is 0
+PASS valueMap.has(0) is false
+PASS valueMap.has(1) is false
+PASS objectMap.size is 0
+PASS objectMap.values.length is 0
+PASS objectMap.has(anArray) is false
+PASS objectMap.has(anObject) is false
+PASS objectMap.has(otherObject) is false
+PASS mixedTypeMap.size is 0
+PASS mixedTypeMap.values.length is 0
+PASS mixedTypeMap.has(0) is false
+PASS mixedTypeMap.has('Oliver') is false
+PASS mixedTypeMap.has(stringMap) is false
+PASS mixedTypeMap.has(valueMap) is false
+PASS mixedTypeMap.has(objectMap) is false
+PASS mixedTypeMap.has(anObject) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsmapclearhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/map-clear.html (0 => 170517)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/map-clear.html                                (rev 0)
+++ trunk/LayoutTests/js/map-clear.html        2014-06-27 03:20:34 UTC (rev 170517)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/map-clear.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsmapclearjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/map-clear.js (0 => 170517)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/map-clear.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/map-clear.js        2014-06-27 03:20:34 UTC (rev 170517)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+description(&quot;Tests basic correctness of ES Map's clear() API&quot;);
+
+// Map containing only String types.
+var stringMap = new Map;
+stringMap.set('Oliver', 'Hunt');
+stringMap.set('Benjamin', 'Poulain');
+
+stringMap.clear();
+shouldBe(&quot;stringMap.size&quot;, &quot;0&quot;);
+shouldBe(&quot;stringMap.values.length&quot;, &quot;0&quot;);
+shouldBeFalse(&quot;stringMap.has('Oliver')&quot;);
+shouldBeFalse(&quot;stringMap.has('Benjamin')&quot;);
+
+// Map containing only primitive values.
+var valueMap = new Map;
+valueMap.set(0, 1);
+valueMap.set(1, 2);
+
+valueMap.clear();
+shouldBe(&quot;valueMap.size&quot;, &quot;0&quot;);
+shouldBe(&quot;valueMap.values.length&quot;, &quot;0&quot;);
+shouldBeFalse(&quot;valueMap.has(0)&quot;);
+shouldBeFalse(&quot;valueMap.has(1)&quot;);
+
+// Map containing objects;
+var objectMap = new Map;
+var anArray = new Array;
+objectMap.set(anArray, 0);
+var anObject = new Object;
+objectMap.set(anObject, 1);
+var otherObject = {&quot;a&quot;:1, &quot;b&quot;:2};
+objectMap.set(otherObject, 2);
+
+objectMap.clear();
+shouldBe(&quot;objectMap.size&quot;, &quot;0&quot;);
+shouldBe(&quot;objectMap.values.length&quot;, &quot;0&quot;);
+shouldBeFalse(&quot;objectMap.has(anArray)&quot;);
+shouldBeFalse(&quot;objectMap.has(anObject)&quot;);
+shouldBeFalse(&quot;objectMap.has(otherObject)&quot;);
+
+// Mixed types.
+var mixedTypeMap = new Map;
+mixedTypeMap.set(0, objectMap);
+mixedTypeMap.set('Oliver', stringMap);
+mixedTypeMap.set(stringMap, valueMap);
+mixedTypeMap.set(valueMap, anObject);
+mixedTypeMap.set(objectMap, objectMap);
+mixedTypeMap.set(anObject, stringMap);
+
+mixedTypeMap.clear();
+shouldBe(&quot;mixedTypeMap.size&quot;, &quot;0&quot;);
+shouldBe(&quot;mixedTypeMap.values.length&quot;, &quot;0&quot;);
+shouldBeFalse(&quot;mixedTypeMap.has(0)&quot;);
+shouldBeFalse(&quot;mixedTypeMap.has('Oliver')&quot;);
+shouldBeFalse(&quot;mixedTypeMap.has(stringMap)&quot;);
+shouldBeFalse(&quot;mixedTypeMap.has(valueMap)&quot;);
+shouldBeFalse(&quot;mixedTypeMap.has(objectMap)&quot;);
+shouldBeFalse(&quot;mixedTypeMap.has(anObject)&quot;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscripttestssetclearjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/set-clear.js (0 => 170517)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/set-clear.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/set-clear.js        2014-06-27 03:20:34 UTC (rev 170517)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+description(&quot;Tests basic correctness of ES Set's clear() API&quot;);
+
+// Set containing only String types.
+var stringSet = new Set;
+stringSet.add('Oliver');
+stringSet.add('Benjamin');
+
+stringSet.clear();
+shouldBe(&quot;stringSet.size&quot;, &quot;0&quot;);
+shouldBe(&quot;stringSet.values.length&quot;, &quot;0&quot;);
+shouldBeFalse(&quot;stringSet.has('Oliver')&quot;);
+shouldBeFalse(&quot;stringSet.has('Benjamin')&quot;);
+
+// Set containing only primitive values.
+var valueSet = new Set;
+valueSet.add(0);
+valueSet.add(1);
+
+valueSet.clear();
+shouldBe(&quot;valueSet.size&quot;, &quot;0&quot;);
+shouldBe(&quot;valueSet.values.length&quot;, &quot;0&quot;);
+shouldBeFalse(&quot;valueSet.has(0)&quot;);
+shouldBeFalse(&quot;valueSet.has(1)&quot;);
+
+// Set containing objects;
+var objectSet = new Set;
+var anArray = new Array;
+objectSet.add(anArray);
+var anObject = new Object;
+objectSet.add(anObject);
+var otherObject = {&quot;a&quot;:1, &quot;b&quot;:2};
+objectSet.add(otherObject);
+
+objectSet.clear();
+shouldBe(&quot;objectSet.size&quot;, &quot;0&quot;);
+shouldBe(&quot;objectSet.values.length&quot;, &quot;0&quot;);
+shouldBeFalse(&quot;objectSet.has(anArray)&quot;);
+shouldBeFalse(&quot;objectSet.has(anObject)&quot;);
+shouldBeFalse(&quot;objectSet.has(otherObject)&quot;);
+
+// Mixed types.
+var mixedTypeSet = new Set;
+mixedTypeSet.add(0);
+mixedTypeSet.add('Oliver');
+mixedTypeSet.add(stringSet);
+mixedTypeSet.add(valueSet);
+mixedTypeSet.add(objectSet);
+mixedTypeSet.add(anObject);
+
+mixedTypeSet.clear();
+shouldBe(&quot;mixedTypeSet.size&quot;, &quot;0&quot;);
+shouldBe(&quot;mixedTypeSet.values.length&quot;, &quot;0&quot;);
+shouldBeFalse(&quot;mixedTypeSet.has(0)&quot;);
+shouldBeFalse(&quot;mixedTypeSet.has('Oliver')&quot;);
+shouldBeFalse(&quot;mixedTypeSet.has(stringSet)&quot;);
+shouldBeFalse(&quot;mixedTypeSet.has(valueSet)&quot;);
+shouldBeFalse(&quot;mixedTypeSet.has(objectSet)&quot;);
+shouldBeFalse(&quot;mixedTypeSet.has(anObject)&quot;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjssetclearexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/set-clear-expected.txt (0 => 170517)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/set-clear-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/set-clear-expected.txt        2014-06-27 03:20:34 UTC (rev 170517)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+Tests basic correctness of ES Set's clear() API
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS stringSet.size is 0
+PASS stringSet.values.length is 0
+PASS stringSet.has('Oliver') is false
+PASS stringSet.has('Benjamin') is false
+PASS valueSet.size is 0
+PASS valueSet.values.length is 0
+PASS valueSet.has(0) is false
+PASS valueSet.has(1) is false
+PASS objectSet.size is 0
+PASS objectSet.values.length is 0
+PASS objectSet.has(anArray) is false
+PASS objectSet.has(anObject) is false
+PASS objectSet.has(otherObject) is false
+PASS mixedTypeSet.size is 0
+PASS mixedTypeSet.values.length is 0
+PASS mixedTypeSet.has(0) is false
+PASS mixedTypeSet.has('Oliver') is false
+PASS mixedTypeSet.has(stringSet) is false
+PASS mixedTypeSet.has(valueSet) is false
+PASS mixedTypeSet.has(objectSet) is false
+PASS mixedTypeSet.has(anObject) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjssetclearhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/set-clear.html (0 => 170517)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/set-clear.html                                (rev 0)
+++ trunk/LayoutTests/js/set-clear.html        2014-06-27 03:20:34 UTC (rev 170517)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/set-clear.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (170516 => 170517)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-06-27 02:43:21 UTC (rev 170516)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-06-27 03:20:34 UTC (rev 170517)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2014-06-26  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        iOS 8 beta 2 ES6 'Set' clear() broken
+        https://bugs.webkit.org/show_bug.cgi?id=134346
+
+        Reviewed by Oliver Hunt.
+
+        The object map was not cleared :(.
+
+        Kudos to Ashley Gullen for tracking this and making a regression test.
+        Credit to Oliver for finding the missing code.
+
+        * runtime/MapData.h:
+        (JSC::MapData::clear):
+
</ins><span class="cx"> 2014-06-25  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Expose Cache Information to WinLauncher
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeMapDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/MapData.h (170516 => 170517)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/MapData.h        2014-06-27 02:43:21 UTC (rev 170516)
+++ trunk/Source/JavaScriptCore/runtime/MapData.h        2014-06-27 03:20:34 UTC (rev 170517)
</span><span class="lines">@@ -142,12 +142,13 @@
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE void MapData::clear()
</span><span class="cx"> {
</span><ins>+    m_cellKeyedTable.clear();
</ins><span class="cx">     m_valueKeyedTable.clear();
</span><span class="cx">     m_stringKeyedTable.clear();
</span><span class="cx">     m_capacity = 0;
</span><span class="cx">     m_size = 0;
</span><span class="cx">     m_deletedCount = 0;
</span><del>-    m_entries = 0;
</del><ins>+    m_entries = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE MapData::KeyType::KeyType(JSValue v)
</span></span></pre>
</div>
</div>

</body>
</html>