Bug 1425077 - Make ModuleScript::SetErrorToRethrow call HoldJSObjects in case there is no module record r=baku
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 21 Dec 2017 16:59:12 +0000
changeset 397148 83a66733b7e55ff3700f64e6b2eae06c12f4f58e
parent 397147 93ac39966790ccf1183da04f06d16610e79cec8a
child 397149 c1a62b8156074427354dab1aea2780b41c058247
push id98471
push userjcoppeard@mozilla.com
push dateThu, 21 Dec 2017 17:17:45 +0000
treeherdermozilla-inbound@c1a62b815607 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1425077
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1425077 - Make ModuleScript::SetErrorToRethrow call HoldJSObjects in case there is no module record r=baku
dom/script/ModuleScript.cpp
--- a/dom/script/ModuleScript.cpp
+++ b/dom/script/ModuleScript.cpp
@@ -97,13 +97,17 @@ ModuleScript::SetParseError(const JS::Va
 }
 
 void
 ModuleScript::SetErrorToRethrow(const JS::Value& aError)
 {
   MOZ_ASSERT(!aError.isUndefined());
   MOZ_ASSERT(!HasErrorToRethrow());
 
+  // This is only called after SetModuleRecord() or SetParseError() so we don't
+  // need to call HoldJSObjects() here.
+  MOZ_ASSERT(mModuleRecord || HasParseError());
+
   mErrorToRethrow = aError;
 }
 
 } // dom namespace
 } // mozilla namespace