Open aminomancer opened 1 month ago
We learned that the operators don't short-circuit in mozjexl. It can be tested in about:asrouter by setting browserSettings
to null
in the Targeting page (you can edit each field individually), then scrolling up to the JEXL evaluator and running:
true || browserSettings.foo
^ This will throw instead of returning true
.
browserSettings && browserSettings.something
^ This will throw instead of returning null
.
However, accessing properties of some random undefined attribute will not throw, so it seems to be handled differently:
true || nonExistentAttribute.foo
We think TomFrost/Jexl@ab2233a might be portable to mozjexl.
Blocked by bug 1778535, which is blocked by #33.
This is also tracked on bugzilla bug 1921638.
There are more details here. We're having issues with the following targeting expression:
Ignoring the release channel check, it basically has the pattern
stickyClause || mainTargeting
. So the sticky clause should be preventing evaluation of all the other stuff. But it seems not to, because the later clausedefaultPDFHandler.registered && !defaultPDFHandler.knownBrowser
throws a TypeError (bug 1920698). From Beth:So we think the first step in debugging why the sticky clause isn't working here would be to work with Beth on adding logging to mozjexl.