FileList behaves incorrectly in a couple different ways

Issue #7475645 • Assigned to Shawn P.

Details

Author
Michael W.
Created
May 6, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
Standard affected
File API

Found in build #
13.10586
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Discovered when iterating through the properties of a FileList as though it were an array.

I’ve attached a rudimentary test file to demonstrate these behaviors, but I’ll describe them here:

First, FileList.prototype.hasOwnProperty always returns, making iteration difficult:

for (const index in myFileList) {
  if (myFileList.hasOwnProperty(index)) {
    // Nothing in here executes because FileList.prototype.hasOwnProperty
    // always returns false
  }
}

Second, FileList.prototype.item is supposed to return the File item at a given index. It will also return a file if given a string:

myFileList.item(0) // => [object File]
myFileList.item(1) // => no item, this imaginary input has just one file
myFileList.item("any string") // => [object File]

Attachments

1 attachment

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Ibrahim O.”

    Changed Assigned To to “Travis L.”

    Changed Assigned To to “Venkat K.”

    Changed Assigned To from “Venkat K.” to “Shawn P.”

You need to sign in to your Microsoft account to add a comment.

Sign in