diff options
author | athenian200 <athenian200@outlook.com> | 2020-01-27 22:59:08 -0600 |
---|---|---|
committer | athenian200 <athenian200@outlook.com> | 2020-01-27 22:59:08 -0600 |
commit | 3c4f414db74b84f7d2a6fb13fd888a47a153699b (patch) | |
tree | ea81fca559849967a79d598a6f460830762ec9ea /dom/base/nsJSUtils.cpp | |
parent | 1f8d508258ac5d7d57fc4eb35cac90f28bc8ca03 (diff) | |
parent | c4b0715baaffc541670fd1158557aa7e61e521d3 (diff) | |
download | UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar.gz UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar.lz UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar.xz UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.zip |
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into form-disabled-issue
Diffstat (limited to 'dom/base/nsJSUtils.cpp')
-rw-r--r-- | dom/base/nsJSUtils.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp index 98b367b66..b6c843065 100644 --- a/dom/base/nsJSUtils.cpp +++ b/dom/base/nsJSUtils.cpp @@ -25,7 +25,7 @@ #include "xpcpublic.h" #include "nsContentUtils.h" #include "nsGlobalWindow.h" - +#include "mozilla/CycleCollectedJSContext.h" #include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/Date.h" #include "mozilla/dom/Element.h" @@ -159,7 +159,8 @@ nsJSUtils::EvaluateString(JSContext* aCx, aEvaluationGlobal); MOZ_ASSERT_IF(aOffThreadToken, aCompileOptions.noScriptRval); MOZ_ASSERT(NS_IsMainThread()); - MOZ_ASSERT(nsContentUtils::IsInMicroTask()); + MOZ_ASSERT(CycleCollectedJSContext::Get() && + CycleCollectedJSContext::Get()->MicroTaskLevel()); // Unfortunately, the JS engine actually compiles scripts with a return value // in a different, less efficient way. Furthermore, it can't JIT them in many @@ -293,7 +294,8 @@ nsJSUtils::CompileModule(JSContext* aCx, aEvaluationGlobal); MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx) == aEvaluationGlobal); MOZ_ASSERT(NS_IsMainThread()); - MOZ_ASSERT(nsContentUtils::IsInMicroTask()); + MOZ_ASSERT(CycleCollectedJSContext::Get() && + CycleCollectedJSContext::Get()->MicroTaskLevel()); NS_ENSURE_TRUE(xpc::Scriptability::Get(aEvaluationGlobal).Allowed(), NS_OK); @@ -330,7 +332,8 @@ nsJSUtils::ModuleEvaluation(JSContext* aCx, JS::Handle<JSObject*> aModule) MOZ_ASSERT(aCx == nsContentUtils::GetCurrentJSContext()); MOZ_ASSERT(NS_IsMainThread()); - MOZ_ASSERT(nsContentUtils::IsInMicroTask()); + MOZ_ASSERT(CycleCollectedJSContext::Get() && + CycleCollectedJSContext::Get()->MicroTaskLevel()); NS_ENSURE_TRUE(xpc::Scriptability::Get(aModule).Allowed(), NS_OK); |