mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-28 04:39:07 -10:00
Bug 1482153 - Replace ModuleObject's host defined field with one on top-level JSScripts r=jandem r=hsivonen
This commit is contained in:
1 parent
749d09b6df
commit
c0bb7f5c0c
10 files changed
+97
-43
No files matched your search
@@ -56,9 +56,8 @@ ModuleScript::UnlinkScript()
|
||||
{
|
||||
// Remove module's back reference to this object request if present.
|
||||
if (mScript) {
|
||||
MOZ_ASSERT(JS::GetModuleHostDefinedField(mScript).toPrivate() ==
|
||||
this);
|
||||
JS::SetModuleHostDefinedField(mScript, JS::UndefinedValue());
|
||||
MOZ_ASSERT(JS::GetTopLevelScriptPrivate(mScript) == this);
|
||||
JS::SetTopLevelScriptPrivate(mScript, nullptr);
|
||||
mScript = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -81,7 +80,7 @@ ModuleScript::SetScript(JS::Handle<JSScript*> aScript)
|
||||
|
||||
// Make module's host defined field point to this module script object.
|
||||
// This is cleared in the UnlinkScript().
|
||||
JS::SetModuleHostDefinedField(mScript, JS::PrivateValue(this));
|
||||
JS::SetTopLevelScriptPrivate(mScript, this);
|
||||
HoldJSObjects(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user