зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1289129. When setting up an AutoJSAPI with a global, make sure to expose that global to active JS. r=mccr8
This commit is contained in:
Родитель
8617edc967
Коммит
3f84f0b441
|
@ -357,6 +357,9 @@ AutoJSAPI::InitInternal(nsIGlobalObject* aGlobalObject, JSObject* aGlobal,
|
|||
// too.
|
||||
mAutoRequest.emplace(mCx);
|
||||
}
|
||||
if (aGlobal) {
|
||||
JS::ExposeObjectToActiveJS(aGlobal);
|
||||
}
|
||||
mAutoNullableCompartment.emplace(mCx, aGlobal);
|
||||
|
||||
ScriptSettingsStack::Push(this);
|
||||
|
|
|
@ -56,7 +56,8 @@ public:
|
|||
// GetGlobalJSObject may return a gray object. If this ever changes so that
|
||||
// it stops doing that, please simplify the code in FindAssociatedGlobal in
|
||||
// BindingUtils.h that does JS::ExposeObjectToActiveJS on the return value of
|
||||
// GetGlobalJSObject.
|
||||
// GetGlobalJSObject. Also, in that case the JS::ExposeObjectToActiveJS in
|
||||
// AutoJSAPI::InitInternal can probably be removed.
|
||||
virtual JSObject* GetGlobalJSObject() = 0;
|
||||
|
||||
// This method is not meant to be overridden.
|
||||
|
|
Загрузка…
Ссылка в новой задаче