8000 Selector: Make `selector.js` module depend on `attributes/attr.js` · jquery/jquery@01fa7eb · GitHub
[go: up one dir, main page]

Skip to content

Commit 01fa7eb

Browse files
committed
Selector: Make selector.js module depend on attributes/attr.js
This fixes custom builds using the `--include` switch that don't include the `attributes` module. Fixes gh-5379
1 parent e8b7db4 commit 01fa7eb

File tree

5 files changed

+4
-7
lines changed

5 files changed

+4
-7
lines changed

src/attributes/attr.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { access } from "../core/access.js";
33
import { nodeName } from "../core/nodeName.js";
44
import { rnothtmlwhite } from "../var/rnothtmlwhite.js";
55
import { isIE } from "../var/isIE.js";
6+
import { rbooleans } from "./var/rbooleans.js";
67

78
jQuery.fn.extend( {
89
attr: function( name, value ) {
@@ -97,7 +98,7 @@ if ( isIE ) {
9798
};
9899
}
99100

100-
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
101+
jQuery.each( rbooleans.source.match( /\w+/g ), function( _i, name ) {
101102
jQuery.attrHooks[ name ] = {
102103
get: function( elem ) {
103104
var ret,

src/attributes/var/rbooleans.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export var rbooleans = /^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i;

src/selector-native.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import { jQuery } from "./core.js";
2525
import { document } from "./var/document.js";
2626
import { whitespace } from "./var/whitespace.js";
2727
import { isIE } from "./var/isIE.js";
28-
import { booleans } from "./selector/var/booleans.js";
2928
import { rleadingCombinator } from "./selector/var/rleadingCombinator.js";
3029
import { rdescend } from "./selector/var/rdescend.js";
3130
import { rsibling } from "./selector/var/rsibling.js";
@@ -41,7 +40,6 @@ import "./selector/escapeSelector.js";
4140
import "./selector/uniqueSort.js";
4241

4342
var matchExpr = jQuery.extend( {
44-
bool: new RegExp( "^(?:" + booleans + ")$", "i" ),
4543
needsContext: new RegExp( "^" + whitespace + "*[>+~]" )
4644
}, filterMatchExpr );
4745

src/selector.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { rbuggyQSA } from "./selector/rbuggyQSA.js";
99
import { rtrimCSS } from "./var/rtrimCSS.js";
1010
import { isIE } from "./var/isIE.js";
1111
import { identifier } from "./selector/var/identifier.js";
12-
import { booleans } from "./selector/var/booleans.js";
1312
import { rleadingCombinator } from "./selector/var/rleadingCombinator.js";
1413
import { rdescend } from "./selector/var/rdescend.js";
1514
import { rsibling } from "./selector/var/rsibling.js";
@@ -24,6 +23,7 @@ import { tokenize } from "./selector/tokenize.js";
2423
import { toSelector } from "./selector/toSelector.js";
2524

2625
// The following utils are attached directly to the jQuery object.
26+
import "./attributes/attr.js";
2727
import "./selector/escapeSelector.js";
2828
import "./selector/uniqueSort.js";
2929

@@ -50,7 +50,6 @@ var i,
5050
ridentifier = new RegExp( "^" + identifier + "$" ),
5151

5252
matchExpr = jQuery.extend( {
53-
bool: new RegExp( "^(?:" + booleans + ")$", "i" ),
5453

5554
// For use in libraries implementing .is()
5655
// We use this for POS matching in `select`

src/selector/var/booleans.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0