mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-11-08 15:11:41 +00:00
Return the namespace of a module
To make it easy for the engine to access the exported values the namespace is returned from the future.
This commit is contained in:
1 parent
d26d9b9b2b
commit
252df0a1db
10 files changed
+206
-8
No files matched your search
@@ -49,10 +49,14 @@ public:
|
||||
public:
|
||||
struct Evaluating
|
||||
{
|
||||
JS::PersistentRootedObject moduleNamespace;
|
||||
JS::PersistentRootedObject fulfill;
|
||||
JS::PersistentRootedObject reject;
|
||||
};
|
||||
struct Fulfilled {};
|
||||
struct Fulfilled
|
||||
{
|
||||
JS::PersistentRootedObject moduleNamespace;
|
||||
};
|
||||
struct Rejected
|
||||
{
|
||||
std::exception_ptr error;
|
||||
@@ -72,8 +76,10 @@ public:
|
||||
|
||||
/**
|
||||
* Throws if the evaluation of the module failed.
|
||||
* @return The module namespace. All exported values are a property
|
||||
* of this object. @c default is a property with name "default".
|
||||
*/
|
||||
void Get();
|
||||
[[nodiscard]] JSObject* Get();
|
||||
|
||||
private:
|
||||
// It's save to not require a `JS::HandleValue` here.
|
||||
|
||||
Reference in new issue
Block a user