From 0935f4a0b1281f5d09685fa08b86944b2421747f Mon Sep 17 00:00:00 2001 From: John Resig Date: Fri, 19 Dec 2008 04:36:28 +0000 Subject: [PATCH] Removing remaining strict-mode warnings. --- src/core.js | 6 +++--- src/event.js | 5 +++-- src/offset.js | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/core.js b/src/core.js index 32e850f5..d6577e60 100644 --- a/src/core.js +++ b/src/core.js @@ -680,7 +680,7 @@ jQuery.extend({ // Return the named cache data, or the ID for the element return name ? - jQuery.cache[ id ][ name ] : + jQuery.cache[ id ][ name ] || null : id; }, @@ -1163,12 +1163,12 @@ jQuery.extend({ // Also, we need to make sure that the correct elements are being returned // (IE returns comment nodes in a '*' query) if ( jQuery.browser.msie ) { - while ( elem = second[ i++ ] ) + while ( (elem = second[ i++ ]) ) if ( elem.nodeType != 8 ) first[ pos++ ] = elem; } else - while ( elem = second[ i++ ] ) + while ( (elem = second[ i++ ]) ) first[ pos++ ] = elem; return first; diff --git a/src/event.js b/src/event.js index 7bbca2a7..92252a22 100644 --- a/src/event.js +++ b/src/event.js @@ -40,8 +40,9 @@ jQuery.event = { handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){ // Handle the second event of a trigger and when // an event is called after a page has unloaded - if ( typeof jQuery !== "undefined" && !jQuery.event.triggered ) - return jQuery.event.handle.apply(arguments.callee.elem, arguments); + return typeof jQuery !== "undefined" && !jQuery.event.triggered ? + jQuery.event.handle.apply(arguments.callee.elem, arguments) : + undefined; }); // Add elem as a property of the handle function // This is to prevent a memory leak with non-native diff --git a/src/offset.js b/src/offset.js index 30dedbc8..44523d8e 100644 --- a/src/offset.js +++ b/src/offset.js @@ -131,7 +131,7 @@ jQuery.each( ['Left', 'Top'], function(i, name) { var method = 'scroll' + name; jQuery.fn[ method ] = function(val) { - if (!this[0]) return; + if (!this[0]) return null; return val !== undefined ?