Bug 1442137 part 2. Remove the now-unused eTypeExternalConstructor global name struct type. r=peterv

MozReview-Commit-ID: qb3mHnC5Ql
This commit is contained in:
Boris Zbarsky 2018-03-21 23:13:27 -04:00
Родитель ec3bea99f1
Коммит abdd583095
3 изменённых файлов: 3 добавлений и 31 удалений

Просмотреть файл

@ -790,8 +790,8 @@ BaseStubConstructor(nsIWeakReference* aWeakOwner,
if (name_struct->mType == nsGlobalNameStruct::eTypeClassConstructor) {
rv = NS_ERROR_NOT_AVAILABLE;
} else {
MOZ_ASSERT(name_struct->mType ==
nsGlobalNameStruct::eTypeExternalConstructor);
MOZ_ASSERT_UNREACHABLE("We have no eTypeExternalConstructor anymore; "
"this code is about to go away");
native = do_CreateInstance(name_struct->mCID, &rv);
}
if (NS_FAILED(rv)) {
@ -920,7 +920,7 @@ private:
static bool IsConstructable(const nsGlobalNameStruct *aNameStruct)
{
return aNameStruct->mType == nsGlobalNameStruct::eTypeExternalConstructor;
return false;
}
const char16_t* mClassName;
@ -1537,26 +1537,6 @@ nsWindowSH::GlobalResolve(nsGlobalWindowInner *aWin, JSContext *cx,
name_struct, nameSpaceManager, nullptr, desc);
}
if (name_struct->mType == nsGlobalNameStruct::eTypeExternalConstructor) {
RefPtr<nsDOMConstructor> constructor;
rv = nsDOMConstructor::Create(class_name, name_struct, aWin->AsInner(),
getter_AddRefs(constructor));
NS_ENSURE_SUCCESS(rv, rv);
JS::Rooted<JS::Value> val(cx);
js::AssertSameCompartment(cx, obj);
rv = nsContentUtils::WrapNative(cx, constructor,
&NS_GET_IID(nsIDOMDOMConstructor), &val,
true);
NS_ENSURE_SUCCESS(rv, rv);
NS_ASSERTION(val.isObject(), "Why didn't we get a JSObject?");
FillPropertyDescriptor(desc, obj, 0, val);
return NS_OK;
}
if (name_struct->mType == nsGlobalNameStruct::eTypeProperty) {
if (!OldBindingConstructorEnabled(name_struct, aWin, cx))
return NS_OK;

Просмотреть файл

@ -222,13 +222,6 @@ nsScriptNameSpaceManager::RegisterClassName(const char *aClassName,
return NS_OK;
}
// If a external constructor is already defined with aClassName we
// won't overwrite it.
if (s->mType == nsGlobalNameStruct::eTypeExternalConstructor) {
return NS_OK;
}
NS_ASSERTION(s->mType == nsGlobalNameStruct::eTypeNotInitialized,
"Whaaa, JS environment name clash!");

Просмотреть файл

@ -24,7 +24,6 @@ struct nsGlobalNameStruct
enum nametype {
eTypeNotInitialized,
eTypeProperty,
eTypeExternalConstructor,
eTypeClassConstructor,
eTypeClassProto,
} mType;