Test forEachEls

This commit is contained in:
Maxime Thirouin committed 2014-05-04 08:45:05 +02:00
1 parent 152051af1c
commit 006c408881
2 files changed
+52

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
module.exports = function(els, fn, context) {
if (els instanceof HTMLCollection || els instanceof NodeList || els instanceof Array) {
return Array.prototype.forEach.call(els, fn, context)
}
// assume simple dom element
return fn.call(context, els)
}