summaryrefslogtreecommitdiffstats
path: root/dom/console
diff options
context:
space:
mode:
Diffstat (limited to 'dom/console')
-rw-r--r--dom/console/Console.h1
-rw-r--r--dom/console/ConsoleAPIStorage.sys.mjs2
-rw-r--r--dom/console/ConsoleInstance.cpp10
-rw-r--r--dom/console/ConsoleUtils.cpp1
4 files changed, 7 insertions, 7 deletions
diff --git a/dom/console/Console.h b/dom/console/Console.h
index 410cc8ba46..5898c6b0f5 100644
--- a/dom/console/Console.h
+++ b/dom/console/Console.h
@@ -9,6 +9,7 @@
#include "domstubs.h"
#include "mozilla/dom/ConsoleBinding.h"
+#include "mozilla/dom/ConsoleInstanceBinding.h"
#include "mozilla/TimeStamp.h"
#include "nsCycleCollectionParticipant.h"
#include "nsTHashMap.h"
diff --git a/dom/console/ConsoleAPIStorage.sys.mjs b/dom/console/ConsoleAPIStorage.sys.mjs
index f920d0d5e0..2f537f21e9 100644
--- a/dom/console/ConsoleAPIStorage.sys.mjs
+++ b/dom/console/ConsoleAPIStorage.sys.mjs
@@ -49,7 +49,7 @@ ConsoleAPIStorageService.prototype = {
"nsIObserver",
]),
- observe: function CS_observe(aSubject, aTopic, aData) {
+ observe: function CS_observe(aSubject, aTopic) {
if (aTopic == "xpcom-shutdown") {
Services.obs.removeObserver(this, "xpcom-shutdown");
Services.obs.removeObserver(this, "inner-window-destroyed");
diff --git a/dom/console/ConsoleInstance.cpp b/dom/console/ConsoleInstance.cpp
index 24477da56c..ade82be50f 100644
--- a/dom/console/ConsoleInstance.cpp
+++ b/dom/console/ConsoleInstance.cpp
@@ -71,7 +71,7 @@ ConsoleInstance::ConsoleInstance(JSContext* aCx,
return;
}
- CopyUTF16toUTF8(aOptions.mMaxLogLevelPref, mMaxLogLevelPref);
+ mMaxLogLevelPref = aOptions.mMaxLogLevelPref;
Preferences::RegisterCallback(MaxLogLevelPrefChangedCallback,
mMaxLogLevelPref, this);
@@ -106,9 +106,8 @@ ConsoleLogLevel PrefToValue(const nsACString& aPref,
return aLevel;
}
- int index = FindEnumStringIndexImpl(value.get(), value.Length(),
- ConsoleLogLevelValues::strings);
- if (NS_WARN_IF(index < 0)) {
+ Maybe<ConsoleLogLevel> level = StringToEnum<ConsoleLogLevel>(value);
+ if (NS_WARN_IF(level.isNothing())) {
nsString message;
message.AssignLiteral("Invalid Console.maxLogLevelPref value: ");
message.Append(NS_ConvertUTF8toUTF16(value));
@@ -118,8 +117,7 @@ ConsoleLogLevel PrefToValue(const nsACString& aPref,
return aLevel;
}
- MOZ_ASSERT(index < (int)ConsoleLogLevelValues::Count);
- return static_cast<ConsoleLogLevel>(index);
+ return level.value();
}
void ConsoleInstance::SetLogLevel() {
diff --git a/dom/console/ConsoleUtils.cpp b/dom/console/ConsoleUtils.cpp
index 9767dd30dd..585ff2ec3d 100644
--- a/dom/console/ConsoleUtils.cpp
+++ b/dom/console/ConsoleUtils.cpp
@@ -14,6 +14,7 @@
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/NullPrincipal.h"
#include "mozilla/dom/ConsoleBinding.h"
+#include "mozilla/dom/ConsoleInstanceBinding.h"
#include "mozilla/dom/RootedDictionary.h"
#include "mozilla/dom/ScriptSettings.h"
#include "js/PropertyAndElement.h" // JS_DefineProperty