RESOLVED DUPLICATE of bug 9950 6639
for/in returns duplicate keys when key exists on object and its prototype
https://bugs.webkit.org/show_bug.cgi?id=6639
Summary for/in returns duplicate keys when key exists on object and its prototype
Jesse Costello-Good
Reported 2006-01-17 20:52:55 PST
The following code evaluates to "toString toString", however, for...in should never return duplicate keys. var A = function() {}; A.prototype.toString = function() { "A" }; var B = function() {}; B.prototype = new A(); B.prototype.toString = function() { "B" }; var s = ""; for (var f in B.prototype) s += f + " "; s
Attachments
Test case packged suitable for a layout test (1.08 KB, text/html)
2006-01-17 21:56 PST, Mark Rowe (bdash)
no flags
Further simplified test case (931 bytes, text/html)
2006-03-08 02:51 PST, Mark Rowe (bdash)
no flags
Jesse Costello-Good
Comment 1 2006-01-17 20:53:15 PST
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.
Mark Rowe (bdash)
Comment 2 2006-01-17 21:56:42 PST
Created attachment 5754 [details] Test case packged suitable for a layout test
Mark Rowe (bdash)
Comment 3 2006-01-17 21:58:26 PST
Thanks for the bug report. I can confirm this fails in both WebKit 417.9 and ToT WebKit.
Maciej Stachowiak
Comment 4 2006-02-20 06:42:51 PST
I had a possible fix for this at one point but it caused an apparent performance regression. Maybe time to retest.
Mark Rowe (bdash)
Comment 5 2006-03-08 02:51:22 PST
Created attachment 6937 [details] Further simplified test case
Mark Rowe (bdash)
Comment 6 2006-03-08 02:52:03 PST
*** Bug 7658 has been marked as a duplicate of this bug. ***
Alexey Proskuryakov
Comment 7 2006-07-16 21:44:23 PDT
*** This bug has been marked as a duplicate of 9950 ***
Jesse Costello-Good
Comment 8 2006-11-18 17:22:33 PST
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.
Jesse Costello-Good
Comment 9 2007-09-04 14:42:32 PDT
This is fixed in Safari 3 for iPhone 1.0.2
Note You need to log in before you can comment on or make changes to this bug.