tor-browser

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

reject-mixing-eager-and-lazy.rst (698B)


      1 reject-mixing-eager-and-lazy
      2 ==================================
      3 
      4 Rejects defining a lazy getter for a module that's eagerly imported at
      5 top-level script unconditionally.
      6 
      7 Examples of incorrect code for this rule:
      8 -----------------------------------------
      9 
     10 .. code-block:: js
     11 
     12    const { SomeProp } =
     13      ChromeUtils.importESModule("resource://gre/modules/Foo.sys.mjs");
     14    ChromeUtils.defineESModuleGetters(lazy, {
     15      OtherProp: "resource://gre/modules/Foo.sys.mjs",
     16    });
     17 
     18 Examples of correct code for this rule:
     19 ---------------------------------------
     20 
     21 .. code-block:: js
     22 
     23    const { SomeProp, OtherProp } = ChromeUtils.importESModule(
     24      "resource://gre/modules/Foo.sys.mjs"
     25    );