diff options
author | Michał Gołębiowski <m.goleb@gmail.com> | 2014-03-04 23:15:12 +0100 |
---|---|---|
committer | Michał Gołębiowski <m.goleb@gmail.com> | 2014-03-04 23:15:30 +0100 |
commit | a9fa2ec76361abf4b2623879cf7932c488293f60 (patch) | |
tree | 7bff30dd4a2c426290ad050e5df96308bc61ab2f | |
parent | b96522acfe2808e5fc3397a620db8845f6987680 (diff) | |
download | jquery-a9fa2ec76361abf4b2623879cf7932c488293f60.tar.gz jquery-a9fa2ec76361abf4b2623879cf7932c488293f60.zip |
Core: Remove native String#trim usage to save size
(cherry-picked from 279913c71b63da721fa2f118cdce150effbf773e)
Fixes #14794
-rw-r--r-- | src/core.js | 22 | ||||
-rw-r--r-- | src/var/trim.js | 3 |
2 files changed, 6 insertions, 19 deletions
diff --git a/src/core.js b/src/core.js index b07463ca1..f446ec304 100644 --- a/src/core.js +++ b/src/core.js @@ -7,9 +7,8 @@ define([ "./var/class2type", "./var/toString", "./var/hasOwn", - "./var/trim", "./var/support" -], function( deletedIds, slice, concat, push, indexOf, class2type, toString, hasOwn, trim, support ) { +], function( deletedIds, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) { var version = "@VERSION", @@ -349,20 +348,11 @@ jQuery.extend({ }, // Support: Android<4.1, IE<9 - // Use native String.trim function wherever possible - 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 ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, // results is for internal usage only makeArray: function( arr, results ) { diff --git a/src/var/trim.js b/src/var/trim.js deleted file mode 100644 index 18f835658..000000000 --- a/src/var/trim.js +++ /dev/null @@ -1,3 +0,0 @@ -define(function() { - return "".trim; -}); |