Skip to content
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

Ember.isArray return true for FileList object #12688

Closed
joelcox opened this issue Dec 6, 2015 · 4 comments · Fixed by #12708
Closed

Ember.isArray return true for FileList object #12688

joelcox opened this issue Dec 6, 2015 · 4 comments · Fixed by #12708

Comments

@joelcox
Copy link
Contributor

joelcox commented Dec 6, 2015

Passing a FileList object to Ember.isArray returns true, even though it does not behave like an Ember Array/Enumerable. I'm not sure if this is within the scope of Ember.

JSBin: http://emberjs.jsbin.com/ricokobotu/8/edit?js,console,output

Interesting bit from the File spec:

The FileList interface should be considered "at risk" since the general trend on the Web Platform is to replace such interfaces with the Array platform object in ECMAScript [ECMA-262]. In particular, this means syntax of the sort filelist.item(0) is at risk; most other programmatic use of FileList is unlikely to be affected by the eventual migration to an Array type.

@pixelhandler
Copy link
Contributor

@joelcox yeah seems like Ember.isArray() has a bug; using Array.isArray(files) is false. Perhaps avoid Ember.isArray() for now.

@mmun
Copy link
Member

mmun commented Feb 21, 2016

We should fix this bug. Ember.isArray is useful because it can be used to detect an ArrayProxy, whereas Array.isArray cannot.

@mmun mmun added the Bug label Feb 21, 2016
@joelalejandro
Copy link

@mmun There was a fix apparently, but it didn't pass CI for IE9, for what I read in referenced PRs.

@mixonic mixonic added the Has PR label Jun 26, 2016
@mixonic
Copy link
Member

mixonic commented Jun 26, 2016

The approach in #12708 seems quite legit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants