Standardized the type checks across core. isFunction and isArray now use Object.prototype.toString to verify the type, .constructor use was removed in favor of typeof, typeof checks now use ===, undefined checks use === undefined. All of this is outlined in the new style guidelines: http://docs.jquery.com/JQuery_Core_Style_Guidelines#Type_Checks. Fixes bug #3618.

This commit is contained in:
John Resig 2008-11-17 16:32:05 +00:00
parent 0aa8d40cdf
commit ab551c2b14
6 changed files with 52 additions and 54 deletions

View file

@ -133,7 +133,7 @@ jQuery.each( ['Left', 'Top'], function(i, name) {
jQuery.fn[ method ] = function(val) {
if (!this[0]) return;
return val != undefined ?
return val !== undefined ?
// Set the scroll offset
this.each(function() {