Core: Remove native String#trim usage to save size

Fixes #14794
parent a3599614
...@@ -7,9 +7,8 @@ define([ ...@@ -7,9 +7,8 @@ define([
"./var/class2type", "./var/class2type",
"./var/toString", "./var/toString",
"./var/hasOwn", "./var/hasOwn",
"./var/trim",
"./var/support" "./var/support"
], function( arr, slice, concat, push, indexOf, class2type, toString, hasOwn, trim, support ) { ], function( arr, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) {
var var
// Use the correct document accordingly with window argument (sandbox) // Use the correct document accordingly with window argument (sandbox)
...@@ -341,16 +340,7 @@ jQuery.extend({ ...@@ -341,16 +340,7 @@ jQuery.extend({
}, },
// Support: Android<4.1 // Support: Android<4.1
// Use native String.trim function wherever possible trim: function( text ) {
trim: trim && !trim.call("\uFEFF\xA0") ?
function( text ) {
return text == null ?
"" :
trim.call( text );
} :
// Otherwise use our own trimming functionality
function( text ) {
return text == null ? return text == null ?
"" : "" :
( text + "" ).replace( rtrim, "" ); ( text + "" ).replace( rtrim, "" );
......
define(function() {
return "".trim;
});
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