Commit 25d93390 authored by Rick Waldron's avatar Rick Waldron

2.0: Remove trim shim

Signed-off-by: 's avatarRick Waldron <waldron.rick@gmail.com>
parent eb5df5e1
...@@ -44,9 +44,6 @@ var ...@@ -44,9 +44,6 @@ var
// Used for splitting on whitespace // Used for splitting on whitespace
core_rnotwhite = /\S+/g, 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 // A simple way to check for HTML strings
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
// Strict HTML recognition (#11290: must start with <) // Strict HTML recognition (#11290: must start with <)
...@@ -627,19 +624,8 @@ jQuery.extend({ ...@@ -627,19 +624,8 @@ jQuery.extend({
return obj; return obj;
}, },
// Use native String.trim function wherever possible trim: function( text ) {
trim: core_trim && !core_trim.call("\uFEFF\xA0") ? return text == null ? "" : core_trim.call( text );
function( text ) {
return text == null ?
"" :
core_trim.call( text );
} :
// Otherwise use our own trimming functionality
function( text ) {
return text == null ?
"" :
( text + "" ).replace( rtrim, "" );
}, },
// results is for internal usage only // results is for internal usage only
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment