Currently Gecko only set mIsPreload to true for the top-level preloading
load. To identify a non-top-level preload, update mIsPreload accordingly
to match the mIsPreload flag from the root module.
Differential Revision: https://phabricator.services.mozilla.com/D281154
Per spec, [[ErrorToRethrow]] is only set for static imports and
top-level modules [1]. Accordingly, an assertion was added to require
non-dynamic imports when hasRethrow is true.
However, during a dynamic import, if the module script has already been
fetched, the cached module is returned (See HTML “fetch a single module
script”, step 6) [2]. In that case, a previously fetched module may already
carry [[ErrorToRethrow]], and this value is propagated to the dynamic
import.
This causes the assertion to fire for valid dynamic-import behavior. The
assertion is therefore incorrect and must be removed.
[1]: https://html.spec.whatwg.org/#fetch-the-descendants-of-and-link-a-module-script
[2]: https://html.spec.whatwg.org/#fetch-a-single-module-script
Differential Revision: https://phabricator.services.mozilla.com/D278670
To indicate the loading error for a top-level of the module from the dynamic import
is successfully fetched and parsed, but one of its dependencies fails to fetch
or compile.
//Example
import("a.mjs");
// a.mjs
import "./404.mjs";
This patch allows the ModuleLoadRequest::IsErrored() for "a.mjs" returns
true.
Differential Revision: https://phabricator.services.mozilla.com/D264807
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
To indicate the loading error for a top-level of the module from the dynamic import
is successfully fetched and parsed, but one of its dependencies fails to fetch
or compile.
//Example
import("a.mjs");
// a.mjs
import "./404.mjs";
This patch allows the ModuleLoadRequest::IsErrored() for "a.mjs" returns
true.
Differential Revision: https://phabricator.services.mozilla.com/D264807
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
To indicate the loading error for a top-level of the module from the dynamic import
is successfully fetched and parsed, but one of its dependencies fails to fetch
or compile.
//Example
import("a.mjs");
// a.mjs
import "./404.mjs";
This patch allows the ModuleLoadRequest::IsErrored() for "a.mjs" returns
true.
Differential Revision: https://phabricator.services.mozilla.com/D264807
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
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
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