esquery icon indicating copy to clipboard operation
esquery copied to clipboard

No way to compare fields?

Open aczekajski opened this issue 4 weeks ago • 2 comments

Either I don't know how to do it or it's not possible to do sth like this:

CallExpression[arguments.0.value!=arguments.1.value]

to catch cases like

foo('a', 'b');

(this is a minimal example and doesn't seem to make sense but believe me my full case does make sense 😅)

aczekajski avatar Dec 13 '25 06:12 aczekajski

How would you do something like this with a CSS selector?

michaelficarra avatar Dec 15 '25 16:12 michaelficarra

CSS selectors can't do it but ESTree is not CSS. Esquery just uses a syntax inspired by css selectors. Entire esquery parsing logic is written in here so there isn't any external dependency or requirement that makes it impossible.

RegExp as possible value for attribute selector also does not exist in CSS, yet it's a valid syntax here.

aczekajski avatar Dec 16 '25 10:12 aczekajski