Confirmed users
14,525
edits
(Created page with "== Mozmill Style Guide v0.1 == === Variables === ; Local variables * Use camelCase when naming local variables and functions. <pre> var someVariable = value; </pre> ; Constant...") |
No edit summary |
||
| Line 13: | Line 13: | ||
</pre> | </pre> | ||
; Unchanging Strings & Numbers | |||
* Any specific strings or numbers should be declared as constants | |||
* In other words, don't use bare strings or numbers in functional code | |||
<pre> | |||
const SOME_STRING = 'the string'; | |||
... | |||
controller.doSomething(SOME_STRING); | |||
</pre> | |||
=== Commenting === | === Commenting === | ||
| Line 49: | Line 57: | ||
</pre> | </pre> | ||
; Parameter Concatenation | |||
* If a parameter list is too long, it should be concatenated | |||
* The operator (+) should follow the line by a single space | |||
* The string sections should be aligned to the left | |||
<pre> | |||
var someVariable = controller.someFunction('some' + | |||
'concatenated' + | |||
'string'); | |||
</pre> | |||
== To be Added == | == To be Added == | ||
10. waitFor() block-style | 10. waitFor() block-style | ||
- controller.waitFor(function () { | - controller.waitFor(function () { | ||