export function createFileList ( files ) { const list = { ... files , length : files . length , item : ( index ) => list [ index ] , [ Symbol . iterator ] : function * nextFile ( ) { for ( let i = 0 ; i < list . length ; i ++ ) { yield list [ i ] ; } } , } ; list . constructor = FileList ; Object . setPrototypeOf ( list , FileList . prototype ) ; Object . freeze ( list ) ; return list ; }