Skip to content

Avoid looping over HTMLCollections and NodeLists with for-of

George Bateman requested to merge GKFX/dropzone:no-for-of-lists into master

For-of loops over these types require an external library, see #265 and http://kangax.github.io/compat-table/es6/#test-for..of_loops_with_generic_iterables. It is possible to loop over arrays with for-of despite what the above table currently says.

Fixes #265.

There is one deliberate change in behaviour as I noticed an inconsistency between code that runs on old IE and the modern code. It appears that in Dropzone.discover, previously old IE only accepted the selector div.dropzone, form.dropzone while modern browsers accepted anything matching .dropzone. I changed this to use document.getElementsByClassName('dropzone') on all platforms to simplify things. I can change that back if required.

Edited by George Bateman

Merge request reports