mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 834732 - Push a cx in AdoptNode. r=mrbkap
This commit is contained in:
parent
138401e1b0
commit
65df4a86fd
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user