/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
class LoadedScript; class ModuleScript; class ModuleLoaderBase;
// A reference counted set of module keys (URL and module type) we have visited // in the process of loading a module graph. class VisitedURLSet : public nsTHashtable<ModuleMapKey> {
NS_INLINE_DECL_REFCOUNTING(VisitedURLSet)
private:
~VisitedURLSet() = default;
};
// A load request for a module, created for every top level module script and // every module import. Load request can share an ModuleScript if there are // multiple imports of the same module.
class ModuleLoadRequest final : public ScriptLoadRequest {
~ModuleLoadRequest() {
MOZ_ASSERT(!mWaitingParentRequest);
MOZ_ASSERT(mAwaitingImports == 0);
}
public: // Is this a request for a top level module script or an import? constbool mIsTopLevel;
// Type of module (JavaScript, JSON) const JS::ModuleType mModuleType;
// Is this the top level request for a dynamic module import? constbool mIsDynamicImport;
// Pointer to the script loader, used to trigger actions when the module load // finishes.
RefPtr<ModuleLoaderBase> mLoader;
// Pointer to the top level module of this module graph, nullptr if this is a // top level module
RefPtr<ModuleLoadRequest> mRootModule;
// Set to a module script object after a successful load or nullptr on // failure.
RefPtr<ModuleScript> mModuleScript;
// Array of imported modules.
nsTArray<RefPtr<ModuleLoadRequest>> mImports;
// Parent module (i.e. importer of this module) that is waiting for this // module and its dependencies to load, or null.
RefPtr<ModuleLoadRequest> mWaitingParentRequest;
// Number of child modules (i.e. imported modules) that this module is waiting // for.
size_t mAwaitingImports = 0;
// Set of module URLs visited while fetching the module graph this request is // part of.
RefPtr<VisitedURLSet> mVisitedSet;
// For dynamic imports, the details to pass to FinishDynamicImport.
RefPtr<LoadedScript> mDynamicReferencingScript;
JS::Heap<JSString*> mDynamicSpecifier;
JS::Heap<JSObject*> mDynamicPromise;
};
} // namespace JS::loader
#endif// js_loader_ModuleLoadRequest_h
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.