add $ array to hold return values from /eval commands
save currentFrameIndex into the frames array, instead of a reference to the current frame.
This commit is contained in:
rginda%netscape.com 2001-04-24 00:45:45 +00:00
Родитель 7682a19921
Коммит 6aaf907808
1 изменённых файлов: 8 добавлений и 3 удалений

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

@ -39,6 +39,8 @@ const jsdIExecutionHook = Components.interfaces.jsdIExecutionHook;
const jsdIValue = Components.interfaces.jsdIValue; const jsdIValue = Components.interfaces.jsdIValue;
const jsdIProperty = Components.interfaces.jsdIProperty; const jsdIProperty = Components.interfaces.jsdIProperty;
var $ = new Array(); /* array to store results from evals in debug frames */
console.scriptHooker = new Object(); console.scriptHooker = new Object();
console.scriptHooker.onScriptLoaded = console.scriptHooker.onScriptLoaded =
function sh_scripthook (cx, script, creating) function sh_scripthook (cx, script, creating)
@ -72,9 +74,11 @@ function debugTrap (cx, state, type)
/* set our default return value */ /* set our default return value */
console.continueCodeStack.push (jsdIExecutionHook.RETURN_CONTINUE); console.continueCodeStack.push (jsdIExecutionHook.RETURN_CONTINUE);
$ = new Array();
console.currentContext = cx; console.currentContext = cx;
console.currentThreadState = state; console.currentThreadState = state;
var frame = console.currentFrame = state.topFrame; console.currentFrameIndex = 0;
var frame = state.topFrame;
/* build an array of frames */ /* build an array of frames */
console.frames = new Array(frame); console.frames = new Array(frame);
@ -103,7 +107,7 @@ function debugTrap (cx, state, type)
if (tn) if (tn)
display (getMsg(MSN_STOP, tn), MT_STOP); display (getMsg(MSN_STOP, tn), MT_STOP);
display (formatStackFrame(console.currentFrame)); display (formatStackFrame(console.frames[console.currentFrameIndex]));
console.jsds.enterNestedEventLoop(); console.jsds.enterNestedEventLoop();
@ -114,9 +118,10 @@ function debugTrap (cx, state, type)
if (tn) if (tn)
display (getMsg(MSN_CONT, tn), MT_CONT); display (getMsg(MSN_CONT, tn), MT_CONT);
$ = new Array();
delete console.currentContext; delete console.currentContext;
delete console.currentThreadState; delete console.currentThreadState;
delete console.currentFrame; delete console.currentFrameIndex;
delete console.frames; delete console.frames;
return console.continueCodeStack.pop(); return console.continueCodeStack.pop();