aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-07-19 19:55:21 +0000
committerJohn Resig <jeresig@gmail.com>2009-07-19 19:55:21 +0000
commit29ff710c9b02dee2c407b408ea88489b3cef688e (patch)
tree992b78203e038b90658685b15cb68d797c928f44
parentb953c1d50a2c9a169b7fc47e78c2b8b0acb8a93d (diff)
downloadjquery-29ff710c9b02dee2c407b408ea88489b3cef688e.tar.gz
jquery-29ff710c9b02dee2c407b408ea88489b3cef688e.zip
Made some syntax tweaks to core.js.
-rw-r--r--src/core.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/core.js b/src/core.js
index 88c04373d..460a1dad2 100644
--- a/src/core.js
+++ b/src/core.js
@@ -251,10 +251,15 @@ jQuery.extend = jQuery.fn.extend = function() {
if ( deep && copy && typeof copy === "object" && !copy.nodeType ) {
var clone;
- if( src ) clone = src;
- else if( jQuery.isArray(copy) ) clone = [ ];
- else if( jQuery.isObject(copy) ) clone = { };
- else clone = copy;
+ if ( src ) {
+ clone = src;
+ } else if ( jQuery.isArray(copy) ) {
+ clone = [];
+ } else if ( jQuery.isObject(copy) ) {
+ clone = {};
+ } else {
+ clone = copy;
+ }
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
@@ -298,8 +303,9 @@ jQuery.extend({
},
isEmptyObject: function( obj ) {
- for(var name in obj)
+ for ( var name in obj ) {
return false;
+ }
return true;
},
@@ -318,6 +324,7 @@ jQuery.extend({
script = document.createElement("script");
script.type = "text/javascript";
+
if ( jQuery.support.scriptEval ) {
script.appendChild( document.createTextNode( data ) );
} else {