mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-05 12:05:22 +00:00
Bug 932837 followup. Don't use AutoJSContext in JSStackFrame, since we use that code on workers too. r=bholley pending, but landing now to fix the CLOSED TREE.
This commit is contained in:
parent
1dddb1a066
commit
ddc5cc6b61
@ -386,7 +386,10 @@ JSStackFrame::GetFilename()
|
||||
if (!mFilenameInitialized) {
|
||||
JS::FrameDescription& desc = mStackDescription->FrameAt(mIndex);
|
||||
if (desc.script()) {
|
||||
AutoJSContext cx;
|
||||
// This cx dance is silly, since JS_GetScriptFilename ignores
|
||||
// its cx argument.
|
||||
JSContext* cx = nsContentUtils::GetDefaultJSContextForThread();
|
||||
JSAutoRequest ar(cx);
|
||||
JSAutoCompartment ac(cx, desc.script());
|
||||
const char* filename = JS_GetScriptFilename(cx, desc.script());
|
||||
if (filename) {
|
||||
@ -422,7 +425,8 @@ JSStackFrame::GetFunname()
|
||||
if (!mFunnameInitialized) {
|
||||
JS::FrameDescription& desc = mStackDescription->FrameAt(mIndex);
|
||||
if (desc.fun() && desc.script()) {
|
||||
AutoJSContext cx;
|
||||
JSContext* cx = nsContentUtils::GetDefaultJSContextForThread();
|
||||
JSAutoRequest ar(cx);
|
||||
JSAutoCompartment ac(cx, desc.script());
|
||||
JS::Rooted<JSFunction*> fun(cx, desc.fun());
|
||||
JS::Rooted<JSString*> funid(cx, JS_GetFunctionDisplayId(fun));
|
||||
|
Loading…
Reference in New Issue
Block a user