mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Core: Remove native String#trim usage to save size
(cherry-picked from 279913c71b
)
Fixes #14794
This commit is contained in:
parent
b96522acfe
commit
a9fa2ec763
14
src/core.js
14
src/core.js
@ -7,9 +7,8 @@ define([
|
|||||||
"./var/class2type",
|
"./var/class2type",
|
||||||
"./var/toString",
|
"./var/toString",
|
||||||
"./var/hasOwn",
|
"./var/hasOwn",
|
||||||
"./var/trim",
|
|
||||||
"./var/support"
|
"./var/support"
|
||||||
], function( deletedIds, slice, concat, push, indexOf, class2type, toString, hasOwn, trim, support ) {
|
], function( deletedIds, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) {
|
||||||
|
|
||||||
var
|
var
|
||||||
version = "@VERSION",
|
version = "@VERSION",
|
||||||
@ -349,16 +348,7 @@ jQuery.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Support: Android<4.1, IE<9
|
// Support: Android<4.1, IE<9
|
||||||
// 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, "" );
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
define(function() {
|
|
||||||
return "".trim;
|
|
||||||
});
|
|
Loading…
Reference in New Issue
Block a user