<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>6639</bug_id>
          
          <creation_ts>2006-01-17 20:52:55 -0800</creation_ts>
          <short_desc>for/in returns duplicate keys when key exists on object and its prototype</short_desc>
          <delta_ts>2007-09-04 14:42:32 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>9950</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>10489</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Jesse Costello-Good">jesse</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>ian</cc>
    
    <cc>maksim</cc>
    
    <cc>mrowe</cc>
    
    <cc>tolmasky</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>28770</commentid>
    <comment_count>0</comment_count>
    <who name="Jesse Costello-Good">jesse</who>
    <bug_when>2006-01-17 20:52:55 -0800</bug_when>
    <thetext>The following code evaluates to &quot;toString toString&quot;, however, for...in should never return duplicate keys.

var A = function() {};
A.prototype.toString = function() { &quot;A&quot; };

var B = function() {};
B.prototype = new A();
B.prototype.toString = function() { &quot;B&quot; };

var s = &quot;&quot;;
for (var f in B.prototype) s += f + &quot; &quot;;
s</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28771</commentid>
    <comment_count>1</comment_count>
    <who name="Jesse Costello-Good">jesse</who>
    <bug_when>2006-01-17 20:53:15 -0800</bug_when>
    <thetext>I am evaluating Safari for a port of TIBCO(R) General Interface, a mature AJAX platform that is currently IE 
only. Fixing this bug would make the port more feasible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28785</commentid>
    <comment_count>2</comment_count>
      <attachid>5754</attachid>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2006-01-17 21:56:42 -0800</bug_when>
    <thetext>Created attachment 5754
Test case packged suitable for a layout test</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28787</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2006-01-17 21:58:26 -0800</bug_when>
    <thetext>Thanks for the bug report.  I can confirm this fails in both WebKit 417.9 and ToT WebKit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33482</commentid>
    <comment_count>4</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2006-02-20 06:42:51 -0800</bug_when>
    <thetext>I had a possible fix for this at one point but it caused an apparent performance regression. Maybe time to retest.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35512</commentid>
    <comment_count>5</comment_count>
      <attachid>6937</attachid>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2006-03-08 02:51:22 -0800</bug_when>
    <thetext>Created attachment 6937
Further simplified test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35514</commentid>
    <comment_count>6</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2006-03-08 02:52:03 -0800</bug_when>
    <thetext>*** Bug 7658 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50129</commentid>
    <comment_count>7</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-07-16 21:44:23 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of 9950 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45322</commentid>
    <comment_count>8</comment_count>
    <who name="Jesse Costello-Good">jesse</who>
    <bug_when>2006-11-18 17:22:33 -0800</bug_when>
    <thetext>Thanks to the Safari team for being so responsive regarding requests for better advanced AJAX support. Safari is quickly becoming a 1st class AJAX platform.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>917</commentid>
    <comment_count>9</comment_count>
    <who name="Jesse Costello-Good">jesse</who>
    <bug_when>2007-09-04 14:42:32 -0700</bug_when>
    <thetext>This is fixed in Safari 3 for iPhone 1.0.2</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>5754</attachid>
            <date>2006-01-17 21:56:42 -0800</date>
            <delta_ts>2006-03-08 02:51:22 -0800</delta_ts>
            <desc>Test case packged suitable for a layout test</desc>
            <filename>webkit-bug-6639-test-v1.html</filename>
            <type>text/html</type>
            <size>1111</size>
            <attacher name="Mark Rowe (bdash)">mrowe</attacher>
            
              <data encoding="base64">PGh0bWw+CiAgICA8aGVhZD4KICAgIDwvaGVhZD4KICAgIDxib2R5PgogICAgICAgIDxkaXYgaWQ9
