Ticket #1661 (closed defect: fixed)
JS Style Guide examples don't follow rules - if(foo) vs. if (foo)
| Reported by: | skinner | Owned by: | pottedmeat |
|---|---|---|---|
| Priority: | lowest | Milestone: | 0.9 |
| Component: | Doc parser | Version: | 0.3 |
| Severity: | trivial | Keywords: | |
| Cc: |
Description
On the Dojo coding style guide web page, the example code doesn't follow all the layout rules listed on the page:
In the "Layout" section, under "Whitespace", it says:
2. Reserved words SHOULD be followed by a space.
But in most of the example code in the "Layout" section, the reserved words are not followed by a space. For instance, the first example in the "Layout" section reads:
while(!isDone){
doSomething();
isDone = moreToDo();
}
rather than:
while (!isDone){
doSomething();
isDone = moreToDo();
}
Oddly, some of the example do include occassional spaces after reserved words:
do{
statements;
}while (condition);
switch (condition){
try{
statements;
}catch (ex){
Seems like we should either change the example code or change the rule.
Change History
Note: See
TracTickets for help on using
tickets.