Bug 1442039 part 13. Remove the now-pointless nsWindowSH::NameStructEnabled. r=peterv

MozReview-Commit-ID: 9lawfsdyyZq
This commit is contained in:
Boris Zbarsky 2018-03-21 23:13:29 -04:00
Родитель fec44334c8
Коммит a885ed36b0
3 изменённых файлов: 10 добавлений и 35 удалений

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

@ -119,17 +119,6 @@ LookupComponentsShim(JSContext *cx, JS::Handle<JSObject*> global,
nsPIDOMWindowInner *win,
JS::MutableHandle<JS::PropertyDescriptor> desc);
// static
bool
nsWindowSH::NameStructEnabled(JSContext* aCx, nsGlobalWindowInner *aWin,
const nsAString& aName,
const nsGlobalNameStruct& aNameStruct)
{
// DOMConstructor is special: creating its proto does not actually define it
// as a property on the global. So we don't want to expose its name either.
return !aName.EqualsLiteral("DOMConstructor");
}
#ifdef RELEASE_OR_BETA
#define USE_CONTROLLERS_SHIM
#endif

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

@ -15,16 +15,11 @@
#include "js/Id.h"
#include "nsIXPConnect.h"
struct nsGlobalNameStruct;
class nsGlobalWindowInner;
class nsGlobalWindowOuter;
class nsWindowSH;
class nsDOMClassInfo
{
friend class nsWindowSH;
public:
static nsresult Init();
static void ShutDown();
@ -44,10 +39,6 @@ protected:
friend class nsGlobalWindowInner;
friend class nsGlobalWindowOuter;
public:
static bool NameStructEnabled(JSContext* aCx, nsGlobalWindowInner *aWin,
const nsAString& aName,
const nsGlobalNameStruct& aNameStruct);
};

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

@ -2942,10 +2942,8 @@ nsGlobalWindowInner::GetOwnPropertyNames(JSContext* aCx, JS::AutoIdVector& aName
// two codepaths. The ones coming from the WebIDLGlobalNameHash will end up
// in the DefineConstructor function in BindingUtils, which always defines
// things as non-enumerable. The ones coming from the script namespace
// manager get defined by nsDOMClassInfo::PostCreatePrototype calling
// ResolvePrototype and using the resulting descriptot to define the
// property. ResolvePrototype always passes 0 to the FillPropertyDescriptor
// for the property attributes, so all those are non-enumerable as well.
// manager get defined by our resolve hook using FillPropertyDescriptor with
// 0 for the property attributes, so non-enumerable as well.
//
// So in the aEnumerableOnly case we have nothing to do.
return;
@ -2978,17 +2976,14 @@ nsGlobalWindowInner::GetOwnPropertyNames(JSContext* aCx, JS::AutoIdVector& aName
for (auto i = nameSpaceManager->GlobalNameIter(); !i.Done(); i.Next()) {
const GlobalNameMapEntry* entry = i.Get();
if (nsWindowSH::NameStructEnabled(aCx, this, entry->mKey,
entry->mGlobalName)) {
// Just append all of these; even if they get deleted our resolve hook
// just goes ahead and recreates them.
JSString* str = JS_AtomizeUCStringN(aCx,
entry->mKey.BeginReading(),
entry->mKey.Length());
if (!str || !aNames.append(NON_INTEGER_ATOM_TO_JSID(str))) {
aRv.NoteJSContextException(aCx);
return;
}
// Just append all of these; even if they get deleted our resolve hook
// just goes ahead and recreates them.
JSString* str = JS_AtomizeUCStringN(aCx,
entry->mKey.BeginReading(),
entry->mKey.Length());
if (!str || !aNames.append(NON_INTEGER_ATOM_TO_JSID(str))) {
aRv.NoteJSContextException(aCx);
return;
}
}
}