Closed Bug 1767800 Opened 4 years ago Closed 4 years ago

Refactor mozJSComponentLoader to split up script loading in preparation for loading ES6 modules

Categories

(Core :: XPConnect, task)

task

Tracking

()

RESOLVED FIXED
102 Branch
Tracking Status
firefox102 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(4 external files, 2 obsolete files)

Here are some patches to split up script loading in mozJSComponentLoader into a bunch of smaller methods. This will allow a module loader to call only the parts it needs.

Minor fix. This didn't check for errors when defining functions. The patch gives
it a return value and returns null if this fails.

We won't call PrepareObjectForLocation when loading ES6 modules.

Depends on D145470

This adds a flag to ComponentLoaderInfo to say whether it represents a module
and calls the appriate JS APIs based on this.

Depends on D145561

Comment on attachment 9275162 [details]
Bug 1767800 - Part 8: Add option to compile source to module stencil in mozJSComponentLoader r?yulia

Revision D145562 was moved to bug 1432901. Setting attachment 9275162 [details] to obsolete.

Attachment #9275162 - Attachment is obsolete: true
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/77f7ab7507a7 Part 1: Fix error handling in mozJSComponentLoader::CreateLoaderGlobal r=mccr8 https://hg.mozilla.org/integration/autoland/rev/47e2a79b5e9b Part 2: Factor out method to load a JSScript from mozJSComponentLoader::ObjectForLocation r=mccr8 https://hg.mozilla.org/integration/autoland/rev/7efb637cd21a Part 3: Factor out a method to determine if a URL is a real file from PrepareObjectForLocation r=mccr8 https://hg.mozilla.org/integration/autoland/rev/89007c9890d9 Part 4: Factor out a method to get the source file location for a URI r=mccr8 https://hg.mozilla.org/integration/autoland/rev/a11c8dbd530e Part 5: Factor out a method to check whether a URL to load is trusted r=mccr8

Backed out for causing hazard failures on mozJSComponentLoader.cpp

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-FAIL | hazards | unrooted '<returnvalue>' of type 'JSObject*' live across GC call at js/xpconnect/loader/mozJSComponentLoader.cpp:597
Flags: needinfo?(jcoppeard)
Attachment #9275019 - Attachment is obsolete: true
Attachment #9275020 - Attachment description: Bug 1767800 - Part 2: Factor out method to load a JSScript from mozJSComponentLoader::ObjectForLocation r?mccr8 → Bug 1767800 - Part 1: Factor out method to load a JSScript from mozJSComponentLoader::ObjectForLocation r?mccr8
Attachment #9275021 - Attachment description: Bug 1767800 - Part 3: Factor out a method to determine if a URL is a real file from PrepareObjectForLocation r?mccr8 → Bug 1767800 - Part 2: Factor out a method to determine if a URL is a real file from PrepareObjectForLocation r?mccr8
Attachment #9275022 - Attachment description: Bug 1767800 - Part 4: Factor out a method to get the source file location for a URI r?mccr8 → Bug 1767800 - Part 3: Factor out a method to get the source file location for a URI r?mccr8
Attachment #9275023 - Attachment description: Bug 1767800 - Part 5: Factor out a method to check whether a URL to load is trusted r?mccr8 → Bug 1767800 - Part 4: Factor out a method to check whether a URL to load is trusted r?mccr8
Flags: needinfo?(jcoppeard)
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c911f99fd05c Part 1: Factor out method to load a JSScript from mozJSComponentLoader::ObjectForLocation r=mccr8 https://hg.mozilla.org/integration/autoland/rev/b9fb752be4a1 Part 2: Factor out a method to determine if a URL is a real file from PrepareObjectForLocation r=mccr8 https://hg.mozilla.org/integration/autoland/rev/4b22d24b5c4e Part 3: Factor out a method to get the source file location for a URI r=mccr8 https://hg.mozilla.org/integration/autoland/rev/f92a19fe87cc Part 4: Factor out a method to check whether a URL to load is trusted r=mccr8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: