-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:has(> child) is not supported #132
Comments
+1 for this — having a direct child combinator would allow for both reducing the scope, and improving the selector's performance, as quite often you'd want to check just the immediate child, without checking anything deeper. |
I am trying to match a function with specific name: function shouldNotMatch() {
function shouldMatch() {
}
} Without a direct child modifier working properly the outer function will match because it contains identifier with a specific name. Whereas it should not match, because this identifier belongs to the descendant. |
Is there any work around for this? |
@jggsus88 On the right, under "Development", it lists associated PRs. |
:has()
expressions do not work with a leading>
. This is included as the first example is the linked docs for:has
from the readme (https://drafts.csswg.org/selectors-4/Overview.bs#relational).I am trying to match the following code, specifically any call to
router.push(router.resolve(...))
.This means that I need to check both descent paths of the CallExpression. I would like to match the call expression containing both of these children:
CallExpression > MemberExpression.callee[object.name=router][property.name=push]
andCallExpression > CallExpression.arguments > MemberExpression.callee[object.name=router][property.name=resolve]
Ideally this could be achieved by
If the leading
>
inside the:has()
are omitted, this selector is too broad, also matching for examplerouter.push(otherFunction(router.resolve({}))
.The text was updated successfully, but these errors were encountered: