Hi all,

I'd like to propose we change the SpiderMonkey coding style to always brace
if/for/while statements.

It matches Gecko's coding style and in the past there has been agreement to
unify our coding styles as much as possible. Adding unnecessary braces
often results in style nits when Gecko hackers write SpiderMonkey patches
(or similarly, missing braces in Gecko code). The situation is worse in
XPConnect where both styles are used. Also, when to use {} can be pretty
confusing for people new to SpiderMonkey.

The downside is that it's more verbose, especially for a file like
BytecodeEmitter.cpp that has tons of unbraced if-statements (it will add
about 900-1000 lines to that file).

The conversion is pretty easy to automate - while waiting for feedback and
Try results today I wrote a simple script to do this, here's the diff for
BytecodeEmitter.cpp: https://dpaste.de/HKvM -- I still have to review the
changes more closely (and probably compare the generated object files) but
overall it looks reasonable.

Thoughts?

Thanks,
Jan
_______________________________________________
dev-tech-js-engine-internals mailing list
dev-tech-js-engine-internals@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to