In a certain app state, Array.prototype.filter() returns incorrect results in Safari 8
| Originator: | ryan | ||
| Number: | rdar://17186034 | Date Originated: | 05-Jun-2014 03:03 PM |
| Status: | Closed | Resolved: | Duplicate of 17019752 |
| Product: | Safari | Product Version: | 8.0 (10538.35.8) |
| Classification: | Serious | Reproducible: | Always |
Summary: The Router component in the YUI JS library somehow induces a certain state that temporarily causes Array.prototype.filter() to return incorrect results (an empty array instead of a correctly filtered array). I've been unable to track down the precise cause of this state, but it's at least consistently reproducible using the attached test case, which is also visible at http://jsbin.com/potewaye/13/edit?js,console The test succeeds in all browsers except Safari 8. I don't think the problem lies with YUI, since YUI's router has been in wide production use for several years and this problem only surfaced in Safari 8. http://www.smugmug.com/ is one such production website affected by this bug. Steps to Reproduce: 1. Run the attached test case. Expected Results: Three separate arrays should be logged to the console: ["started"], ["finished"], and ["foo"]. Actual Results: In Safari 8, the logged arrays are ["started"], ["finished"], and [], and you'll see the error message "Array.prototype.filter() failed!" indicating that Array.prototype.filter() returned incorrect results. Version: Safari Version 8.0 (10538.35.8) OS X 10.10 (14A238x) Notes: Configuration: Occurs in Safari 8 on OS X 10.10. Does not occur in Safari 7 on OS X 10.9, in Google Chrome 35.0.1916.114, or in Firefox 29.0.1. Attachments:
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Apple closed this as a duplicate of rdar://17019752
Also filed this at https://bugs.webkit.org/show_bug.cgi?id=133577 since it occurs in WebKit nightlies as well.