summaryrefslogtreecommitdiffstats
path: root/docs/UXP Coding Style.md
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-04-26 12:56:46 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-26 12:56:46 +0200
commit98fe8b0ccbea37c2681ad8c788baa91554871f4d (patch)
tree0e269a27661fea619ab07a533e0c1fa195c3c671 /docs/UXP Coding Style.md
parente08a4ad1c8096fc8de64fac4f36cf0c569cb4420 (diff)
parent519030e688dd7075a7cd9f14dd6fb9e210b5a689 (diff)
downloadUXP-98fe8b0ccbea37c2681ad8c788baa91554871f4d.tar
UXP-98fe8b0ccbea37c2681ad8c788baa91554871f4d.tar.gz
UXP-98fe8b0ccbea37c2681ad8c788baa91554871f4d.tar.lz
UXP-98fe8b0ccbea37c2681ad8c788baa91554871f4d.tar.xz
UXP-98fe8b0ccbea37c2681ad8c788baa91554871f4d.zip
Merge branch 'redwood' into 28.9-platformRELBASE_20200426
Diffstat (limited to 'docs/UXP Coding Style.md')
-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