summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-04-17 16:32:28 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-24 10:26:16 +0200
commit79964767f552f4e327858487a6b1cf2579b6538b (patch)
tree968bc76168a17bb26757cf889d91e8acddec9cf4
parenta4a8d082a3c3c78f87a7a458dfa6e7f39134deb2 (diff)
downloadUXP-79964767f552f4e327858487a6b1cf2579b6538b.tar
UXP-79964767f552f4e327858487a6b1cf2579b6538b.tar.gz
UXP-79964767f552f4e327858487a6b1cf2579b6538b.tar.lz
UXP-79964767f552f4e327858487a6b1cf2579b6538b.tar.xz
UXP-79964767f552f4e327858487a6b1cf2579b6538b.zip
[docs] Update coding style cf. discussion with Tobin.
-rw-r--r--docs/UXP Coding Style.md14
1 files changed, 4 insertions, 10 deletions
diff --git a/docs/UXP Coding Style.md b/docs/UXP Coding Style.md
index 5dc4fd2a5..fc025584f 100644
--- a/docs/UXP Coding Style.md
+++ b/docs/UXP Coding Style.md
@@ -126,7 +126,7 @@ switch (variable) {
code_for_1;
code_for_1;
break;
- case value2:
+ case value2: // Comment describing 2 (alternative)
code_for_2;
code_for_2;
// fallthrough
@@ -273,7 +273,7 @@ Applies to `*.js` and `*.jsm`.
}
}, false);
```
-- Use a single space between `{` `}` braces in empty js objects.
+- Don't use a space between `{` `}` braces in empty js objects, `{` `}` braces in empty function scopes, or `[` `]` brackets in empty arrays.
### Flow control
Flow control expressions should follow the following guidelines:
@@ -343,7 +343,7 @@ switch (variable) {
code_for_1;
code_for_1;
break;
- case value2:
+ case value2: // Comment describing 2 (alternative)
code_for_2;
code_for_2;
// fallthrough
@@ -397,8 +397,7 @@ try {
try {
do_something();
-} catch(e) {
-}
+} catch(e) {}
try {
do_something();
@@ -414,11 +413,6 @@ try {
// No error processing
do_something_else();
}
-
-// No closing brace on its own line
-try {
- do_something();
-} catch(ex) { }
```
### Long line wrapping