summaryrefslogtreecommitdiffstats
path: root/dom/script/ModuleLoadRequest.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-07-01 21:12:49 +0000
committerMoonchild <moonchild@palemoon.org>2020-07-10 18:29:22 +0000
commitab0501702637f3448ec16a188a050e5b9f688787 (patch)
tree2117e2a651d677a90e632ce116374bcc66b2fc95 /dom/script/ModuleLoadRequest.cpp
parent255c7f6f3aab6c82912e9ea7450f1a69bf17f848 (diff)
downloadUXP-ab0501702637f3448ec16a188a050e5b9f688787.tar
UXP-ab0501702637f3448ec16a188a050e5b9f688787.tar.gz
UXP-ab0501702637f3448ec16a188a050e5b9f688787.tar.lz
UXP-ab0501702637f3448ec16a188a050e5b9f688787.tar.xz
UXP-ab0501702637f3448ec16a188a050e5b9f688787.zip
Issue #618 - Add clarifying code comments.
Diffstat (limited to 'dom/script/ModuleLoadRequest.cpp')
-rw-r--r--dom/script/ModuleLoadRequest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/dom/script/ModuleLoadRequest.cpp b/dom/script/ModuleLoadRequest.cpp
index e72edca2e..98106df1b 100644
--- a/dom/script/ModuleLoadRequest.cpp
+++ b/dom/script/ModuleLoadRequest.cpp
@@ -52,6 +52,14 @@ void ModuleLoadRequest::Cancel()
void
ModuleLoadRequest::SetReady()
{
+ // Mark a module as ready to execute. This means that this module and all it
+ // dependencies have had their source loaded, parsed as a module and the
+ // modules instantiated.
+ //
+ // The mReady promise is used to ensure that when all dependencies of a module
+ // have become ready, DependenciesLoaded is called on that module
+ // request. This is set up in StartFetchingModuleDependencies.
+
#ifdef DEBUG
for (size_t i = 0; i < mImports.Length(); i++) {
MOZ_ASSERT(mImports[i]->IsReadyToRun());