Skip to content
Permalink
Browse files

2.0: Remove trim shim

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
  • Loading branch information
rwaldron committed Dec 17, 2012
1 parent eb5df5e commit 25d933909b7ff2e1bdb330667c81e50a5eef5505
Showing with 3 additions and 17 deletions.
  1. +3 −17 src/core.js
@@ -44,9 +44,6 @@ var
// Used for splitting on whitespace
core_rnotwhite = /\S+/g,

// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,

// A simple way to check for HTML strings
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
// Strict HTML recognition (#11290: must start with <)
@@ -627,20 +624,9 @@ jQuery.extend({
return obj;
},

// Use native String.trim function wherever possible
trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
function( text ) {
return text == null ?
"" :
core_trim.call( text );
} :

// Otherwise use our own trimming functionality
function( text ) {
return text == null ?
"" :
( text + "" ).replace( rtrim, "" );
},
trim: function( text ) {
return text == null ? "" : core_trim.call( text );
},

// results is for internal usage only
makeArray: function( arr, results ) {

0 comments on commit 25d9339

Please sign in to comment.
You can’t perform that action at this time.