зеркало из https://github.com/mozilla/gecko-dev.git
Bug 626830 - Allow JSD to turn on debugging when no JS code is running, not just when XPConnect stack is completely empty, r=dmandelin
--HG-- extra : rebase_source : 3f177904d2708642dfec8d5937964ec8fc83427a
This commit is contained in:
Родитель
3d8f4dd57d
Коммит
b42bfa59ab
|
@ -2498,14 +2498,19 @@ nsXPConnect::Push(JSContext * cx)
|
|||
if(!data)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
PRInt32 count;
|
||||
nsresult rv;
|
||||
rv = data->GetJSContextStack()->GetCount(&count);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
if (count == 0)
|
||||
CheckForDebugMode(mRuntime->GetJSRuntime());
|
||||
if (gDebugMode != gDesiredDebugMode && NS_IsMainThread()) {
|
||||
const nsTArray<XPCJSContextInfo>* stack = data->GetJSContextStack()->GetStack();
|
||||
bool runningJS = false;
|
||||
for (PRUint32 i = 0; i < stack->Length(); ++i) {
|
||||
JSContext *cx = (*stack)[i].cx;
|
||||
if (cx && cx->regs) {
|
||||
runningJS = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!runningJS)
|
||||
CheckForDebugMode(mRuntime->GetJSRuntime());
|
||||
}
|
||||
|
||||
return data->GetJSContextStack()->Push(cx);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче