v0lkan/o2.js — Issue #47: some of the functions are closing over DOM nodes, avoid it.
Author: v0lkan
Created: 2011-11-15 06:03:14+00:00
State: open

For example:

el = $(el);

if (!el) {
return null;
}

if (el.querySelectorAll) {
me.getElementsByClassName = function(el, c) {
el = $(el);

if (!el) {
return null;
}

return el.querySelectorAll(['.', c].join(kEmpty));
};

return me.getElementsByClassName(el, c);
}

The closure closes over el, it's a bad in terms of memory utilization. We should take the closure out.