GithubHelp home page GithubHelp logo

Comments (9)

Wildhoney avatar Wildhoney commented on May 22, 2024 1

@ljharb thanks!

from array.from.

ljharb avatar ljharb commented on May 22, 2024

This is a spec-compliant method - is FileList array like, or does it have Symbol.iterator? If not, it's not supposed to work with Array.from.

from array.from.

Wildhoney avatar Wildhoney commented on May 22, 2024

Yes.

from array.from.

ljharb avatar ljharb commented on May 22, 2024

Hmm - #4 is for iterator support, but since it's array-like, it should just work already. (Note that Array.isArray() is the proper way to check if something's an array, never instanceof).

In your original post, is FileList the actual list of files, or is it the constructor for the list of files?

Could you create a jsfiddle (using https://wzrd.in/standalone/array.from@latest if that helps) that reproduces the failure?

from array.from.

Wildhoney avatar Wildhoney commented on May 22, 2024

Done.

It's peculiar, because the native Array.from yields an array of File objects – whereas the polyfill implementation simply wraps FileList in an array.

from array.from.

JakeChampion avatar JakeChampion commented on May 22, 2024

Hopefully #27 can help with this issue?

from array.from.

ljharb avatar ljharb commented on May 22, 2024

FileLists are arraylike, and don't necessarily have Symbol.iterator, so this is a separate issue.

from array.from.

ljharb avatar ljharb commented on May 22, 2024

@Wildhoney thank you - I've found the bug. The tests were being run on everything except the single binding at the main entry point - and that's where it was.

Fix incoming shortly.

from array.from.

ljharb avatar ljharb commented on May 22, 2024

Released as v1.0.2

from array.from.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.