diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index a564e5be04ae..f0d76be8e43d 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -82,10 +82,6 @@ const char* const XPCJSRuntime::mStrings[] = { "value", // IDX_VALUE "QueryInterface", // IDX_QUERY_INTERFACE "Components", // IDX_COMPONENTS - "Cc", // IDX_CC - "Ci", // IDX_CI - "Cr", // IDX_CR - "Cu", // IDX_CU "wrappedJSObject", // IDX_WRAPPED_JSOBJECT "Object", // IDX_OBJECT "Function", // IDX_FUNCTION diff --git a/js/xpconnect/src/XPCWrappedNativeScope.cpp b/js/xpconnect/src/XPCWrappedNativeScope.cpp index 6568cd3135fa..6bbb9ae889f5 100644 --- a/js/xpconnect/src/XPCWrappedNativeScope.cpp +++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp @@ -224,24 +224,6 @@ XPCWrappedNativeScope::ForcePrivilegedComponents() mComponents = new nsXPCComponents(this); } -static bool -DefineSubcomponentProperty(JSContext* aCx, - HandleObject aGlobal, - nsISupports* aSubcomponent, - const nsID* aIID, - unsigned int aStringIndex) -{ - RootedValue subcompVal(aCx); - xpcObjectHelper helper(aSubcomponent); - if (!XPCConvert::NativeInterface2JSObject(&subcompVal, helper, - aIID, false, nullptr)) - return false; - if (NS_WARN_IF(!subcompVal.isObject())) - return false; - RootedId id(aCx, XPCJSContext::Get()->GetStringID(aStringIndex)); - return JS_DefinePropertyById(aCx, aGlobal, id, subcompVal, 0); -} - bool XPCWrappedNativeScope::AttachComponentsObject(JSContext* aCx) { @@ -261,30 +243,7 @@ XPCWrappedNativeScope::AttachComponentsObject(JSContext* aCx) attrs |= JSPROP_PERMANENT; RootedId id(aCx, XPCJSContext::Get()->GetStringID(XPCJSContext::IDX_COMPONENTS)); - if (!JS_DefinePropertyById(aCx, global, id, components, attrs)) - return false; - -// _iid can be nullptr if the object implements classinfo. -#define DEFINE_SUBCOMPONENT_PROPERTY(_comp, _type, _iid, _id) \ - nsCOMPtr obj ## _type; \ - if (NS_FAILED(_comp->Get ## _type(getter_AddRefs( obj ## _type )))) \ - return false; \ - if (!DefineSubcomponentProperty(aCx, global, obj ## _type, _iid, \ - XPCJSContext::IDX_ ## _id)) \ - return false; - - DEFINE_SUBCOMPONENT_PROPERTY(mComponents, Interfaces, nullptr, CI) - DEFINE_SUBCOMPONENT_PROPERTY(mComponents, Results, nullptr, CR) - - if (!c) - return true; - - DEFINE_SUBCOMPONENT_PROPERTY(c, Classes, nullptr, CC) - DEFINE_SUBCOMPONENT_PROPERTY(c, Utils, &NS_GET_IID(nsIXPCComponents_Utils), CU) - -#undef DEFINE_SUBCOMPONENT_PROPERTY - - return true; + return JS_DefinePropertyById(aCx, global, id, components, attrs); } static bool diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index fd09932d305f..9ea3b1731c9f 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -435,10 +435,6 @@ public: IDX_VALUE , IDX_QUERY_INTERFACE , IDX_COMPONENTS , - IDX_CC , - IDX_CI , - IDX_CR , - IDX_CU , IDX_WRAPPED_JSOBJECT , IDX_OBJECT , IDX_FUNCTION , diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js index c8a6f59bb5ac..e3688a250e36 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js @@ -12,15 +12,11 @@ module.exports = { "BrowserFeedWriter": false, "CSSPrimitiveValue": false, "CSSValueList": false, - "Cc": false, "CheckerboardReportService": false, // Specific to Firefox (Chrome code only). "ChromeUtils": false, "ChromeWorker": false, - "Ci": false, "Components": false, - "Cr": false, - "Cu": false, "DOMRequest": false, "DedicatedWorkerGlobalScope": false, "IDBFileRequest": false, diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js index 9d6b094fb814..7c8db86353a3 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js @@ -18,11 +18,6 @@ module.exports = { "btoa": false, "debug": false, "dump": false, - // These globals are defined in XPCWrappedNativeScope::AttachComponentsObject. - "Cc": false, - "Ci": false, - "Cr": false, - "Cu": false, // These globals are made available via WebIDL files, see ResolveSystemBinding in: // https://searchfox.org/mozilla-central/source/__GENERATED__/dom/bindings/ResolveSystemBinding.cpp "AbortController": false,