Closed Bug 1774888 Opened 3 years ago Closed 2 years ago

Remove XPCOMUtils.defineLazyModuleGetter

Categories

(Core :: XPConnect, task)

task

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: arai, Assigned: standard8)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

https://searchfox.org/mozilla-central/rev/49566d906ad040cf233b0a5acd597e1a63b92f72/js/xpconnect/loader/XPCOMUtils.jsm#192-220

/**
 * Defines a getter on a specified object for a module.  The module will not
 * be imported until first use. The getter allows to execute setup and
 * teardown code (e.g.  to register/unregister to services) and accepts
 * a proxy object which acts on behalf of the module until it is imported.
 *
 * @param aObject
 *        The object to define the lazy getter on.
 * @param aName
 *        The name of the getter to define on aObject for the module.
 * @param aResource
 *        The URL used to obtain the module.
 * @param aSymbol
 *        The name of the symbol exported by the module.
 *        This parameter is optional and defaults to aName.
 * @param aPreLambda
 *        A function that is executed when the proxy is set up.
 *        This will only ever be called once.
 * @param aPostLambda
 *        A function that is executed when the module has been imported to
 *        run optional teardown procedures on the proxy object.
 *        This will only ever be called once.
 * @param aProxy
 *        An object which acts on behalf of the module to be imported until
 *        the module has been imported.
 */
defineLazyModuleGetter: function XPCU_defineLazyModuleGetter(
                                 aObject, aName, aResource, aSymbol,
                                 aPreLambda, aPostLambda, aProxy)

4th parameter to define an alias is going to be handled in bug 1772969, and there's no in-tree consumer for 5th+ parameters.

This should be done only after the out-of-tree migration finishes, to avoid unnecessary compat issue.

See Also: → 1745807
Blocks: 1776174
No longer blocks: esm-ification

Once we've finished updating the privileged add-ons, we should be able to completely remove this function.

Summary: Remove 4th+ parameters from XPCOMUtils.defineLazyModuleGetter → Remove XPCOMUtils.defineLazyModuleGetter

I think this is long enough obsolete and not used that we could fully remove support for it now. The rule was originally added in Firefox 57 (bug 1431533).

Assignee: nobody → standard8
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cd5f6bc69743 Remove XPCOMUtils.defineLazyModuleGetter. r=arai
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: