aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2020-05-18 23:20:38 +0200
committerGitHub <noreply@github.com>2020-05-18 23:20:38 +0200
commit0b676ae12d20721e2df6f6f32f37f7302f8805bf (patch)
treeb48eac8b7f4fe78d41c04e8ca157206d9bf37b17
parentbfb6897c558dfdccff7ac5fc377b08e806525be3 (diff)
downloadjquery-0b676ae12d20721e2df6f6f32f37f7302f8805bf.tar.gz
jquery-0b676ae12d20721e2df6f6f32f37f7302f8805bf.zip
Deprecated: Remove jQuery.trim
The API has been deprecated in 3.5.0 so it can be removed in 4.0.0. Ref gh-4461 Closes gh-4695
-rw-r--r--src/deprecated.js5
-rw-r--r--src/var/trim.js1
-rw-r--r--test/unit/deprecated.js22
3 files changed, 0 insertions, 28 deletions
diff --git a/src/deprecated.js b/src/deprecated.js
index be1997321..e58156f9e 100644
--- a/src/deprecated.js
+++ b/src/deprecated.js
@@ -1,6 +1,5 @@
import jQuery from "./core.js";
import slice from "./var/slice.js";
-import trim from "./var/trim.js";
import "./deprecated/ajax-event-alias.js";
import "./deprecated/event.js";
@@ -43,7 +42,3 @@ jQuery.holdReady = function( hold ) {
jQuery.ready( true );
}
};
-
-jQuery.trim = function( text ) {
- return text == null ? "" : trim.call( text );
-};
diff --git a/src/var/trim.js b/src/var/trim.js
deleted file mode 100644
index 77d925fb0..000000000
--- a/src/var/trim.js
+++ /dev/null
@@ -1 +0,0 @@
-export default "".trim;
diff --git a/test/unit/deprecated.js b/test/unit/deprecated.js
index 029b163e5..d6a15cd7e 100644
--- a/test/unit/deprecated.js
+++ b/test/unit/deprecated.js
@@ -199,25 +199,3 @@ QUnit[ jQuery.proxy ? "test" : "skip" ]( "jQuery.proxy", function( assert ) {
cb = jQuery.proxy( fn, null, "arg1", "arg2" );
cb.call( thisObject, "arg3" );
} );
-
-QUnit[ jQuery.trim ? "test" : "skip" ]( "trim", function( assert ) {
- assert.expect( 13 );
-
- var nbsp = String.fromCharCode( 160 );
-
- assert.equal( jQuery.trim( "hello " ), "hello", "trailing space" );
- assert.equal( jQuery.trim( " hello" ), "hello", "leading space" );
- assert.equal( jQuery.trim( " hello " ), "hello", "space on both sides" );
- assert.equal( jQuery.trim( " " + nbsp + "hello " + nbsp + " " ), "hello", "&nbsp;" );
-
- assert.equal( jQuery.trim(), "", "Nothing in." );
- assert.equal( jQuery.trim( undefined ), "", "Undefined" );
- assert.equal( jQuery.trim( null ), "", "Null" );
- assert.equal( jQuery.trim( 5 ), "5", "Number" );
- assert.equal( jQuery.trim( false ), "false", "Boolean" );
-
- assert.equal( jQuery.trim( " " ), "", "space should be trimmed" );
- assert.equal( jQuery.trim( "ipad\xA0" ), "ipad", "nbsp should be trimmed" );
- assert.equal( jQuery.trim( "\uFEFF" ), "", "zwsp should be trimmed" );
- assert.equal( jQuery.trim( "\uFEFF \xA0! | \uFEFF" ), "! |", "leading/trailing should be trimmed" );
-} );