Commit Graph
295 Commits
Author SHA1 Message Date
Yoshi Cheng-Hao Huang 59b34ef09e Bug 1968890 - Part 4: Handle Dynamic import in LoadRequestedModulesRejected. r=jonco
Reject the dynamic import when the LoadRequestedModules fails.

Differential Revision: https://phabricator.services.mozilla.com/D264806
2025-09-24 18:19:42 +00:00
Yoshi Cheng-Hao Huang 3ef1571f6c Bug 1968890 - Part 3: Call ModuleErrored in OnFetchFailed. r=jonco
Update the state of the ModuleLoadRequest in OnFetchFailed.

Differential Revision: https://phabricator.services.mozilla.com/D264805
2025-09-24 18:19:39 +00:00
Yoshi Cheng-Hao Huang 4846001155 Bug 1968890 - Part 2: Handle dynamic import in OnFetchFailed. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D264804
2025-09-24 18:19:36 +00:00
Yoshi Cheng-Hao Huang 2f3764f5f6 Bug 1968890 - Part 1: Dynamic import is not a top-level request. r=jonco,dom-worker-reviewers,edenchuang
According to the spec, requests created in HostLoadImportedModule have
the isTopLevel flag set to false. This means both static and dynamic
import requests should also have this flag set to false.

[HostLoadImportedModule](https://html.spec.whatwg.org/#hostloadimportedmodule)
Step 14. Fetch a single imported module script ...

[Fetch a single imported module script](https://html.spec.whatwg.org/#fetch-a-single-imported-module-script)
Step 4. Fetch a single module script given url, fetchClient, destination, options, settingsObject, referrer, moduleRequest, false, and onComplete.

The false argument in the second-to-last parameter of 'Fetch a single
module script' corresponds to the top-levl flag.

[Fetch a single module script](https://html.spec.whatwg.org/#fetch-a-single-module-script)
given a URL url, an environment settings object fetchClient, a
destination destination, a script fetch options options, an environment
settings object settingsObject, a referrer referrer, an optional
ModuleRequest Record moduleRequest, a boolean isTopLevel, an algorithm
onComplete,

The spec was updated in https://github.com/whatwg/html/issues/7996. We’re
updating the implementation to reflect this change.

Differential Revision: https://phabricator.services.mozilla.com/D265593
2025-09-24 18:19:33 +00:00
Daniel Minor bec9f73c5c Bug 1720570 - Move ModuleTypeAllowed check into ModuleLoaderBase; r=allstarschh
CSS Modules are not supported in Workers and Worklets. This adds a
IsModuleTypeAllowed to ModuleLoaderBase so that the subclasses can
decide which modules are allowed.

Differential Revision: https://phabricator.services.mozilla.com/D263412
2025-09-15 21:24:05 +00:00
Alexandru Marc 982c15a70d Revert "Bug 1720570: apply code formatting via Lando" for causing build bustages @ ModuleLoaderBase.h
This reverts commit ba4e616475.

Revert "Bug 1720570 - Update web-platform test expectations; r=layout-reviewers,emilio"

This reverts commit 27214f9ae8.

Revert "Bug 1720570 - Use backgroundImage in relative-urls.html; r=layout-reviewers,emilio"

This reverts commit 97ec45d1db.

Revert "Bug 1720570 - Support fetching css module scripts; r=dom-core,smaug"

This reverts commit e54b57ec16.

Revert "Bug 1720570 - Add support for css modules in ModuleLoader, WorkerModuleLoader and WorkletModuleLoader; r=allstarschh,dom-core,emilio,smaug"

This reverts commit 2eb55b783d.

Revert "Bug 1720570 - Break out separate method to create constructed stylesheets; r=layout-reviewers,firefox-style-system-reviewers,emilio"

This reverts commit 2ccebf50bb.

Revert "Bug 1720570 - Move ModuleTypeAllowed check into ModuleLoaderBase; r=allstarschh"

This reverts commit 040b387d3e.

Revert "Bug 1720570 - Handle css module in GetModuleType; r=allstarschh"

This reverts commit 4b64b94cb1.

Revert "Bug 1720570 - Add CreateCssModule; r=allstarschh"

This reverts commit 3f20b1d5b7.

Revert "Bug 1720570 - Add ModuleType::CSS; r=allstarschh"

This reverts commit ef5e3a7151.

Revert "Bug 1720570 - Add pref for css module scripts; r=layout-reviewers,emilio"

This reverts commit 7a9b1fbac0.
2025-09-10 01:10:49 +00:00
Daniel Minor 040b387d3e Bug 1720570 - Move ModuleTypeAllowed check into ModuleLoaderBase; r=allstarschh
CSS Modules are not supported in Workers and Worklets. This adds a
IsModuleTypeAllowed to ModuleLoaderBase so that the subclasses can
decide which modules are allowed.

Differential Revision: https://phabricator.services.mozilla.com/D263412
2025-09-10 00:44:21 +00:00
Atila Butkovits c5ace57d5c Revert "Bug 1720570: apply code formatting via Lando" for causing Hazard failures.
This reverts commit 8267f4ae14.

Revert "Bug 1720570 - Update web-platform test expectations; r=layout-reviewers,emilio"

This reverts commit 0a8f6facf2.

Revert "Bug 1720570 - Use backgroundImage in relative-urls.html; r=layout-reviewers,emilio"

This reverts commit 886bec571a.

Revert "Bug 1720570 - Support fetching css module scripts; r=dom-core,smaug"

This reverts commit 161decf185.

Revert "Bug 1720570 - Add support for css modules in ModuleLoader, WorkerModuleLoader and WorkletModuleLoader; r=allstarschh,dom-core,emilio,smaug"

This reverts commit 1c0eba5a86.

Revert "Bug 1720570 - Break out separate method to create constructed stylesheets; r=layout-reviewers,firefox-style-system-reviewers,emilio"

This reverts commit 0552b0f555.

Revert "Bug 1720570 - Move ModuleTypeAllowed check into ModuleLoaderBase; r=allstarschh"

This reverts commit b3be3d8fc4.

Revert "Bug 1720570 - Handle css module in GetModuleType; r=allstarschh"

This reverts commit 6ff53c0877.

Revert "Bug 1720570 - Add CreateCssModule; r=allstarschh"

This reverts commit cf4c677737.

Revert "Bug 1720570 - Add ModuleType::CSS; r=allstarschh"

This reverts commit e5f6251479.

Revert "Bug 1720570 - Add pref for css module scripts; r=layout-reviewers,emilio"

This reverts commit 9155521841.
2025-09-09 00:35:54 +00:00
Daniel Minor b3be3d8fc4 Bug 1720570 - Move ModuleTypeAllowed check into ModuleLoaderBase; r=allstarschh
CSS Modules are not supported in Workers and Worklets. This adds a
IsModuleTypeAllowed to ModuleLoaderBase so that the subclasses can
decide which modules are allowed.

Differential Revision: https://phabricator.services.mozilla.com/D263412
2025-09-08 18:30:18 +00:00
Yoshi Cheng-Hao Huang 292eb157f6 Bug 1968895 - Part 7: Remove StartFetchingModuleAndDependencies. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D263376
2025-09-07 09:03:59 +00:00
Yoshi Cheng-Hao Huang 374f6ffb24 Bug 1968895 - Part 6: Replace CreateStaticImport/CreateDynamicImport with CreateRequest. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D263375
2025-09-07 09:03:55 +00:00
Yoshi Cheng-Hao Huang 05f8214d59 Bug 1968895 - Part 1: Check if dynamic import is supported earlier. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D263370
2025-09-07 09:03:35 +00:00
Cristina Horotan 1fe1c12f6e Revert "Bug 1968895: apply code formatting via Lando" for causing SM failures on Value.h
This reverts commit 40010a7da7.

Revert "Bug 1968895 - Part 7: Remove StartFetchingModuleAndDependencies. r=jonco"

This reverts commit 816a0a6015.

Revert "Bug 1968895 - Part 6: Replace CreateStaticImport/CreateDynamicImport with CreateRequest. r=jonco"

This reverts commit e29a957535.

Revert "Bug 1968895 - Part 5: Add CreateDefaultScriptFetchOptions and GetClientReferrerURI. r=jonco"

This reverts commit 4b21d41ec1.

Revert "Bug 1968895 - Part 4: Pass null for referrer in shadow realm import value. r=jonco"

This reverts commit a3417dbe89.

Revert "Bug 1968895 - Part 3: Update ModuleLoadRequest's referrer policy for workers. r=jonco"

This reverts commit 6a28639be8.

Revert "Bug 1968895 - Part 2: Pass BaseURL for static/dynamic import. r=jonco"

This reverts commit dab430a7b4.

Revert "Bug 1968895 - Part 1: Check if dynamic import is supported earlier. r=jonco"

This reverts commit 34f67fd697.
2025-09-03 18:44:42 +00:00
Yoshi Cheng-Hao Huang 816a0a6015 Bug 1968895 - Part 7: Remove StartFetchingModuleAndDependencies. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D263376
2025-09-03 17:58:55 +00:00
Yoshi Cheng-Hao Huang e29a957535 Bug 1968895 - Part 6: Replace CreateStaticImport/CreateDynamicImport with CreateRequest. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D263375
2025-09-03 17:58:52 +00:00
Yoshi Cheng-Hao Huang 34f67fd697 Bug 1968895 - Part 1: Check if dynamic import is supported earlier. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D263370
2025-09-03 17:58:37 +00:00
Tooru Fujisawa ea00d6421a Bug 1977148 - Part 4: Rename bytecode-encoding-related identifiers to cache. r=nbp
There are shared path between "save bytecode" vs "cache stencil".
This patch just renames everything, and the subsequent bugs and patches will
split the flag and methods.

Differential Revision: https://phabricator.services.mozilla.com/D260911
2025-08-25 05:47:45 +00:00
Jon Coppeard d7c24993b7 Bug 1968870 - Part 5: Stop passing referencing private to module load hook r=allstarschh
Differential Revision: https://phabricator.services.mozilla.com/D260946
2025-08-14 06:35:43 +00:00
Jon Coppeard bc5f405136 Bug 1968870 - Part 4: Remove use of referencing private in browser module loader r=allstarschh
Differential Revision: https://phabricator.services.mozilla.com/D260945
2025-08-14 06:35:39 +00:00
Jon Coppeard 98df766730 Bug 1968870 - Part 2: Don't pass referencingPrivate to FinishLoadingImportedModule r=allstarschh
This already takes the referrer script. We can use the referrer script to keep
its private value alive in DynamicImportContextObject which is much simpler.

Differential Revision: https://phabricator.services.mozilla.com/D260943
2025-08-14 06:35:32 +00:00
Jon Coppeard 84fafeaa92 Bug 1968870 - Part 1: Pass referrer as script rather than object r=allstarschh
Previously we passed the module object for modules and nullptr for other cases.
This patch makes it so we pass the script for both module and classic script
referrers, and nullptr for the realm case.

Differential Revision: https://phabricator.services.mozilla.com/D260942
2025-08-14 06:35:28 +00:00
Jon Coppeard d7ab3e3d21 Bug 1982328 - Part 14: Remove ModuleLoadRequest::mDynamicPromise and use mPayload for this r=allstarschh
Differential Revision: https://phabricator.services.mozilla.com/D260677
2025-08-13 14:17:18 +00:00
Jon Coppeard a6a27c7090 Bug 1982328 - Part 12: Rename ModuleLoadRequest::mStatePrivate to mPayload r=allstarschh
Differential Revision: https://phabricator.services.mozilla.com/D260675
2025-08-13 14:17:10 +00:00
Jon Coppeard 5f0809ace8 Bug 1982328 - Part 11: Remove use of unnecessary JS namespace prefix in the module loader r=allstarschh
We're already in the JS namespace here so this is not necessary.

Differential Revision: https://phabricator.services.mozilla.com/D260674
2025-08-13 14:17:06 +00:00
Jon Coppeard e9414cdb53 Bug 1982328 - Part 10: Pass host defined value to HostLoadImportedModule r=allstarschh
Per the spec we should pass this to the module load hook. This means we can
remove JS::GetLoadingModuleHostDefinedValue.

Differential Revision: https://phabricator.services.mozilla.com/D260673
2025-08-13 14:17:02 +00:00
Jon Coppeard ac8506c5a8 Bug 1982328 - Part 9: Remove unused function in ModuleLoaderBase.cpp r=allstarschh
Differential Revision: https://phabricator.services.mozilla.com/D260672
2025-08-13 14:16:58 +00:00
Jon Coppeard 2385d5c579 Bug 1982328 - Part 7: Tidy error handling for HostLoadImportedModule r=allstarschh
This makes it the responsibility of the JS engine to deal with failure if the
module load hook fails. It's more convenient for the embedding to have this
handled for you.

Differential Revision: https://phabricator.services.mozilla.com/D260670
2025-08-13 14:16:51 +00:00
Jon Coppeard 428c560074 Bug 1980126 - Part 10: Pass a single payload argument to HostLoadImportedModule callback r=allstarschh
Previously this passed separate statePrivate and promise arguments, only one of
which was used at a time.

Differential Revision: https://phabricator.services.mozilla.com/D259615
2025-08-05 09:02:44 +00:00
Jon Coppeard 6094f777fb Bug 1980126 - Part 7: Combine internal FinishLoadingImportedModule failure paths r=allstarschh
This makes it so FinishLoadingImportedModuleFailedWithPendingException gets the
current exception and calls FinishLoadingImportedModuleFailed.

Differential Revision: https://phabricator.services.mozilla.com/D259612
2025-08-05 09:02:33 +00:00
Jon Coppeard 484bfe7dbc Bug 1980126 - Part 6: Refactor error handling in module load hook implementation r=allstarschh
We use ScopeExit here to ensure we call FinishLoadingImportedModuleFailed on
error. However sometimes we call this directly and then exit without releasing
the guard and so call it again.

The patch cleans this up and makes the guard report the pending exception if
set but still report an exception otherwise. (In future we might think about
insisting that an exception is set if we leave early.)

Differential Revision: https://phabricator.services.mozilla.com/D259611
2025-08-05 09:02:30 +00:00
Jon Coppeard b1a2c70f85 Bug 1980126 - Part 5: Unify JS::FinishLoadingImportedModuleFailed APIs r=allstarschh
Similar to the previous patch, this makes the FinishLoadingImportedModuleFailed and
FinishLoadingImportedModuleFailedWithPendingException APIs take a single
payload argument.

Differential Revision: https://phabricator.services.mozilla.com/D259610
2025-08-05 09:02:26 +00:00
Jon Coppeard 3f057094f7 Bug 1980126 - Part 4: Unify JS::FinishLoadingImportedModule API r=allstarschh
This merges the two versions of FinishLoadingImportedModule so there's a single
API that takes a payload rather than separate ones for promise/statePrivate.

Differential Revision: https://phabricator.services.mozilla.com/D259609
2025-08-05 09:02:23 +00:00
Jon Coppeard 07264939b1 Bug 1980126 - Part 1: Make LoadModuleResolved/RejectedCallbacks into function pointers r=allstarschh
We usually use function pointers for callbacks into the JS engine.
These are simpler to deal with and also std::function can alocate memory in
some situations which is undesirable.

The patch converts these to function pointers and also refactors
ModuleLoaderBase.cpp where these are defined for the main module loader.

Differential Revision: https://phabricator.services.mozilla.com/D259606
2025-08-05 09:02:12 +00:00
Cristina Horotan 2270145ce0 Revert "Bug 1980126: apply code formatting via Lando" for causing wpt failures on before-prepare-iframe-success-external-module.html
This reverts commit 3e05c64268.

Revert "Bug 1980126 - Part 12: Tidy error handling in StartDynamicModuleImport r=allstarschh"

This reverts commit 8a67a2ece6.

Revert "Bug 1980126 - Part 11: Remove unused data from dynamic import context r=allstarschh"

This reverts commit e9878305e6.

Revert "Bug 1980126 - Part 10: Pass a single payload argument to HostLoadImportedModule callback r=allstarschh"

This reverts commit d90f9d6674.

Revert "Bug 1980126 - Part 9: Update test expectations r=allstarschh"

This reverts commit eee20ec5f4.

Revert "Bug 1980126 - Part 8: Add missing steps for FinishLoadingImportedModule for dynamic import r=allstarschh"

This reverts commit a904cdf9b8.

Revert "Bug 1980126 - Part 7: Combine internal FinishLoadingImportedModule failure paths r=allstarschh"

This reverts commit 1a80705381.

Revert "Bug 1980126 - Part 6: Refactor error handling in module load hook implementation r=allstarschh"

This reverts commit 47cd46fb6b.

Revert "Bug 1980126 - Part 5: Unify JS::FinishLoadingImportedModuleFailed APIs r=allstarschh"

This reverts commit dff70a55ad.

Revert "Bug 1980126 - Part 4: Unify JS::FinishLoadingImportedModule API r=allstarschh"

This reverts commit 8de76d7f72.

Revert "Bug 1980126 - Part 3: Move dynamic module code to vm/Modules.cpp from builtin/ModuleObject.cpp r=allstarschh"

This reverts commit e7d409880f.

Revert "Bug 1980126 - Part 2: Make GraphLoadingStateRecordObject background finalized and refactor r=allstarschh"

This reverts commit bec492ffcd.

Revert "Bug 1980126 - Part 1: Make LoadModuleResolved/RejectedCallbacks into function pointers r=allstarschh"

This reverts commit 20ca6df255.
2025-08-05 03:43:36 +00:00
Jon Coppeard d90f9d6674 Bug 1980126 - Part 10: Pass a single payload argument to HostLoadImportedModule callback r=allstarschh
Previously this passed separate statePrivate and promise arguments, only one of
which was used at a time.

Differential Revision: https://phabricator.services.mozilla.com/D259615
2025-08-04 07:27:56 +00:00
Jon Coppeard 1a80705381 Bug 1980126 - Part 7: Combine internal FinishLoadingImportedModule failure paths r=allstarschh
This makes it so FinishLoadingImportedModuleFailedWithPendingException gets the
current exception and calls FinishLoadingImportedModuleFailed.

Differential Revision: https://phabricator.services.mozilla.com/D259612
2025-08-04 07:27:46 +00:00
Jon Coppeard 47cd46fb6b Bug 1980126 - Part 6: Refactor error handling in module load hook implementation r=allstarschh
We use ScopeExit here to ensure we call FinishLoadingImportedModuleFailed on
error. However sometimes we call this directly and then exit without releasing
the guard and so call it again.

The patch cleans this up and makes the guard report the pending exception if
set but still report an exception otherwise. (In future we might think about
insisting that an exception is set if we leave early.)

Differential Revision: https://phabricator.services.mozilla.com/D259611
2025-08-04 07:27:42 +00:00
Jon Coppeard dff70a55ad Bug 1980126 - Part 5: Unify JS::FinishLoadingImportedModuleFailed APIs r=allstarschh
Similar to the previous patch, this makes the FinishLoadingImportedModuleFailed and
FinishLoadingImportedModuleFailedWithPendingException APIs take a single
payload argument.

Differential Revision: https://phabricator.services.mozilla.com/D259610
2025-08-04 07:27:39 +00:00
Jon Coppeard 8de76d7f72 Bug 1980126 - Part 4: Unify JS::FinishLoadingImportedModule API r=allstarschh
This merges the two versions of FinishLoadingImportedModule so there's a single
API that takes a payload rather than separate ones for promise/statePrivate.

Differential Revision: https://phabricator.services.mozilla.com/D259609
2025-08-04 07:27:35 +00:00
Jon Coppeard 20ca6df255 Bug 1980126 - Part 1: Make LoadModuleResolved/RejectedCallbacks into function pointers r=allstarschh
We usually use function pointers for callbacks into the JS engine.
These are simpler to deal with and also std::function can alocate memory in
some situations which is undesirable.

The patch converts these to function pointers and also refactors
ModuleLoaderBase.cpp where these are defined for the main module loader.

Differential Revision: https://phabricator.services.mozilla.com/D259606
2025-08-04 07:27:25 +00:00
Yoshi Cheng-Hao Huang a61af56c37 Bug 1820594 - Part 36: Add CancelFetchingModules. r=jonco
In mochitest-browser tests, it's possible for the about:neterror page to
load. This triggers aboutNetError.html, which in turn loads
aboutNetError.mjs, eventually importing pkijs.js. The pkijs.js module is
compiled off-thread.

However, when the test framework proceeds to the next test, the
associated document may be detached before the off-thread compilation of
pkijs.js completes. If this happens while TaskController is shutting
down, the compilation task may never finish.

Currently, ScriptLoader only tracks top-level off-thread compilation
requests, not submodules involved in those tasks. To address this, we
now call CancelFetchingModules when ScriptLoader cancels ongoing
requests, ensuring submodule fetches are also properly aborted.

Differential Revision: https://phabricator.services.mozilla.com/D257677
2025-07-22 18:30:00 +00:00
Yoshi Cheng-Hao Huang 264c8307be Bug 1820594 - Part 27: Remove redundant module graph data structures from host layer. r=jonco
Since the module graph is now traversed within the JS engine itself, the
related data structures in the host layer are no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D255129
2025-07-22 18:29:34 +00:00
Yoshi Cheng-Hao Huang 4f92fa4f2d Bug 1820594 - Part 26: Remove FindFirstParseError and check for parse error. r=jonco
The changes in [whatwg/html#8253](https://github.com/whatwg/html/pull/8253)
remove the "Find the first parse error" part.

Differential Revision: https://phabricator.services.mozilla.com/D214579
2025-07-22 18:29:31 +00:00
Yoshi Cheng-Hao Huang 2464b45fe0 Bug 1820594 - Part 25: Call FinishLoadingImportedModule for dynamic import. r=jonco
From the specification, ContinueDynamicImport is done inside the engine.
https://tc39.es/ecma262/#sec-ContinueDynamicImport

However, our implementation for EvaluateModuleInContext() has bytecode
encoding related stuff, so for now I implement the ContinueDynamicImport
in the host layer.

Also, the updated spec has a slightly different error handling behavior when
module.Link() fails. I list them below:

Before HTML PR 8253 [https://github.com/whatwg/html/pull/8253]

fetch the descendants of and link a module script
https://web.archive.org/web/20221130023614/https://html.spec.whatwg.org/#fetch-the-descendants-of-and-link-a-module-script

onFetchDescendantsComplete
Step 3.2. Perform record.Link().
          If this throws an exception, set result's error to rethrow to that exception.

HostImportModuleDynamically
https://web.archive.org/web/20221130023614/https://html.spec.whatwg.org/#hostimportmoduledynamically(referencingscriptormodule,-modulerequest,-promisecapability)
Step 6.3 Otherwise, set promise to the result of running a module script given result and true.

run a module script
https://web.archive.org/web/20221130023614/https://html.spec.whatwg.org/#run-a-module-script
Step 5. If script's error to rethrow is not null, then set evaluationPromise to a promise rejected with script's error to rethrow.

--------------------------------------------------------
After ECMA262 PR 2905 [https://github.com/tc39/ecma262/pull/2905]
ContinueDynamicImport
Step 6.a Let link be Completion(module.Link()).
Step 6.b If link is an abrupt completion, then
  Step 6.b.i. Perform ! Call(promiseCapability.[[Reject]], undefined, « link.[[Value]] »).
  Step 6.b.ii. Return unused.

In short,
  * The old behavior:
    It catched the exception thrown during module.Link(), and set
    the module script's error to rethrow to the exception. Later in
    Evaluate(), if the module script's error to rethrow is not null,
    reject the evaluation promise with the error to rethrow.

  * The new behavior:
    It simply rejects the evaluation promise with the exception thrown
    during module.Link().

Differential Revision: https://phabricator.services.mozilla.com/D214577
2025-07-22 18:29:28 +00:00
Yoshi Cheng-Hao Huang 2d3841c2a0 Bug 1820594 - Part 24: Add ModuleErroredRunnable to dispatch ModuleErrored. r=jonco
When there's a ParseError, the error should be dispatched asynchronously.
However, workers can't handle the micro task, therefore we still call
ModuleErrored synchronously.

WPT test: /html/semantics/scripting-1/the-script-element/module/inline-async-inserted-execorder.html

Differential Revision: https://phabricator.services.mozilla.com/D255128
2025-07-22 18:29:25 +00:00
Yoshi Cheng-Hao Huang 33d4e771ca Bug 1820594 - Part 23: Error handling when module fetching failed. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D228860
2025-07-22 18:29:22 +00:00
Yoshi Cheng-Hao Huang b4418fa96d Bug 1820594 - Part 22: Throw TypeError if the module type is unsupported. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D241812
2025-07-22 18:29:19 +00:00
Yoshi Cheng-Hao Huang 14ef8f5fdb Bug 1820594 - Part 21: Implement HostLoadImportedModule and FinishLoadingImportedModule in ModuleLoaderBase. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D228856
2025-07-22 18:29:16 +00:00
Yoshi Cheng-Hao Huang cfaa6e7c06 Bug 1820594 - Part 20: Update module script's referrer policy. r=jonco
- Move UpdateReferrerPolicy from ScriptLoadRequest to ModuleLoadRequest,
  as this can only happend for a module load.

- Add UpdateReferrerPolicy method to ModuleScript.
  Introduces a new UpdateReferrerPolicy method for ModuleScript,
  allowing the referrer policy to be updated based on the associated
  ModuleLoadRequest.

Differential Revision: https://phabricator.services.mozilla.com/D255127
2025-07-22 18:29:13 +00:00
Yoshi Cheng-Hao Huang 745139e2c8 Bug 1820594 - Part 19: Refactor CreateStaticImport. r=jonco
Pass LoadContextBase to CreateStaticImport

Differential Revision: https://phabricator.services.mozilla.com/D255126
2025-07-22 18:29:10 +00:00