-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[BUGFIX beta] Align Em.isArray behavior with Array.isArray for FileList type #12708
Conversation
It appears that IE9 test is failing because of FileList API absence. |
If you are looking for an array, is there a reason to not use Array.isArray? What scenario lead you to discover this quirk? We need to be careful that his doesn't have unexpected side affects, are there scenarios were the current check results in behavior someone legitimately relies on? What other cases are missing. Is this form of type checking actually flawed? |
@stefanpenner CCing @joelcox from this issue, as he is the one who found this culprit #12688 |
Thanks for working on this fix @kamilogorek. I encountered this behavior while working on an internal file upload component (based on ember-uploader), which was set up in such a way that it would accept both an array of files, or a single file. |
☔ The latest upstream changes (presumably #13658) made this pull request unmergeable. Please resolve the merge conflicts. |
@kamilogorek can you just move the fileList assertions into a separate test that only runs if fileList support is present? That would seem sufficient. |
Sure, will do! I'll update PR within |
@mixonic like this? |
Yeah this looks great to me @kamilogorek. r+ @rwjblue? |
☔ The latest upstream changes (presumably #14215) made this pull request unmergeable. Please resolve the merge conflicts. |
Resolved. |
Thanks @kamilogorek! |
FileList
type is currently detected asarray
, however it doesn't provide it's methods likeforEach
ormap
.Also
Array.isArray
doesn't considerFileType
as anarray
.This PR unifies this behavior and fixes #12688.