[gnome-shell] docs: Conform to coding style in HACKING guide



commit 45fe925a1b013de14c132b4bdbccfd8674628575
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Nov 25 20:17:38 2019 +0100

    docs: Conform to coding style in HACKING guide
    
    The document is supposed to outline our best practices on the
    javascript side, so make sure the code snippets actually conform
    to the enforced style.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/919

 HACKING.md | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/HACKING.md b/HACKING.md
index d1e23e03fa..be26c85084 100644
--- a/HACKING.md
+++ b/HACKING.md
@@ -29,9 +29,8 @@ what to do.
             bar = do_thing(b);
 
         if (var == 5) {
-            for (let i = 0; i < 10; i++) {
+            for (let i = 0; i < 10; i++)
                 print(i);
-            }
         } else {
             print(20);
         }
@@ -102,9 +101,8 @@ under the imports:
 Always use either `const` or `let` when defining a variable.
 ```javascript
     // Iterating over an array
-    for (let i = 0; i < arr.length; ++i) {
+    for (let i = 0; i < arr.length; ++i)
         let item = arr[i];
-    }
 
     // Iterating over an object's properties
     for (let prop in someobj) {
@@ -252,7 +250,7 @@ variable that can be captured in closures.
 All closures should be wrapped with Function.prototype.bind or use arrow
 notation.
 ```javascript
-    let closure1 = () => { this._fnorbate(); };
+    let closure1 = () => this._fnorbate();
     let closure2 = this._fnorbate.bind(this);
 ```
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]