From ba8938d444b9a49bdfb27213826ba108145c2e50 Mon Sep 17 00:00:00 2001 From: jeresig Date: Thu, 11 Mar 2010 10:49:19 -0500 Subject: [PATCH] Switch to using String.prototype.trim from String.trim as it's more-widely available. --- src/core.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core.js b/src/core.js index 3f156a5fd..699b87ac9 100644 --- a/src/core.js +++ b/src/core.js @@ -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 = { @@ -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 -- 2.39.5