mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 382917 - "Display script filename and line number in Stop Script dialog" [p=manish@flock.com (Manish Singh) r+sr=mrbkap a1.9=jst]
This commit is contained in:
parent
f786e11862
commit
b73dd5561e
@ -38,6 +38,7 @@
|
||||
KillScriptTitle=Warning: Unresponsive script
|
||||
KillScriptMessage=A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
|
||||
KillScriptWithDebugMessage=A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.
|
||||
KillScriptLocation=Script: %S
|
||||
StopScriptButton=Stop script
|
||||
DebugScriptButton=Debug script
|
||||
WaitForScriptButton=Continue
|
||||
|
@ -938,6 +938,35 @@ nsJSContext::DOMBranchCallback(JSContext *cx, JSScript *script)
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
// Append file and line number information, if available
|
||||
if (script) {
|
||||
const char *filename = ::JS_GetScriptFilename(cx, script);
|
||||
if (filename) {
|
||||
nsXPIDLString scriptLocation;
|
||||
NS_ConvertUTF8toUTF16 filenameUTF16(filename);
|
||||
const PRUnichar *formatParams[] = { filenameUTF16.get() };
|
||||
rv = bundle->FormatStringFromName(NS_LITERAL_STRING("KillScriptLocation").get(),
|
||||
formatParams, 1,
|
||||
getter_Copies(scriptLocation));
|
||||
|
||||
if (NS_SUCCEEDED(rv) && scriptLocation) {
|
||||
msg.AppendLiteral("\n\n");
|
||||
msg.Append(scriptLocation);
|
||||
|
||||
JSStackFrame *fp, *iterator = nsnull;
|
||||
fp = ::JS_FrameIterator(cx, &iterator);
|
||||
if (fp) {
|
||||
jsbytecode *pc = ::JS_GetFramePC(cx, fp);
|
||||
if (pc) {
|
||||
PRUint32 lineno = ::JS_PCToLineNumber(cx, script, pc);
|
||||
msg.Append(':');
|
||||
msg.AppendInt(lineno);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PRInt32 buttonPressed = 1; //In case user exits dialog by clicking X
|
||||
PRBool neverShowDlgChk = PR_FALSE;
|
||||
PRUint32 buttonFlags = (nsIPrompt::BUTTON_TITLE_IS_STRING *
|
||||
|
Loading…
Reference in New Issue
Block a user