Bug 1865597 - Add error checking when initializing parallel marking and disable on...
[gecko.git] / js / src / vm / Modules.h
blob18b97ac3d7fbf3cbf8e9721f9b896e5340e37194
1 /* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4
2 * -*- */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef vm_Modules_h
8 #define vm_Modules_h
10 #include "NamespaceImports.h"
12 #include "builtin/ModuleObject.h"
13 #include "js/AllocPolicy.h"
14 #include "js/GCVector.h"
15 #include "js/RootingAPI.h"
17 struct JSContext;
19 namespace js {
21 using ModuleVector = GCVector<ModuleObject*, 0, SystemAllocPolicy>;
23 bool ModuleResolveExport(JSContext* cx, Handle<ModuleObject*> module,
24 Handle<JSAtom*> exportName,
25 MutableHandle<Value> result);
27 ModuleNamespaceObject* GetOrCreateModuleNamespace(JSContext* cx,
28 Handle<ModuleObject*> module);
30 bool ModuleInitializeEnvironment(JSContext* cx, Handle<ModuleObject*> module);
32 bool ModuleLink(JSContext* cx, Handle<ModuleObject*> module);
34 // Start evaluating the module. If TLA is enabled, result will be a promise.
35 bool ModuleEvaluate(JSContext* cx, Handle<ModuleObject*> module,
36 MutableHandle<Value> result);
38 void AsyncModuleExecutionFulfilled(JSContext* cx, Handle<ModuleObject*> module);
40 void AsyncModuleExecutionRejected(JSContext* cx, Handle<ModuleObject*> module,
41 HandleValue error);
43 } // namespace js
45 #endif // vm_Modules_h