summaryrefslogtreecommitdiffstats
path: root/xpcom/components/StaticComponents.cpp.in
diff options
context:
space:
mode:
Diffstat (limited to 'xpcom/components/StaticComponents.cpp.in')
-rw-r--r--xpcom/components/StaticComponents.cpp.in15
1 files changed, 12 insertions, 3 deletions
diff --git a/xpcom/components/StaticComponents.cpp.in b/xpcom/components/StaticComponents.cpp.in
index 7f3fee6859..d717b9f64a 100644
--- a/xpcom/components/StaticComponents.cpp.in
+++ b/xpcom/components/StaticComponents.cpp.in
@@ -83,9 +83,14 @@ const nsXPTInterface gInterfaces[] = {
//# @interfaces@
};
+//# @define_has_component_jsms@
+
+#ifdef HAS_COMPONENT_JSMS
+// TODO: Remove this once m-c and c-c migrations finish (bug 1881887).
const StringOffset gComponentJSMs[] = {
//# @component_jsms@
};
+#endif
const StringOffset gComponentESModules[] = {
//# @component_esmodules@
@@ -148,9 +153,9 @@ static nsresult ConstructJSMOrESMComponent(const nsACString& aURI,
(void**)aResult);
}
-static nsresult ConstructJSMComponent(const nsACString& aURI,
- const char* aConstructor,
- nsISupports** aResult) {
+[[maybe_unused]] static nsresult ConstructJSMComponent(const nsACString& aURI,
+ const char* aConstructor,
+ nsISupports** aResult) {
return ConstructJSMOrESMComponent<ComponentType::JSM>(
aURI, aConstructor, aResult);
}
@@ -351,11 +356,15 @@ const StaticProtocolHandler* StaticProtocolHandler::Lookup(const nsACString& aSc
/* static */ already_AddRefed<nsIUTF8StringEnumerator>
StaticComponents::GetComponentJSMs() {
+#ifdef HAS_COMPONENT_JSMS
auto jsms = MakeUnique<nsTArray<nsCString>>(MOZ_ARRAY_LENGTH(gComponentJSMs));
for (const auto& entry : gComponentJSMs) {
jsms->AppendElement(GetString(entry));
}
+#else
+ auto jsms = MakeUnique<nsTArray<nsCString>>(0);
+#endif
nsCOMPtr<nsIUTF8StringEnumerator> result;
MOZ_ALWAYS_SUCCEEDS(NS_NewAdoptingUTF8StringEnumerator(getter_AddRefs(result),