Array.reduce() returns NaN or undefined when executed inside a RAF loop
Reported by
julian.g...@gmail.com,
Apr 6 2017
|
|||||
Issue descriptionChrome Version : 59.0.3063.0 OS Version: OS X 10.12.3 URLs (if applicable) : http://codepen.io/juliangarnier/pen/JWVmpR?editors=0011 Other browsers tested: Chrome 57: OK Safari 10: OK Firefox 52: OK What steps will reproduce the problem? 1. Create a function that use Array.reduce() to process data from 2 Arrays and return the result. 2. Loop through the function using requestAnimationFrame an log the result. 3. Wait a few seconds, between 10s and 40s. What is the expected result? The result of the function is logged every frame, returning the proper Array.reduce() operation result. What happens instead of that? Array.reduce() returns undefined or NaN depending of the type of data contained in the Arrays. Please provide any additional information below. Attach a screenshot if possible. Looks like the problem happens more quickly if looped inside a for loop. The problem can be solved by replacing the native Array.reduce with a polyfill (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce#Polyfill) UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3063.0 Safari/537.36
,
Apr 6 2017
Not Mac-specific
,
Apr 7 2017
Tested this issue on Windows 10 using chrome #59.0.3064.0 as per steps mentioned in the comment #0 Didn't observe any undefined or NaN depending of the type of data contained in the Arrays Attaching the screen-shot for reference. julian.garnier@ Could you re-try the same scenario on clean profile with no apps & extensions and let us know your observations. Thank You...
,
Apr 7 2017
Tested on 59.0.3065.0 with the same profile than my first test on 59.0.3063.0 and didn't observe any problem either. Looks like the problem was related to <= 59.0.3063.0 PS: Not sure if I can mark this issue as resolved, I don't see any button Thanks
,
Apr 7 2017
Thank you for providing more feedback. Adding requester "kkaluri@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 10 2017
Thanks julian.garnier@ for an update. Closing this as per C#4. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by ranjitkan@chromium.org
, Apr 6 2017