Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
6a3d1a1e
Commit
6a3d1a1e
authored
Dec 31, 2008
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed an issue with .not("#foo, bar") not working correctly, closes #3757.
parent
c7a14f13
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
core.js
src/core.js
+1
-1
core.js
test/unit/core.js
+5
-1
No files found.
src/core.js
View file @
6a3d1a1e
...
@@ -24,7 +24,7 @@ var jQuery = window.jQuery = window.$ = function( selector, context ) {
...
@@ -24,7 +24,7 @@ var jQuery = window.jQuery = window.$ = function( selector, context ) {
var
quickExpr
=
/^
[^
<
]
*
(
<
(
.|
\s)
+>
)[^
>
]
*$|^#
([\w
-
]
+
)
$/
,
var
quickExpr
=
/^
[^
<
]
*
(
<
(
.|
\s)
+>
)[^
>
]
*$|^#
([\w
-
]
+
)
$/
,
// Is it a simple selector
// Is it a simple selector
isSimple
=
/^.
[^
:#
\[\.]
*$/
,
isSimple
=
/^.
[^
:#
\[\.
,
]
*$/
,
// Will speed up references to undefined, and allows munging its name.
// Will speed up references to undefined, and allows munging its name.
undefined
;
undefined
;
...
...
test/unit/core.js
View file @
6a3d1a1e
...
@@ -1345,7 +1345,7 @@ test("closest()", function() {
...
@@ -1345,7 +1345,7 @@ test("closest()", function() {
});
});
test
(
"not()"
,
function
()
{
test
(
"not()"
,
function
()
{
expect
(
8
);
expect
(
11
);
equals
(
jQuery
(
"#main > p#ap > a"
).
not
(
"#google"
).
length
,
2
,
"not('selector')"
);
equals
(
jQuery
(
"#main > p#ap > a"
).
not
(
"#google"
).
length
,
2
,
"not('selector')"
);
equals
(
jQuery
(
"#main > p#ap > a"
).
not
(
document
.
getElementById
(
"google"
)).
length
,
2
,
"not(DOMElement)"
);
equals
(
jQuery
(
"#main > p#ap > a"
).
not
(
document
.
getElementById
(
"google"
)).
length
,
2
,
"not(DOMElement)"
);
isSet
(
jQuery
(
"p"
).
not
(
".result"
).
get
(),
q
(
"firstp"
,
"ap"
,
"sndp"
,
"en"
,
"sap"
,
"first"
),
"not('.class')"
);
isSet
(
jQuery
(
"p"
).
not
(
".result"
).
get
(),
q
(
"firstp"
,
"ap"
,
"sndp"
,
"en"
,
"sap"
,
"first"
),
"not('.class')"
);
...
@@ -1356,6 +1356,10 @@ test("not()", function() {
...
@@ -1356,6 +1356,10 @@ test("not()", function() {
var
selects
=
jQuery
(
"#form select"
);
var
selects
=
jQuery
(
"#form select"
);
isSet
(
selects
.
not
(
selects
[
1
]
),
q
(
"select1"
,
"select3"
),
"filter out DOM element"
);
isSet
(
selects
.
not
(
selects
[
1
]
),
q
(
"select1"
,
"select3"
),
"filter out DOM element"
);
isSet
(
jQuery
(
'#ap *'
).
not
(
'code'
),
q
(
"google"
,
"groups"
,
"anchor1"
,
"mark"
),
"not('tag selector')"
);
isSet
(
jQuery
(
'#ap *'
).
not
(
'code, #mark'
),
q
(
"google"
,
"groups"
,
"anchor1"
),
"not('tag, ID selector')"
);
isSet
(
jQuery
(
'#ap *'
).
not
(
'#mark, code'
),
q
(
"google"
,
"groups"
,
"anchor1"
),
"not('ID, tag selector')"
);
});
});
test
(
"andSelf()"
,
function
()
{
test
(
"andSelf()"
,
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment