1 /* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4
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/. */
10 #include "NamespaceImports.h"
12 #include "builtin/ModuleObject.h"
13 #include "js/AllocPolicy.h"
14 #include "js/GCVector.h"
15 #include "js/RootingAPI.h"
21 using ModuleVector
= GCVector
<ModuleObject
*, 0, SystemAllocPolicy
>;
23 // A struct with detailed error information when import/export failed.
24 struct ModuleErrorInfo
{
25 ModuleErrorInfo(uint32_t lineNumber_
, JS::ColumnNumberOneOrigin columnNumber_
)
26 : lineNumber(lineNumber_
), columnNumber(columnNumber_
) {}
28 void setImportedModule(JSContext
* cx
, ModuleObject
* importedModule
);
29 void setCircularImport(JSContext
* cx
, ModuleObject
* importedModule
);
30 void setForAmbiguousImport(JSContext
* cx
, ModuleObject
* importedModule
,
31 ModuleObject
* module1
, ModuleObject
* module2
);
34 JS::ColumnNumberOneOrigin columnNumber
;
36 // The filename of the imported module.
39 // The filenames of the ambiguous entries.
43 // A bool to indicate the error is a circular import when it's true.
44 bool isCircular
= false;
47 ModuleNamespaceObject
* GetOrCreateModuleNamespace(JSContext
* cx
,
48 Handle
<ModuleObject
*> module
);
50 void AsyncModuleExecutionFulfilled(JSContext
* cx
, Handle
<ModuleObject
*> module
);
52 void AsyncModuleExecutionRejected(JSContext
* cx
, Handle
<ModuleObject
*> module
,
57 #endif // vm_Modules_h