tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

no-useless-parameters.rst (800B)


      1 no-useless-parameters
      2 =====================
      3 
      4 Reject common XPCOM methods called with useless optional parameters (eg.
      5 ``Services.io.newURI(url, null, null)``, or non-existent parameters (eg.
      6 ``Services.obs.removeObserver(name, observer, false)``).
      7 
      8 This option can be autofixed (``--fix``).
      9 
     10 Examples of incorrect code for this rule:
     11 -----------------------------------------
     12 
     13 .. code-block:: js
     14 
     15    elt.addEventListener('click', handler, false);
     16    Services.io.newURI('http://example.com', null, null);
     17    Services.obs.notifyObservers(obj, 'topic', null);
     18 
     19 Examples of correct code for this rule:
     20 ---------------------------------------
     21 
     22 .. code-block:: js
     23 
     24    elt.addEventListener('click', handler);
     25    Services.io.newURI('http://example.com');
     26    Services.obs.notifyObservers(obj, 'topic');