Assigning jQuery to random namespaces and the true unobtrusiveness

Assigning jQuery to random namespaces and the true unobtrusiveness

First, congratulations on jQuery 1.1.4!
An exciting improvement in the new release is the ability to assign jQuery to random namespaces. (see <a href="http://dev.jquery.com/ticket/1393">http://dev.jquery.com/ticket/1393
</a>)
This demonstrates again the unobtrusiveness of jQuery.
However, besides the namespace conflict, there are other types of conflicts. e.g. window.jQuery is still being set so that it might be problematic if you run multiple versions of jQuery side by side.
Although running multiple versions of jQuery rarely happens in regular web development, there are cases.
For example
<ol><li>Ticket 1393 is created by Byron who tried to use jQuey in Firefox extension development
</li><li>I use jQuery in a bookmarklet application</li><li>a widget to be embedded in any web pages
</li></ol>To make jQuery further unobtrusive, we need to
<ol><li>don't set window.jQuery</li><li>in grep() and map(), change fn = new Function(..) to eval('fn = function(..) {..}');
(new Function(..) doesn't have lexical scoping, so parents: "jQuery.parents(a)" will fail to reference jQuery if we don't set window.jQuery)
</li><li>name all expandos with a prefix e.g. $events
</li></ol>Thus, we can even run multiple copies of jQuery side by side, which is greatly desired when jQuery is used in any embedded application.
P.S.
more about the function constructor and eval scoping difference
<pre class="code"><span style="color: rgb(0, 0, 200);">function</span> f1() {
<span style="color: rgb(0, 0, 200);">var</span> bbb = 2;
<span style="color: rgb(0, 100, 200);">eval</span>(<span style="color: rgb(0, 128, 0);">
'alert(bbb);'</span>);
}
f1(); <span style="color: rgb(128, 128, 0);">//alerts</span> <span style="color: rgb(128, 128, 0);">2
</span><span style="color: rgb(0, 0, 200);">function</span> f2() {
<span style="color: rgb(0, 0, 200);">
var</span> bbb = 2;
<span style="color: rgb(0, 0, 200);">new</span> <span style="color: rgb(0, 100, 200);">Function</span>(<span style="color: rgb(0, 128, 0);">'alert(bbb)'</span>)();
}
f2(); <span style="color: rgb(128, 128, 0);">
//bbb</span> <span style="color: rgb(128, 128, 0);">undefined</span> <span style="color: rgb(128, 128, 0);">error
</span><span style="color: rgb(0, 0, 200);">function</span> f3() {
<span style="color: rgb(0, 0, 200);">
var</span> bbb = 2;
<span style="color: rgb(0, 100, 200);">eval</span>(<span style="color: rgb(0, 128, 0);">'function() {alert(bbb);}'</span>)();
}
f3(); <span style="color: rgb(128, 128, 0);">//alerts</span>
<span style="color: rgb(128, 128, 0);">2</span></pre>
--
Arrix