summaryrefslogtreecommitdiffstats
path: root/js/src/builtin/ModuleObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/builtin/ModuleObject.cpp')
-rw-r--r--js/src/builtin/ModuleObject.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/js/src/builtin/ModuleObject.cpp b/js/src/builtin/ModuleObject.cpp
index 2790b1c44..ae966c89a 100644
--- a/js/src/builtin/ModuleObject.cpp
+++ b/js/src/builtin/ModuleObject.cpp
@@ -725,6 +725,12 @@ ModuleObject::namespace_()
return &value.toObject().as<ModuleNamespaceObject>();
}
+ScriptSourceObject*
+ModuleObject::scriptSourceObject() const
+{
+ return &getReservedSlot(ScriptSourceObjectSlot).toObject().as<ScriptSourceObject>();
+}
+
FunctionDeclarationVector*
ModuleObject::functionDeclarations()
{
@@ -738,8 +744,10 @@ ModuleObject::functionDeclarations()
void
ModuleObject::init(HandleScript script)
{
+ MOZ_ASSERT(script);
initReservedSlot(ScriptSlot, PrivateValue(script));
initReservedSlot(StatusSlot, Int32Value(MODULE_STATUS_UNINSTANTIATED));
+ initReservedSlot(ScriptSourceObjectSlot, ObjectValue(script->scriptSourceUnwrap()));
}
void
@@ -868,18 +876,6 @@ ModuleObject::evaluationError() const
return getReservedSlot(EvaluationErrorSlot);
}
-Value
-ModuleObject::hostDefinedField() const
-{
- return getReservedSlot(HostDefinedSlot);
-}
-
-void
-ModuleObject::setHostDefinedField(const JS::Value& value)
-{
- setReservedSlot(HostDefinedSlot, value);
-}
-
Scope*
ModuleObject::enclosingScope() const
{