mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 889714 - Reduce the number of places where we pull |env| off cx. r=mrbkap
This commit is contained in:
parent
848172cd58
commit
83d40fbac1
@ -487,14 +487,16 @@ typedef enum JSShellErrNum
|
||||
#undef MSGDEF
|
||||
} JSShellErrNum;
|
||||
|
||||
static void
|
||||
ProcessFile(JSContext *cx,
|
||||
JS::Handle<JSObject*> obj,
|
||||
const char *filename,
|
||||
FILE *file,
|
||||
JSBool forceTTY)
|
||||
} /* anonymous namespace */
|
||||
|
||||
void
|
||||
XPCShellEnvironment::ProcessFile(JSContext *cx,
|
||||
JS::Handle<JSObject*> obj,
|
||||
const char *filename,
|
||||
FILE *file,
|
||||
JSBool forceTTY)
|
||||
{
|
||||
XPCShellEnvironment* env = Environment(cx);
|
||||
XPCShellEnvironment* env = this;
|
||||
nsCxPusher pusher;
|
||||
pusher.Push(env->GetContext());
|
||||
|
||||
@ -599,8 +601,6 @@ ProcessFile(JSContext *cx,
|
||||
fprintf(stdout, "\n");
|
||||
}
|
||||
|
||||
} /* anonymous namespace */
|
||||
|
||||
NS_IMETHODIMP_(nsrefcnt)
|
||||
XPCShellDirProvider::AddRef()
|
||||
{
|
||||
@ -811,7 +811,7 @@ bool
|
||||
XPCShellEnvironment::EvaluateString(const nsString& aString,
|
||||
nsString* aResult)
|
||||
{
|
||||
XPCShellEnvironment* env = Environment(mCx);
|
||||
XPCShellEnvironment* env = this;
|
||||
nsCxPusher pusher;
|
||||
pusher.Push(env->GetContext());
|
||||
|
||||
|
@ -28,6 +28,8 @@ public:
|
||||
static XPCShellEnvironment* CreateEnvironment();
|
||||
~XPCShellEnvironment();
|
||||
|
||||
void ProcessFile(JSContext *cx, JS::Handle<JSObject*> obj,
|
||||
const char *filename, FILE *file, JSBool forceTTY);
|
||||
bool EvaluateString(const nsString& aString,
|
||||
nsString* aResult = nullptr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user