зеркало из https://github.com/mozilla/gecko-dev.git
Bug 834732 - Push a cx in AdoptNode. r=mrbkap
This commit is contained in:
Родитель
fccb0b2112
Коммит
c0f7851ce3
|
@ -6174,6 +6174,7 @@ private:
|
|||
*/
|
||||
static nsresult
|
||||
GetContextAndScope(nsIDocument* aOldDocument, nsIDocument* aNewDocument,
|
||||
nsCxPusher& aPusher,
|
||||
JSContext** aCx, JSObject** aNewScope)
|
||||
{
|
||||
MOZ_ASSERT(aOldDocument);
|
||||
|
@ -6216,6 +6217,9 @@ GetContextAndScope(nsIDocument* aOldDocument, nsIDocument* aNewDocument,
|
|||
}
|
||||
}
|
||||
|
||||
if (cx) {
|
||||
aPusher.Push(cx);
|
||||
}
|
||||
if (!newScope && cx) {
|
||||
JS::Value v;
|
||||
nsresult rv = nsContentUtils::WrapNative(cx, global, aNewDocument,
|
||||
|
@ -6349,8 +6353,9 @@ nsIDocument::AdoptNode(nsINode& aAdoptedNode, ErrorResult& rv)
|
|||
|
||||
JSContext *cx = nullptr;
|
||||
JSObject *newScope = nullptr;
|
||||
nsCxPusher pusher;
|
||||
if (!sameDocument) {
|
||||
rv = GetContextAndScope(oldDocument, this, &cx, &newScope);
|
||||
rv = GetContextAndScope(oldDocument, this, pusher, &cx, &newScope);
|
||||
if (rv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче