From 279913c71b63da721fa2f118cdce150effbf773e Mon Sep 17 00:00:00 2001 From: Michał Gołębiowski Date: Tue, 4 Mar 2014 23:08:35 +0100 Subject: Core: Remove native String#trim usage to save size Fixes #14794 --- src/core.js | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/core.js') 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 ) { -- cgit v1.2.3