git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ccf0550
)
Added a change that triples the speed of all uses of $(...). For example $(DOMElement...
author
John Resig
<jeresig@gmail.com>
Mon, 10 Dec 2007 01:45:03 +0000
(
01:45
+0000)
committer
John Resig
<jeresig@gmail.com>
Mon, 10 Dec 2007 01:45:03 +0000
(
01:45
+0000)
src/core.js
patch
|
blob
|
history
diff --git
a/src/core.js
b/src/core.js
index
27a5728
..
39ffdb5
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-14,10
+14,8
@@
if ( window.jQuery )
var _jQuery = window.jQuery;
var jQuery = window.jQuery = function( selector, context ) {
var _jQuery = window.jQuery;
var jQuery = window.jQuery = function( selector, context ) {
- // If the context is a namespace object, return a new object
- return this instanceof jQuery ?
- this.init( selector, context ) :
- new jQuery( selector, context );
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.prototype.init( selector, context );
};
// Map over the $ in case of overwrite
};
// Map over the $ in case of overwrite
@@
-521,6
+519,9
@@
jQuery.fn = jQuery.prototype = {
}
};
}
};
+// Give the init function the jQuery prototype for later instantiation
+jQuery.prototype.init.prototype = jQuery.prototype;
+
function evalScript( i, elem ) {
if ( elem.src )
jQuery.ajax({
function evalScript( i, elem ) {
if ( elem.src )
jQuery.ajax({