Fix `:matches-prop()` operator when no value provided

This commit is contained in:
Raymond Hill 2024-06-20 09:21:43 -04:00
parent aaceabeba1
commit 47b985a056
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 5 additions and 1 deletions

View File

@ -188,7 +188,11 @@ class PSelectorMatchesPropTask extends PSelectorTask {
if ( value === null ) { return; }
value = value[prop];
}
if ( this.reValue !== null && this.reValue.test(value) === false ) { return; }
if ( this.reValue === null ) {
if ( value === undefined ) { return; }
} else if ( this.reValue.test(value) === false ) {
return;
}
output.push(node);
}
}