Open andreubotella opened 4 years ago
Yeah, I'm honestly not sure of the best way forward with that. A NodeList and HTMLCollection aren't arrays, so they shouldn't be identified as such. I'd really like some way to keep an implementation based on arrays for that magical performance they get, but this Javascript limitation is quite frustrating to say the least.
I'll fix the current behavior, and will look into an alternative implementation for the actual NodeList/HTMLCollection.
Fixed in f51eafcace70587eb1bc88ac8a16edcb5db142e9. However, the issue of global pollution still stands so I'll leave this open for now.
The monkeypatched versions of
Array[Symbol.hasInstance]
andArray.isArray
defined insrc/api.ts
will throw when passednull
orundefined
. This is problematic because those monkeypatched versions pollute the global namespace, and can cause hard-to-debug action at a distance across modules.