<!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>[160592] 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/160592">160592</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-13 23:53:44 -0800 (Fri, 13 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Some Set and Map prototype functions have incorrect function lengths
https://bugs.webkit.org/show_bug.cgi?id=125732

Patch by Joseph Pecoraro &lt;pecoraro@apple.com&gt; on 2013-12-13
Reviewed by Oliver Hunt.

Source/JavaScriptCore:

* runtime/MapPrototype.cpp:
(JSC::MapPrototype::finishCreation):
* runtime/SetPrototype.cpp:
(JSC::SetPrototype::finishCreation):

LayoutTests:

* js/basic-map-expected.txt:
* js/basic-set-expected.txt:
* js/script-tests/basic-map.js:
* js/script-tests/basic-set.js:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsbasicmapexpectedtxt">trunk/LayoutTests/js/basic-map-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsbasicsetexpectedtxt">trunk/LayoutTests/js/basic-set-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsbasicmapjs">trunk/LayoutTests/js/script-tests/basic-map.js</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsbasicsetjs">trunk/LayoutTests/js/script-tests/basic-set.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeMapPrototypecpp">trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSetPrototypecpp">trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (160591 => 160592)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-14 07:43:56 UTC (rev 160591)
+++ trunk/LayoutTests/ChangeLog        2013-12-14 07:53:44 UTC (rev 160592)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2013-12-13  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Some Set and Map prototype functions have incorrect function lengths
+        https://bugs.webkit.org/show_bug.cgi?id=125732
+
+        Reviewed by Oliver Hunt.
+
+        * js/basic-map-expected.txt:
+        * js/basic-set-expected.txt:
+        * js/script-tests/basic-map.js:
+        * js/script-tests/basic-set.js:
+
+2013-12-13  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
</ins><span class="cx">         Web Inspector: Move Inspector and Debugger protocol domains into JavaScriptCore
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=125707
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsjsbasicmapexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/basic-map-expected.txt (160591 => 160592)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/basic-map-expected.txt        2013-12-14 07:43:56 UTC (rev 160591)
+++ trunk/LayoutTests/js/basic-map-expected.txt        2013-12-14 07:53:44 UTC (rev 160592)
</span><span class="lines">@@ -19,6 +19,13 @@
</span><span class="cx"> PASS Object.hasOwnProperty(map, 'size') is false
</span><span class="cx"> PASS Map.prototype.hasOwnProperty('size') is true
</span><span class="cx"> PASS Map.prototype.size threw exception TypeError: Map operation called on non-Map object.
</span><ins>+PASS Map.prototype.set.length is 2
+PASS Map.prototype.has.length is 1
+PASS Map.prototype.get.length is 1
+PASS Map.prototype.clear.length is 0
+PASS Map.prototype.keys.length is 0
+PASS Map.prototype.values.length is 0
+PASS Map.prototype.entries.length is 0
</ins><span class="cx"> PASS map.size is 0
</span><span class="cx"> PASS map.set(-0, 1) is map
</span><span class="cx"> PASS map.set(0, 2) is map
</span></span></pre></div>
<a id="trunkLayoutTestsjsbasicsetexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/basic-set-expected.txt (160591 => 160592)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/basic-set-expected.txt        2013-12-14 07:43:56 UTC (rev 160591)
+++ trunk/LayoutTests/js/basic-set-expected.txt        2013-12-14 07:53:44 UTC (rev 160592)
</span><span class="lines">@@ -26,7 +26,13 @@
</span><span class="cx"> [object Object]
</span><span class="cx"> PASS Object.hasOwnProperty(set, 'size') is false
</span><span class="cx"> PASS Set.prototype.hasOwnProperty('size') is true
</span><del>-PASS Map.prototype.size threw exception TypeError: Map operation called on non-Map object.
</del><ins>+PASS Set.prototype.size threw exception TypeError: Set operation called on non-Set object.
+PASS Set.prototype.add.length is 1
+PASS Set.prototype.has.length is 1
+PASS Set.prototype.clear.length is 0
+PASS Set.prototype.keys.length is 0
+PASS Set.prototype.values.length is 0
+PASS Set.prototype.entries.length is 0
</ins><span class="cx"> PASS set.size is 0
</span><span class="cx"> PASS set.add(-0) is set
</span><span class="cx"> PASS set.add(0) is set
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsbasicmapjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/basic-map.js (160591 => 160592)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/basic-map.js        2013-12-14 07:43:56 UTC (rev 160591)
+++ trunk/LayoutTests/js/script-tests/basic-map.js        2013-12-14 07:53:44 UTC (rev 160592)
</span><span class="lines">@@ -21,6 +21,15 @@
</span><span class="cx"> shouldBeFalse(&quot;Object.hasOwnProperty(map, 'size')&quot;)
</span><span class="cx"> shouldBeTrue(&quot;Map.prototype.hasOwnProperty('size')&quot;)
</span><span class="cx"> shouldThrow(&quot;Map.prototype.size&quot;)
</span><ins>+
+shouldBe(&quot;Map.prototype.set.length&quot;, &quot;2&quot;)
+shouldBe(&quot;Map.prototype.has.length&quot;, &quot;1&quot;)
+shouldBe(&quot;Map.prototype.get.length&quot;, &quot;1&quot;)
+shouldBe(&quot;Map.prototype.clear.length&quot;, &quot;0&quot;)
+shouldBe(&quot;Map.prototype.keys.length&quot;, &quot;0&quot;)
+shouldBe(&quot;Map.prototype.values.length&quot;, &quot;0&quot;)
+shouldBe(&quot;Map.prototype.entries.length&quot;, &quot;0&quot;)
+
</ins><span class="cx"> shouldBe(&quot;map.size&quot;, &quot;0&quot;)
</span><span class="cx"> shouldBe(&quot;map.set(-0, 1)&quot;, &quot;map&quot;)
</span><span class="cx"> shouldBe(&quot;map.set(0, 2)&quot;, &quot;map&quot;)
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsbasicsetjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/basic-set.js (160591 => 160592)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/basic-set.js        2013-12-14 07:43:56 UTC (rev 160591)
+++ trunk/LayoutTests/js/script-tests/basic-set.js        2013-12-14 07:53:44 UTC (rev 160592)
</span><span class="lines">@@ -25,7 +25,15 @@
</span><span class="cx"> var set = new Set;
</span><span class="cx"> shouldBeFalse(&quot;Object.hasOwnProperty(set, 'size')&quot;)
</span><span class="cx"> shouldBeTrue(&quot;Set.prototype.hasOwnProperty('size')&quot;)
</span><del>-shouldThrow(&quot;Map.prototype.size&quot;)
</del><ins>+shouldThrow(&quot;Set.prototype.size&quot;)
+
+shouldBe(&quot;Set.prototype.add.length&quot;, &quot;1&quot;)
+shouldBe(&quot;Set.prototype.has.length&quot;, &quot;1&quot;)
+shouldBe(&quot;Set.prototype.clear.length&quot;, &quot;0&quot;)
+shouldBe(&quot;Set.prototype.keys.length&quot;, &quot;0&quot;)
+shouldBe(&quot;Set.prototype.values.length&quot;, &quot;0&quot;)
+shouldBe(&quot;Set.prototype.entries.length&quot;, &quot;0&quot;)
+
</ins><span class="cx"> shouldBe(&quot;set.size&quot;, &quot;0&quot;)
</span><span class="cx"> shouldBe(&quot;set.add(-0)&quot;, &quot;set&quot;)
</span><span class="cx"> shouldBe(&quot;set.add(0)&quot;, &quot;set&quot;)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (160591 => 160592)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2013-12-14 07:43:56 UTC (rev 160591)
+++ trunk/Source/JavaScriptCore/ChangeLog        2013-12-14 07:53:44 UTC (rev 160592)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2013-12-13  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Some Set and Map prototype functions have incorrect function lengths
+        https://bugs.webkit.org/show_bug.cgi?id=125732
+
+        Reviewed by Oliver Hunt.
+
+        * runtime/MapPrototype.cpp:
+        (JSC::MapPrototype::finishCreation):
+        * runtime/SetPrototype.cpp:
+        (JSC::SetPrototype::finishCreation):
+
+2013-12-13  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
</ins><span class="cx">         Web Inspector: Move Inspector and Debugger protocol domains into JavaScriptCore
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=125707
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeMapPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp (160591 => 160592)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp        2013-12-14 07:43:56 UTC (rev 160591)
+++ trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp        2013-12-14 07:53:44 UTC (rev 160592)
</span><span class="lines">@@ -64,10 +64,10 @@
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;get, mapProtoFuncGet, DontEnum, 1);
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;has, mapProtoFuncHas, DontEnum, 1);
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;set, mapProtoFuncSet, DontEnum, 2);
</span><del>-    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;keys, mapProtoFuncKeys, DontEnum, 2);
-    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;values, mapProtoFuncValues, DontEnum, 2);
-    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;entries, mapProtoFuncEntries, DontEnum, 2);
-    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;iteratorPrivateName, mapProtoFuncEntries, DontEnum, 2);
</del><ins>+    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;keys, mapProtoFuncKeys, DontEnum, 0);
+    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;values, mapProtoFuncValues, DontEnum, 0);
+    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;entries, mapProtoFuncEntries, DontEnum, 0);
+    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;iteratorPrivateName, mapProtoFuncEntries, DontEnum, 0);
</ins><span class="cx"> 
</span><span class="cx">     GetterSetter* accessor = GetterSetter::create(vm);
</span><span class="cx">     JSFunction* function = JSFunction::create(vm, globalObject, 0, vm.propertyNames-&gt;size.string(), mapProtoFuncSize);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSetPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp (160591 => 160592)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp        2013-12-14 07:43:56 UTC (rev 160591)
+++ trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp        2013-12-14 07:53:44 UTC (rev 160592)
</span><span class="lines">@@ -58,8 +58,8 @@
</span><span class="cx">     ASSERT(inherits(info()));
</span><span class="cx">     vm.prototypeMap.addPrototype(this);
</span><span class="cx"> 
</span><del>-    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;add, setProtoFuncAdd, DontEnum, 0);
-    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;clear, setProtoFuncClear, DontEnum, 1);
</del><ins>+    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;add, setProtoFuncAdd, DontEnum, 1);
+    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;clear, setProtoFuncClear, DontEnum, 0);
</ins><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;deleteKeyword, setProtoFuncDelete, DontEnum, 1);
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;forEach, setProtoFuncForEach, DontEnum, 1);
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;has, setProtoFuncHas, DontEnum, 1);
</span></span></pre>
</div>
</div>

</body>
</html>