aboutsummaryrefslogtreecommitdiffstats
path: root/npm_assets/node_modules/jquery/src/deprecated.js
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2024-04-23 00:37:58 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2024-04-23 00:37:58 -0400
commit9b0e86a8e74768c4fe848fb5ce8d754292db4e3e (patch)
treecfd424be8ecb68357e6e572033f08bc534bf724f /npm_assets/node_modules/jquery/src/deprecated.js
parent393aa58f2c5afd51f92fd9bd4b6dfd0dc90cea41 (diff)
New upstream version 8.3.0.upstream/8.3.0upstream
Diffstat (limited to 'npm_assets/node_modules/jquery/src/deprecated.js')
-rw-r--r--npm_assets/node_modules/jquery/src/deprecated.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/npm_assets/node_modules/jquery/src/deprecated.js b/npm_assets/node_modules/jquery/src/deprecated.js
index cc13c3c..ca54982 100644
--- a/npm_assets/node_modules/jquery/src/deprecated.js
+++ b/npm_assets/node_modules/jquery/src/deprecated.js
@@ -15,7 +15,9 @@ define( [
// Support: Android <=4.0 only
// Make sure we trim BOM and NBSP
-var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
+// Require that the "whitespace run" starts from a non-whitespace
+// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
+var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
// Bind a function to a context, optionally partially applying any
// arguments.
@@ -82,6 +84,6 @@ jQuery.isNumeric = function( obj ) {
jQuery.trim = function( text ) {
return text == null ?
"" :
- ( text + "" ).replace( rtrim, "" );
+ ( text + "" ).replace( rtrim, "$1" );
};
} );