diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/valid-lazy.rst | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/valid-lazy.rst')
-rw-r--r-- | docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/valid-lazy.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/valid-lazy.rst b/docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/valid-lazy.rst index a7edeeb5fc..e7f6706d5b 100644 --- a/docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/valid-lazy.rst +++ b/docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/valid-lazy.rst @@ -19,10 +19,10 @@ Examples of incorrect code for this rule: .. code-block:: js const lazy = {}; - ChromeUtils.defineLazyGetter(lazy, "foo", "foo.jsm"); + ChromeUtils.defineESModuleGetters(lazy, { foo: "foo.sys.mjs"}); // Duplicate symbol foo being added to lazy. - ChromeUtils.defineLazyGetter(lazy, "foo", "foo1.jsm"); + ChromeUtils.defineLazyGetter(lazy, "foo", () => {}); if (x) { lazy.foo3.bar(); } @@ -31,12 +31,12 @@ Examples of incorrect code for this rule: const lazy = {}; // Unused lazy property foo - ChromeUtils.defineLazyGetter(lazy, "foo", "foo.jsm"); + ChromeUtils.defineESModuleGetters(lazy, { foo: "foo.sys.mjs"}); .. code-block:: js const lazy = {}; - ChromeUtils.defineLazyGetter(lazy, "foo", "foo.jsm"); + ChromeUtils.defineESModuleGetters(lazy, { foo: "foo.sys.mjs"}); // Used at top-level unconditionally. lazy.foo.bar(); @@ -47,7 +47,7 @@ Examples of correct code for this rule: const lazy = {}; ChromeUtils.defineLazyGetter(lazy, "foo1", () => {}); - XPCOMUtils.defineLazyModuleGetters(lazy, { foo2: "foo2.jsm" }); + ChromeUtils.defineESModuleGetters(lazy, { foo2: "foo2.sys.mjs"}); if (x) { lazy.foo1.bar(); |