Im91dHB1dCI+CiAgICAgICAgPC9kaXY+CiAgICAgICAgPHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFz
Y3JpcHQiPgogICAgICAgICAgICBmdW5jdGlvbiBzaG91bGRCZShkZXNjcmlwdGlvbiwgZXhwZWN0
ZWQsIGFjdHVhbCkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgdmFyIG1zZzsKICAgICAg
ICAgICAgICAgIGlmIChleHBlY3RlZCA9PSBhY3R1YWwpCiAgICAgICAgICAgICAgICB7CiAgICAg
ICAgICAgICAgICAgICAgbXNnID0gIlBBU1M6ICIgKyBkZXNjcmlwdGlvbjsKICAgICAgICAgICAg
ICAgIH0KICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAg
ICAgICAgICBtc2cgPSAiRkFJTDogIiArIGRlc2NyaXB0aW9uICsgIiAoZXhwZWN0ZWQgIiArIGV4
cGVjdGVkICsgIiwgZ290ICIgKyBhY3R1YWwgKyAiKSI7CiAgICAgICAgICAgICAgICB9CiAgICAg
ICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgib3V0cHV0IikuYXBwZW5kQ2hpbGQo
ZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUobXNnKSk7CiAgICAgICAgICAgIH0KICAgICAgICAKICAg
ICAgICAgICAgdmFyIEEgPSBmdW5jdGlvbigpIHt9OwogICAgICAgICAgICBBLnByb3RvdHlwZS50
b1N0cmluZyA9IGZ1bmN0aW9uKCkgeyByZXR1cm4gIkEiOyB9OwoKICAgICAgICAgICAgdmFyIEIg
PSBmdW5jdGlvbigpIHt9OwogICAgICAgICAgICBCLnByb3RvdHlwZSA9IG5ldyBBKCk7CiAgICAg
ICAgICAgIEIucHJvdG90eXBlLnRvU3RyaW5nID0gZnVuY3Rpb24oKSB7IHJldHVybiAiQiI7IH07
CgogICAgICAgICAgICB2YXIgZW50cmllcyA9IFtdOwogICAgICAgICAgICBmb3IgKHZhciBmIGlu
IEIucHJvdG90eXBlKQogICAgICAgICAgICAgICAgZW50cmllcy5wdXNoKGYpOwogICAgICAgICAg
ICBzaG91bGRCZSgiUHJvdG90eXBlIHNob3VsZCBub3QgaGF2ZSBkdXBsaWNhdGUgZW50cmllcyBm
b3IgdG9TdHJpbmciLCAidG9TdHJpbmciLCBlbnRyaWVzLnRvU3RyaW5nKCkpOwogICAgICAgIDwv
c2NyaXB0PgogICAgPC9ib2R5Pgo8L2h0bWw+Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>6937</attachid>
            <date>2006-03-08 02:51:22 -0800</date>
            <delta_ts>2006-03-08 02:51:22 -0800</delta_ts>
            <desc>Further simplified test case</desc>
            <filename>webkit-bug-6639-2.html</filename>
            <type>text/html</type>
            <size>931</size>
            <attacher name="Mark Rowe (bdash)">mrowe</attacher>
            
              <data encoding="base64">PGh0bWw+CiAgICA8aGVhZD4KICAgIDwvaGVhZD4KICAgIDxib2R5PgogICAgICAgIDxkaXYgaWQ9
Im91dHB1dCI+CiAgICAgICAgPC9kaXY+CiAgICAgICAgPHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFz
Y3JpcHQiPgogICAgICAgICAgICBmdW5jdGlvbiBzaG91bGRCZShkZXNjcmlwdGlvbiwgZXhwZWN0
ZWQsIGFjdHVhbCkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgdmFyIG1zZzsKICAgICAg
ICAgICAgICAgIGlmIChleHBlY3RlZCA9PSBhY3R1YWwpCiAgICAgICAgICAgICAgICAgICAgbXNn
ID0gIlBBU1M6ICIgKyBkZXNjcmlwdGlvbjsKICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAg
ICAgICAgICAgICBtc2cgPSAiRkFJTDogIiArIGRlc2NyaXB0aW9uICsgIiAoZXhwZWN0ZWQgIiAr
IGV4cGVjdGVkICsgIiwgZ290ICIgKyBhY3R1YWwgKyAiKSI7CiAgICAgICAgICAgICAgICBkb2N1
bWVudC5nZXRFbGVtZW50QnlJZCgib3V0cHV0IikuYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRl
VGV4dE5vZGUobXNnKSk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIHZhciBhQ2xhc3MgPSBm
dW5jdGlvbigpIHt9OwogICAgICAgICAgICBhQ2xhc3MucHJvdG90eXBlLmZvbyA9IGZ1bmN0aW9u
KCkge307CiAgICAgICAgICAgIAogICAgICAgICAgICB2YXIgYSA9IG5ldyBhQ2xhc3MoKTsKICAg
ICAgICAgICAgYS5mb28gPSAxOwoKICAgICAgICAgICAgdmFyIGVudHJpZXMgPSBbXTsKICAgICAg
ICAgICAgZm9yICh2YXIgZiBpbiBhKQogICAgICAgICAgICAgICAgZW50cmllcy5wdXNoKGYpOwog
ICAgICAgICAgICBzaG91bGRCZSgiT2JqZWN0IHNob3VsZCBub3QgaGF2ZSBkdXBsaWNhdGUgcHJv
cGVydGllcyIsICJmb28iLCBlbnRyaWVzLnRvU3RyaW5nKCkpOwogICAgICAgIDwvc2NyaXB0Pgog
ICAgPC9ib2R5Pgo8L2h0bWw+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>