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:
af961d5
)
Added fix for jQuery.extend( Object, null || undefined ) lapsing back to just jQuery...
author
John Resig
<jeresig@gmail.com>
Sun, 15 Oct 2006 03:11:02 +0000
(
03:11
+0000)
committer
John Resig
<jeresig@gmail.com>
Sun, 15 Oct 2006 03:11:02 +0000
(
03:11
+0000)
src/jquery/jquery.js
patch
|
blob
|
history
diff --git
a/src/jquery/jquery.js
b/src/jquery/jquery.js
index
31dde99
..
6b05a06
100644
(file)
--- a/
src/jquery/jquery.js
+++ b/
src/jquery/jquery.js
@@
-1297,8
+1297,17
@@
jQuery.fn = jQuery.prototype = {
* @cat Javascript
*/
jQuery.extend = jQuery.fn.extend = function(obj,prop) {
* @cat Javascript
*/
jQuery.extend = jQuery.fn.extend = function(obj,prop) {
+ // Watch for the case where null or undefined gets passed in by accident
+ if ( arguments.length > 1 && (prop === null || prop == undefined) )
+ return obj;
+
+ // If no property object was provided, then we're extending jQuery
if ( !prop ) { prop = obj; obj = this; }
if ( !prop ) { prop = obj; obj = this; }
+
+ // Extend the base object
for ( var i in prop ) obj[i] = prop[i];
for ( var i in prop ) obj[i] = prop[i];
+
+ // Return the modified object
return obj;
};
return obj;
};