aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2014-03-04 23:08:35 +0100
committerMichał Gołębiowski <m.goleb@gmail.com>2014-03-04 23:08:35 +0100
commit279913c71b63da721fa2f118cdce150effbf773e (patch)
treed94e59aac4dcf0e04ef947a93df369aac941b301 /src
parenta35996141e3c1de92e89ed77eac1799124e747d3 (diff)
downloadjquery-279913c71b63da721fa2f118cdce150effbf773e.tar.gz
jquery-279913c71b63da721fa2f118cdce150effbf773e.zip
Core: Remove native String#trim usage to save size
Fixes #14794
Diffstat (limited to 'src')
-rw-r--r--src/core.js22
-rw-r--r--src/var/trim.js3
2 files changed, 6 insertions, 19 deletions
diff --git a/src/core.js b/src/core.js
index 11c232765..311e360aa 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( arr, slice, concat, push, indexOf, class2type, toString, hasOwn, trim, support ) {
+], function( arr, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) {
var
// Use the correct document accordingly with window argument (sandbox)
@@ -341,20 +340,11 @@ jQuery.extend({
},
// Support: Android<4.1
- // 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;
-});