aboutsummaryrefslogtreecommitdiffstats
path: root/src/var/rtrimCSS.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2023-09-20 02:31:35 +0200
committerGitHub <noreply@github.com>2023-09-20 02:31:35 +0200
commit53cf7244da2a2040333335c36e435b1c12efdff9 (patch)
tree5331bd464dcc51d7ff1b923ccd5868a733c18234 /src/var/rtrimCSS.js
parent5f869590924b7dea6a16d176b18700939f4b5290 (diff)
downloadjquery-53cf7244da2a2040333335c36e435b1c12efdff9.tar.gz
jquery-53cf7244da2a2040333335c36e435b1c12efdff9.zip
CSS:Selector: Align with 3.x, remove the outer `selector.js` wrapper
Bring some changes from `3.x-stable`: * rename `rtrim` to `rtrimCSS` to distinguish from the previous `rtrim` regex used for `jQuery.trim` * backport one `id` selector test that avoids the selector engine path Other changes: * remove the inner function wrapper from `selector.js` by renaming the imported `document.js` value * use `jQuery.error` in `selectorError` * make Selector tests pass in all-modules runs by fixing a sinon mistake in Core tests - Core tests had a spy set up for `jQuery.error` that wasn't cleaned up, influencing Selector tests when all were run together Closes gh-5295
Diffstat (limited to 'src/var/rtrimCSS.js')
-rw-r--r--src/var/rtrimCSS.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/var/rtrimCSS.js b/src/var/rtrimCSS.js
new file mode 100644
index 000000000..f35b8a1e9
--- /dev/null
+++ b/src/var/rtrimCSS.js
@@ -0,0 +1,6 @@
+import { whitespace } from "./whitespace.js";
+
+export var rtrimCSS = new RegExp(
+ "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
+ "g"
+);