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:
phosit authored and phosit committed 2025-06-06 17:36:35 +02:00
1 parent d26d9b9b2b
commit 252df0a1db
10 files changed
+206 -8

No files matched your search

+8 -2
View File
@@ -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.