[gnome-shell] scripting: Disable an eslint warning



commit e585f7d97bb2fdb54656fd894297578e2a0c94d1
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Aug 20 02:36:36 2019 +0200

    scripting: Disable an eslint warning
    
    Calling await in a loop means the asynchronous operations are
    run sequentially instead of in-parallel. Usually that's not
    what's wanted, so eslint has a rule to warn about this.
    
    However here we use async/await to handle control back to the
    mainloop between steps, so running operations sequentially is
    actually intended.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/731

 js/ui/scripting.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/js/ui/scripting.js b/js/ui/scripting.js
index 7a14fcf551..84c1ad183e 100644
--- a/js/ui/scripting.js
+++ b/js/ui/scripting.js
@@ -317,7 +317,7 @@ async function runPerfScript(scriptModule, outputFile) {
 
     for (let step of scriptModule.run()) {
         try {
-            await step;
+            await step; // eslint-disable-line no-await-in-loop
         } catch (err) {
             log(`Script failed: ${err}\n${err.stack}`);
             Meta.exit(Meta.ExitCode.ERROR);


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