Bug 988383 - Part 3: Replace AutoPushJSContext in nsGlobalWindow::DefineArgumentsProperty. r=bholley
authorBob Owen <bobowencode@gmail.com>
Fri, 28 Mar 2014 11:42:13 +0000
changeset 179801 967d37e175edbe9d3fa2436b6d7f0cc4d258e49f
parent 179800 25925f2cb271b7b6e2e5de97ff30d75c1abc3ffd
child 179802 d0e6a58352cdfc6eed4690d0f78ab5e60b6e242b
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersbholley
bugs988383
milestone31.0a1
Bug 988383 - Part 3: Replace AutoPushJSContext in nsGlobalWindow::DefineArgumentsProperty. r=bholley
dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -3273,21 +3273,20 @@ nsGlobalWindow::SetArguments(nsIArray *a
 }
 
 nsresult
 nsGlobalWindow::DefineArgumentsProperty(nsIArray *aArguments)
 {
   MOZ_ASSERT(!mIsModalContentWindow); // Handled separately.
   nsIScriptContext *ctx = GetOuterWindowInternal()->mContext;
   NS_ENSURE_TRUE(aArguments && ctx, NS_ERROR_NOT_INITIALIZED);
-  AutoPushJSContext cx(ctx->GetNativeContext());
-  NS_ENSURE_TRUE(cx, NS_ERROR_NOT_INITIALIZED);
+  AutoJSContext cx;
 
   JS::Rooted<JSObject*> obj(cx, GetWrapperPreserveColor());
-  return GetContextInternal()->SetProperty(obj, "arguments", aArguments);
+  return ctx->SetProperty(obj, "arguments", aArguments);
 }
 
 //*****************************************************************************
 // nsGlobalWindow::nsIScriptObjectPrincipal
 //*****************************************************************************
 
 nsIPrincipal*
 nsGlobalWindow::GetPrincipal()