Open VincentWuShiChao opened 3 years ago
Sorry for the late response to this -- this is a great observation. While Jexl's goal isn't to mirror Javascript, I think this is a great move for predictability. It is a breaking change, though, so this will come in the next major version release.
The priority of the current module is && and | | is the same,The result of ' 'true && true || false && false'' is false.But in JavaScript, '&&' than '| |' priority,so The result of ' 'true && true || false && false'' is true.
My solution so far is to rewrite the priorities。The following: jexl.addBinaryOp('&&', 11, (left, right) => { return left && right; });