bug 103804, "Venkman doesn't like stopping in timeouts", r=jband, sr=shaver

move from setTimeout to the new enterNestedEventLoop callback
some strict mode changes
fix file/line regexps
This commit is contained in:
rginda%netscape.com 2001-10-10 06:38:25 +00:00
Родитель a56cf30d34
Коммит f6ea7f8d8d
2 изменённых файлов: 24 добавлений и 15 удалений

Просмотреть файл

@ -70,6 +70,8 @@ console._executionHook = {
onExecute: function exehook (frame, type, rv) {
if (frame.script && frame.script.fileName != MSG_VAL_CONSOLE)
return debugTrap(frame, type, rv);
ASSERT (frame.script, "Execution hook called with no script");
return jsdIExecutionHook.RETURN_CONTINUE;
}
};
@ -348,9 +350,8 @@ function debugTrap (frame, type, rv)
console.frames.push(frame);
}
setTimeout (console.onDebugTrap, 100, type);
console.jsds.enterNestedEventLoop();
console.trapType = type;
console.jsds.enterNestedEventLoop({onNest: console.onDebugTrap});
/* execution pauses here until someone calls
* console.dbg.exitNestedEventLoop()
@ -370,7 +371,8 @@ function debugTrap (frame, type, rv)
$ = new Array();
clearCurrentFrame();
delete console.frames;
delete console.trapType;
console.onDebugContinue();
return console._continueCodeStack.pop();

Просмотреть файл

@ -106,9 +106,10 @@ function con_reload ()
}
console.onDebugTrap =
function con_ondt (type)
function con_ondt ()
{
var frame = setCurrentFrameByIndex(0);
var type = console.trapType;
if (type != jsdIExecutionHook.TYPE_INTERRUPTED ||
console._lastStackDepth != console.frames.length)
@ -155,10 +156,20 @@ function con_fchanged (currentFrame, currentFrameIndex)
if (currentFrame)
{
var frame = stack.childData[currentFrameIndex];
var vr = frame.calculateVisualRow();
var frameRecord = stack.childData[currentFrameIndex];
var vr = frameRecord.calculateVisualRow();
console.stackView.selectedIndex = vr;
console.stackView.scrollTo (vr, 0);
var source = console.scripts[currentFrame.script.fileName];
if (source)
{
console.sourceView.displaySource(source);
console.sourceView.softScrollTo(currentFrame.line);
}
else
{
dd ("frame from unknown source");
}
}
else
{
@ -166,10 +177,6 @@ function con_fchanged (currentFrame, currentFrameIndex)
stack.childData = new Array();
stack.hide();
}
console.sourceView.outliner.invalidate(); /* invalidate to show the new
* currentLine */
return;
}
console.onInputCommand =
@ -229,7 +236,7 @@ function cli_ibreak(e)
return true;
}
var ary = e.inputData.match(/([^\s\:]+)\:?\s*(\d+)\s*$/);
var ary = e.inputData.match(/([^\s]+)\s*(\d+)\s*$/);
if (!ary)
{
console.displayUsageError(e.commandEntry);
@ -253,7 +260,7 @@ function cli_ibreak(e)
console.onInputClear =
function cli_iclear (e)
{
var ary = e.inputData.match(/(\d+)|([^\s\:]+)\:?\s*(\d+)\s*$/);
var ary = e.inputData.match(/(\d+)|([^\s]+)\s*(\d+)\s*$/);
if (!ary)
{
console.displayUsageError(e.commandEntry);
@ -382,7 +389,7 @@ function cli_ifbreak(e)
return true;
}
var ary = e.inputData.match(/([^\s\:]+)\:?\s*(\d+)\s*$/);
var ary = e.inputData.match(/([^\s]+)\s*(\d+)\s*$/);
if (!ary)
{
console.displayUsageError(e.commandEntry);
@ -663,7 +670,7 @@ function con_stacksel (e)
ASSERT (0, "bogus row index " + rowIndex);
return;
}
var source;
var sourceView = console.sourceView;