FirebaseExtended / bolt

Bolt Compiler (Firebase Security and Modeling)
Apache License 2.0
896 stars 108 forks source link

Enclose Logical Expressions with Parentheses #233

Closed alixaxel closed 5 years ago

alixaxel commented 5 years ago

This PR fixes #232 and #230.

For cases where an expression operator is && or ||, it surrounds the whole expression with (...), respecting left association. The top-most parentheses is unnecessary but I couldn't figure out how to skip it.

alixaxel commented 5 years ago

@rockwotj I've updated the docs to describe the new output (some of it was already outdated, namely Null checks) and I've moved the condition to the the expOp.args.length === 2 scope (I had originally done this, but ended up moving it further down to cover any unforeseen scenario).

alixaxel commented 5 years ago

@rockwotj Any update on this? :) I have a +6k LOC generated rules file that needs this fix to be deployed.

rockwotj commented 5 years ago

Thanks for the ping, this slipped. This has been released as v0.8.4.

https://github.com/firebase/bolt/releases/tag/v0.8.4