-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deepDiffer causing lots of Array iteration logspew #868
Comments
For me it is unclear why for..in should be considered broken. (The link 'https://fburl.com/31944000' is gone) I also refactored some of those loops into .forEach(function() {..., but there are some 'this'-related side effects. |
Thanks Ben, for clearing that up. I see now, that it is a good idea to give that warning. |
@spicyj @dvbportal so guys is this still a bug or is there a proper way to do this? I am having the same error with ListView. |
Still an issue unfortunately. Should be fixed with the next sync though. |
+1 |
+1 |
I landed a fix internally that should get sync'd out soon.
|
@sahrens is your fix to make the polyfilled methods non-enumerable? That's the cleanest solution I had in mind since RN is used only in ES5+ environments. |
My fix just checks Array.isArray in deepDiffer and does the appropriate type of iteration.
|
Got it - that fix seems right too. For the Array.prototype polyfill I think we want to use Object.defineProperty to add the polyfilled methods as non-enumerable properties. I imagine this was not done consciously for www so is it possible for www and RN to have different copies of the polyfill? |
It was done consciously for www because we want to have the same behavior with IE8 that doesn't support Object.defineProperty. If we were to use Object.defineProperty, we would break IE8 in a lot of terrible ways as most developers are not testing against IE8. But, you are right, it doesn't seem like a good way to polyfill it in React Native. |
Fixed in ab1efbd. |
See:
The text was updated successfully, but these errors were encountered: