[gjs: 19/43] CI: Add no-extra-bind to eslint rules



commit 0ed1c79f8aca238fe97b84dcd377e34400eef3b2
Author: Philip Chimento <philip chimento gmail com>
Date:   Sat Aug 3 21:58:54 2019 -0700

    CI: Add no-extra-bind to eslint rules
    
    An unnecessary Function.bind() call is bad for performance, so we should
    warn if the binding is not necessary.

 .eslintrc.yml                             | 1 +
 installed-tests/js/testEverythingBasic.js | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/.eslintrc.yml b/.eslintrc.yml
index 9e5b5d1c..08482876 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -69,6 +69,7 @@ rules:
   no-empty:
     - error
     - allowEmptyCatch: true
+  no-extra-bind: error
   no-implicit-coercion:
     - error
     - allow:
diff --git a/installed-tests/js/testEverythingBasic.js b/installed-tests/js/testEverythingBasic.js
index 76c3397c..c61f13f1 100644
--- a/installed-tests/js/testEverythingBasic.js
+++ b/installed-tests/js/testEverythingBasic.js
@@ -247,7 +247,7 @@ describe('Life, the Universe and Everything', function () {
         spyOn(testObj, 'test').and.callThrough();
         expect(Regress.test_callback_destroy_notify(function () {
             return testObj.test(42);
-        }.bind(testObj))).toEqual(42);
+        })).toEqual(42);
         expect(testObj.test).toHaveBeenCalledTimes(1);
         expect(Regress.test_callback_thaw_notifications()).toEqual(42);
     });


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