Closed Bug 1875638 Opened 2 years ago Closed 2 years ago

Add ImportESModuleOptionsDictionary parameter to ChromeUtils.defineESModuleGetters

Categories

(Core :: XPConnect, task)

task

Tracking

()

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(3 files)

ImportESModuleOptionsDictionary option is used for controlling where the module is loaded into.
Currently it has loadInDevToolsLoader field to control whether to load into DevTools' global or not.

Bug 1803810 is going to add more options, including "load into current global" behavior, that is module-variant of Services.scriptloader.loadSubScript.
and it's better having the option also in ChromeUtils.defineESModuleGetters, so that people don't have to use ChromeUtils.defineLazyGetter+ChromeUtils.importESModule

Blocks: 1875639

Pass the global/loadInDevToolsLoader options to the lazy getter, with encoding
the option into single integer and store into the getter function's extended
slot.

Depends on D199462

Expose defineESModuleGetters to worker as well, while only supporting
{ global: "current" } option.

Depends on D199463

Depends on D199464

Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/32b63d4ef3d2 Part 1: Add ImportESModuleOptionsDictionary parameter to ChromeUtils.defineESModuleGetters. r=jonco https://hg.mozilla.org/integration/autoland/rev/9e528ea23760 Part 2: Make ChromeUtils.defineESModuleGetters available in workers. r=jonco https://hg.mozilla.org/integration/autoland/rev/ea95dfbc56f0 Part 3: Add tests. r=jonco

Backed out for workers/clients related dt failures.

Flags: needinfo?(arai.unmht)

Apparently this depends on bug 1875639 part 2 changes, due to pre-existing use of ChromeUtils.defineESModuleGetters in devtools worker, without actually loading modules.
the validation for global parameter happens at call, and it fails.
I'll fix it.

Flags: needinfo?(arai.unmht)
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/6d00ab2fcde7 Part 1: Add ImportESModuleOptionsDictionary parameter to ChromeUtils.defineESModuleGetters. r=jonco https://hg.mozilla.org/integration/autoland/rev/dbb3a63499dd Part 2: Make ChromeUtils.defineESModuleGetters available in workers. r=jonco https://hg.mozilla.org/integration/autoland/rev/f75a84b9f7d5 Part 3: Add tests. r=jonco
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: