aboutsummaryrefslogtreecommitdiffstats
path: root/src/selector.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-07-19 13:21:51 +0000
committerJohn Resig <jeresig@gmail.com>2009-07-19 13:21:51 +0000
commit0d5c3a68a092401089c9242bdafdb1b2534feb6a (patch)
tree0b52439fb625115252239bbbf66cfc39d0fae9ae /src/selector.js
parenta3b8ac413f9c55994922c20b39223ab9ae6d1afa (diff)
downloadjquery-0d5c3a68a092401089c9242bdafdb1b2534feb6a.tar.gz
jquery-0d5c3a68a092401089c9242bdafdb1b2534feb6a.zip
Standardizing on .test() and .exec() - moving away from using .match() for RegExp. Fixes jQuery bug #4113.
Diffstat (limited to 'src/selector.js')
-rw-r--r--src/selector.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/selector.js b/src/selector.js
index 1f3ceb5c1..a7d94c39d 100644
--- a/src/selector.js
+++ b/src/selector.js
@@ -332,7 +332,7 @@ var Expr = Sizzle.selectors = {
"": function(checkSet, part, isXML){
var doneName = done++, checkFn = dirCheck;
- if ( !part.match(/\W/) ) {
+ if ( !/\W/.test(part) ) {
var nodeCheck = part = isXML ? part : part.toUpperCase();
checkFn = dirNodeCheck;
}
@@ -342,7 +342,7 @@ var Expr = Sizzle.selectors = {
"~": function(checkSet, part, isXML){
var doneName = done++, checkFn = dirCheck;
- if ( typeof part === "string" && !part.match(/\W/) ) {
+ if ( typeof part === "string" && !/\W/.test(part) ) {
var nodeCheck = part = isXML ? part : part.toUpperCase();
checkFn = dirNodeCheck;
}
@@ -435,7 +435,7 @@ var Expr = Sizzle.selectors = {
PSEUDO: function(match, curLoop, inplace, result, not){
if ( match[1] === "not" ) {
// If we're dealing with a complex expression, or a simple one
- if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) {
+ if ( chunker.exec(match[3]).length > 1 || /^\w/.test(match[3]) ) {
match[3] = Sizzle(match[3], null, null, curLoop);
} else {
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);