Skip to content

Commit

Permalink
Switch to using String.prototype.trim from String.trim as it's more-w…
Browse files Browse the repository at this point in the history
…idely available.
  • Loading branch information
jeresig committed Mar 11, 2010
1 parent da26d0e commit ba8938d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core.js
Expand Up @@ -53,6 +53,7 @@ var jQuery = function( selector, context ) {
hasOwn = Object.prototype.hasOwnProperty,
push = Array.prototype.push,
slice = Array.prototype.slice,
trim = String.prototype.trim,
indexOf = Array.prototype.indexOf;

jQuery.fn = jQuery.prototype = {
Expand Down Expand Up @@ -569,11 +570,11 @@ jQuery.extend({
},

// Use native String.trim function wherever possible
trim: String.trim ?
trim: trim ?
function( text ) {
return text == null ?
"" :
String.trim( text );
trim.call( text );
} :

// Otherwise use our own trimming functionality
Expand Down

0 comments on commit ba8938d

Please sign in to comment.