X Tutup
Skip to content

Commit 279913c

Browse files
committed
Core: Remove native String#trim usage to save size
Fixes #14794
1 parent a359961 commit 279913c

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

src/core.js

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ define([
77
"./var/class2type",
88
"./var/toString",
99
"./var/hasOwn",
10-
"./var/trim",
1110
"./var/support"
12-
], function( arr, slice, concat, push, indexOf, class2type, toString, hasOwn, trim, support ) {
11+
], function( arr, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) {
1312

1413
var
1514
// Use the correct document accordingly with window argument (sandbox)
@@ -341,20 +340,11 @@ jQuery.extend({
341340
},
342341

343342
// Support: Android<4.1
344-
// Use native String.trim function wherever possible
345-
trim: trim && !trim.call("\uFEFF\xA0") ?
346-
function( text ) {
347-
return text == null ?
348-
"" :
349-
trim.call( text );
350-
} :
351-
352-
// Otherwise use our own trimming functionality
353-
function( text ) {
354-
return text == null ?
355-
"" :
356-
( text + "" ).replace( rtrim, "" );
357-
},
343+
trim: function( text ) {
344+
return text == null ?
345+
"" :
346+
( text + "" ).replace( rtrim, "" );
347+
},
358348

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

src/var/trim.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)
X Tutup