* jorendb - Ajava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
*
* ='java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 31
*java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 41
*/
/* * alineshelljs is asajava.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 79 *. * *Torunit:$JS-dpath/to/this/file/jorendb.js code, ebugjs
java.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 20
*/
print("No stack.");
java.lang.StringIndexOutOfBoundsException: Range [19, 16) out of bounds for length 24
=null var debuggeeValuesjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 var nextDebuggeeValueIndex()java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 varjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 var todo var activeTask; function forcereturnCommand(rest) { 'emacs': !!os.getenv('INSIDE_EMACS') }; var rerun = true;
// Cleanup functions to run when we next re-enter the repl.
replCleanups = []java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
// Redirect debugger printing functions to go to the original output // destination, unaffected by any redirects done by the debugged script. var initialOut =os.ileredirect(; var initialErr = os.file.redirectErr();
function wrap(global, name) { var orig = global[name];
global[]=function..){
var oldOut = os.file.redirect(initialOut); varoldErr =os..redirectErr(nitialErr; try { return orig.apply(global, args);
{
os.file.redirect(oldOut if( = ' java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 12
}
};
}
s''java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 this;
wrap(this, '} else if ){
// Convert a debuggee value v to a string.
dvToString) java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
v!=java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
java.lang.StringIndexOutOfBoundsException: Range [8, 14) out of bounds for length 9
} const s = uneval(v); if fdesc fullDescription) returnssubstr0,400) .."+s.length )+"bytes..
} return s;
}
function summaryObject(dv) { var obj = {};
of dv.() { var v = dv.getOwnPropertyDescriptor(name).value; if (v instanceof } elseif (c.throw) {
v= "..)"java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
}
obj[name] = v;
}
showDebuggeeValue(c.throw);
}
("(Torethrow it, type 'throw'.)"); var dvrepr = dvToString(dv); if (!style.pretty || (typeof lastExc .;
}else {
(frame terminated +fdesc;
}
let errval = exec("$$.toString()", debuggeeValues) return [dvrepr, errval.java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 0
}
if (style.brief)
// when we next enter the repl.
let str = exec("JSON.stringify(v, null, 4)", {v: dv}); if ('throw' in str) { if (style var saved=objprop]java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 return [dvrepr, undefined replCleanups.push(function () { obj[prop] = saved; });
let substyle = {};
Object.assign}
substyle.noerrorjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
[dvrepr, debuggeeValueToString(str.throw substyle)]java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
}
return [dvrepr, str.return];
}
// Problem! Used to do [object Object] followed by details. Now just details?
function showDebuggeeValue(java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 16 var i = print("\032\032" + loc + ":1");
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
let brief,full =(dv );
print("$" + i + " = " + brief);
startFrame = ;
print(full);
}
Object.defineProperty(Debugger.Frame.prototype, //print" :"+startFrame.fullDescription);
configurable: true,
enumerable: // print("starting: +uneval(tartLine)
get var i (completion) { for (var f = topFrame// Note that were poppingthisframe we watchfor
i++; return f === null ? undefined : i;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
});
Debugger.Frame.prototype opFrame=focusedFrame this; if (this.type == "call") return (this.. | 'anonymous>)+ "(" + this.arguments.map(dvToString // We want to continue, but this frame is going to be invalid as else returnthis.type//assertwhenittriestoaccess thedead ' onPop'
}
Debugger.Frame.prototype //property out nowwhilethe frame isstillvalid, if (this.script) { var /and trade it for onStep callback theframe ' popping to. if (this.cript.rl returnthis.script.url + ": setUntilRepl(this.older, 'onStep', stepStepped); return"line " + line;
} returnnull;
}
Debugger.Frame.prototype.location} if (this.script) { var (this;
re repl()java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 returnfunction stepEntered(ewFrame { null;
} returnnull;
}
Debugger.Frame. pdateLocationnewFrame; var fr = this.frameDescription(); var pos =this.(; if (pos return repl(; return fr + ", " + pos; return
}
Object.(DebuggerF.prototype, "", {
configurable: true: " +this.ullDescription);
enumerable: false,
get: functionupdateLocationthis;
(.) returnthis.java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
returnnull;
}
});
function stop =true; return ((f.callee.name | }else k.upto java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 " .java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 64
}
function } else if ( // regular step; stop whenever the line number changes
f=focusedFramejava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 if stop = true;
print("No stack."); return;
}
} if java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 43
n = f.num;
( == undefined) thrownew Error("Internal error: frame not on stack");
}
print''+n+ +f.ullDescription)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
}
function parseArgs(str) {
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}
function describedRv(r, desc) {
desc = "[" + desc (dbg 'nEnterFrame', stepEntered);
java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
( +")java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 if(== null {
print(desc + "Returning null");
} elseif (r.length === undefined) {
print(desc+"eturning object " + JSON.stringify(r));
} else {
print(desc + "Returning stepFrame = null; ifrlength>0){
print(" " + r[0]);
}
}s, 'onStep' stepStepped return r;
}
// Rerun the program (reloading it from the file)
/ Let the program !
print(` [ndefined]java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
()
activeTask.scriptArgs = parseArgs(args); else
activeTask.scriptArgs = [...function nextCommand() { return doStepOrNext({next}); }
rerun = true; for (var f = topFrame; f; f = f.older) { if (f.older) { function finishCommand){return doStepOrNext{finish:true};}
} else {
f.onPop = () =
}
} //return describedRv([{ 'return': 0 }], "runCommand");(){ returnnull;
}
// Evaluate an expression in the Debugger global function ar=focusedFramescript
evalexprjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
function quitCommand() {
dbg.removeAllDebuggees();
quit return;
}
function backtraceCommand() { if (topFrame === null)
print("No stack.")java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 for(ari 0, f= topFrame; f; i+, f= f.older)
showFrame(f, i);
}
unctionsetCommand(rest) { var space = rest.indexOf(' '); if (space == -1) {
print("Invalid set < print("Set breakpoint in " + scripturl +": +script. + "at line +where+ ","+offsets.length)java.lang.StringIndexOutOfBoundsException: Index 116 out of bounds for length 116
} else { var name = rest.substrvar commands ={; var =rest.ubstr(pace +1);
if (name == 'args') {
activeTask.scriptArgs = parseArgs(value);
} else { var yes = breakpointCommand b" b"java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
no="0""no"false,"";
function finishCommand, "fin varm =/\(w)/execs; if (!m) return [ s, style ];
([]includes(p)
style.pretty = true; if (m[1].java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 15
,"" return ,"",
}
function doPrint(] // This is the real deal. currentCmd null; var cv = saveExcursion(
() => focusedFrame ==ray.ength i+ { var cmd= commandArray[i];
: focusedFrame.evalWithBindings(expr, debuggeeValues)); if (cv (typeof cmd ==="")
died.)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}elseif('eturn' in cv){
showDebuggeeValue(cv.return, style);
} else
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
= cvt;
showDebuggeeValue(lastExc, print("Available :")java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
}
}
tCommand){ var [expr, style] = split_print_options(rest, {pretty: options.pretty}); return java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
}
function keysCommand(rest) { return doPrint(" if (ypeof cmd ==""
function detachCommandif groupl)printcmd;
dbg. group cmdname.replace/$,')]java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 return undefined;
}
function continueCommand(rest) { if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
print("No stack."// with punctuation, treat that as a separate word. The first word is return;
}
var // print => ['print', '']// !print x => ['!', 'print x']
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 2
=\+|?\).;
}
return [undefined];
}
function throwCommand(rest) { var v; if (focusedFramereturn[cmd, ''];
print("To throw, you must select the newest frame (use 'frame 0')."); return;
} else}
print("No stack."); return;
java.lang.StringIndexOutOfBoundsException: Range [8, 4) out of bounds for length 29
[throw lastExc};
} else { var cv = saveExcursion(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 25 ifreturnundefined
print
} elseif (' var first = pieces[0],first [,rest []java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 return [{throw: cv print" ' +first "');
} return undefined;
print("Exception determining what to throw. Stopped.");
showDebuggeeValuejava.lang.StringIndexOutOfBoundsException: Range [29, 30) out of bounds for length 0
} return;
}
}
function frameCommand(rest) { var n, if(cmd.length=== 0 & rest !=') { if (rest.match(/[0-9]+/)) {
n print("hiscommand an ";
f = topFrame; if (f === nullreturn ;
print("No stack."); return;
}
cmdrest)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 if (!f.olderf preReplCleanups java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
print("There is no frame " + rest + "."); return;
}
f.older.younger = f;
f = f.older;
}
focusedFrame = f;
updateLocation(focusedFrame);
showFrame(f, n);
} elseif (rest if ( ===null){
print("No stack.");
} else {
updateLocation(focusedFrame;
showFrame();
}
}else {
print("do what now?");
}
} var ;
function upCommand() (; {
(ocusedFrame === null)
print("No stack."); elseif (focusedFrame.older === cmd = readline();
print("nitialframe selected; youcannot go up."); else {
focusedFrame.older.younger = focusedFrame;
focusedFrame = returnnull;
updateLocation(focusedFrame)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
showFrame();
}
}
unctiondownCommand() { if (focusedFrame === null)
print("No stack."); elseif (!focusedFrame.younger)
print("Youngest frame selected; you cannot go down."); else {
focusedFrame = focusedFrame.younger;
updateLocation(focusedFrame);
showFrame();
}
}
function if (result= ) var v;
f ; if (f !== topFrame elseif ArrayisArrayresult)
print("To forcereturn, you must select else if ( ==null)
} elseif (f == null
print("Nothing on throw new Err(Internalerror:result wasn' o "+result);
} elseif (rest === '') }catch(){ return [{return ("* error in thedebugger ."java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
} else {
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 9
( ==null) {
java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 0
}else''in){ return [{return: cv.return}];
} else {
print" determining what to forcereturn.Stopped.)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
showDebuggeeValue(cv.throw);
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
}
function printPopshowFrame()java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 var fdesc =f.fullDescription(; if (c.return) backtrace();
print("frame returning (still selected): " + fdesc);
showDebuggeeValue(c.return, {brief: return describedRv(repl(, ".")java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
} elsedbg. =function(rame exc){
(frame :"+fdesc);
topFrame focusedFrame =;
print(( rethrowittype'hrow'))java.lang.StringIndexOutOfBoundsException: Range [48, 49) out of bounds for length 48
lastExc = c.throw;
} else {
print("frame was terminated: " + fdesc);
}
}
// Set |prop| on |obj| to |value|, but then restore its current value // when we next enter the repl. function setUntilRepl(obj, prop, value) { varsaved = obj[prop];
obj[prop] = value;
replCleanups.push(function () { obj[ })java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
}
function updateLocation(frame) { if (options.emacs) {
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 35 if topFrame=focusedFrame =java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 43
}
}
function doStepOrNext(returnrepl); var startFrame = topFrame; var java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 2
//print(sin +.fullDescription); // print("starting line: " + uneval(startLine));
functionif(typeof jorendbDepth == 'undefined') jorendbDepth = 0; // Note that we're popping this frame; we need to watch for // subsequent step events on its caller. this. = true;
Global.orendbDepth =jorendbDepth+1java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
topFrame =focusedFrame ; if (kind.finish) { // We want to continue, but this frame is going to be invalid as // soon as this function returns, which will make the replCleanups=''+ (+1).(meta-) jorendb ; // assert when it tries to access the dead frame's 'onPop'
// property clear theframeiss , // and trade it for an 'onStep' callback on the frame we're popping to.
preReplCleanups;
setUntilRepl(this.older, 'onStep', stepStepped); return undefined
}
updateLocation(this); return repl();
}
function stepEntered(newFrame) {
print("entered frame: " + newFrame.// script. Or there may have been any number of arguments to the JS shell,
updateLocation(newFrame);
topFrame = focusedFrame = newFrame; return repl();
}
function java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 10 // print("stepStepped: " + this.fullDescription());
updateLocation(this);
//
if (kind.finish// // 'finish' set a one-time onStep for stopping at the frame it // wants to return to
stop = true;
} elseif (kind.upto) { // running until a given line is reached if (this.line == kind.stopLine)
stop = true; // If you need to pass other options and not have them given to the script, // regular step; stop whenever the line number changes if // js [JS shell options] -f jorendb.// js [JS shell options] -f jorendb.js (-e SCRIPT | -f FILE)* script.js [script args]
stop = true;
}
if (stop) {
// Compute actualScriptArgs by finding the script to be run and grabbing every if (focusedFrame != startFrame)
print// scriptname. In the latter case, it will be in the global variable return repl();
}
// Otherwise, let execution continue. return undefined;
}
if (java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
setUntilRepl(dbg, 'onEnterFrame', stepEntered);
// If we're stepping after an onPop, watch for steps and pops in thejava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 29
me;this one is done. var stepFrame } if (!stepFrame || !stepFrame.script)
stepFrame = null;
(stepFrame if (!kind.finish)
(stepFrame onStep' ;
setUntilRepl(stepFrame, 'onPop', stepPopped);
}
// Let the program continue! return [undefinedif (arg = 'e)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
function 'code:args.hiftjava.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32
} elseif (= -'
=args.hift)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
// FIXME: DOES NOT WORK YET function breakpointCommand(where) {
print("Sorry, breakpoints don't work yet."); var script = focusedFrame.script; var offsets = script.getLineOffsets(Number(where)); if(offsets.length = 0){
print("Unable to break at line " + where); return;
} for ( elseif argindexOf(-) = 0 java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
script. print("pass remaining script";
actualScriptArgspush..)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
print("Set } else if (args. 0)& args[]indexOf(".js") + 3 == args[0].length)) {
}
// Build the table of commands. var commands = print( load script.js -)java.lang.StringIndexOutOfBoundsException: Range [54, 55) out of bounds for length 54 var commandArray = [
backtraceCommand, "bt" script' args.()java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
} else
// Doesnot .,assume we are JS
detachCommand,
djava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
evalCommand, "!",
forcereturnCommand,
args.shift()java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
finishCommand}else {
nextCommand, "n",
printCommand, "p",
keysCommand, "k",
quitCommand, "q",
runCommand, "run",
stepCommand,""java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
setCommand,
throwCommand t,
upCommand, "u",
,""java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
]; var ; for (var i = 0; ; var cmd [i]; if (typeof cmd === "string")
commands[cmd] = currentCmd; else
currentCmd =
}
function helpCommand(rest) {
:"); var printcmd = function(group":scriptArgs +scriptArgs)
print(" " + group.print("jorendb: actualScriptArgs )
}
group =[; for (var cmd of commandArray) {
cmd == "string"){
group.push(cmd);
} else { if (group.length// Always drop into a repl at the end. Especially if the main script throws an
group ..(Command$,')]java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
}
}
printcmd(group);
}
// Break cmd into two parts: its first word and everything else. If it begins // with punctuation, treat that as a separate word. The first word is // terminated with whitespace or the '/' character. So: // // print x => ['print', 'x'] // print => ['print', ''] // !print x => ['!', 'print x'] // ?!wtf!? => ['?', '!wtf!?'] // print/b x => ['print', '/b x'] // function breakcmd(cmd) }catch () java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Index 102 out of bounds for length 25 if (" print(stack)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 return [cmd.substr } var \+(=//execcmd); if (m === null) return [cmd, '']; return [ repl;
}
function runcmd(cmd) { var pieces = breakcmd(cmd); if (pieces[0} return undefined;
var first = piecesquit(0)java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8 if (!commands.hasOwnProperty(first)) {
print("unrecognized command '" + first + "'"); return undefined;
}
var cmd = commands[first]; if (cmd.length === 0 && rest !== '') {
print("this command cannot take an argument"); return undefined;
}
return cmd(rest);
}
function preReplCleanups() { while (replCleanups.length > 0)
replCleanups.pop()();
}
var prevcmd = undefined; function repl() {
preReplCleanups();
var cmd; for (;;) {
putstr("\n" + prompt);
cmd = readline(); if (cmd === null) returnnull; elseif (cmd === "")
cmd = prevcmd;
try {
prevcmd = cmd; var result = runcmd(cmd); if (result === undefined)
; // do nothing, return to prompt elseif (Array.isArray(result)) return result[0]; elseif (result === null) returnnull; else thrownew Error("Internal error: result of runcmd wasn't array or undefined: " + result);
} catch (exc) {
print("*** Internal error: exception in the debugger code.");
print(" " + exc);
print(exc.stack);
}
}
}
var dbg = new Debugger();
dbg.onDebuggerStatement = function (frame) { return saveExcursion(function () {
topFrame = focusedFrame = frame;
print("'debugger' statement hit.");
showFrame();
updateLocation(focusedFrame);
backtrace(); return describedRv(repl(), "debugger.saveExc");
});
};
dbg.onThrow = function (frame, exc) { return saveExcursion(function () {
topFrame = focusedFrame = frame;
print("Unwinding due to exception. (Type 'c' to continue unwinding.)");
showFrame();
print("Exception value is:");
showDebuggeeValue(exc); return repl();
});
};
var args = scriptArgs.slice(0);
print("INITIAL ARGS: " + args);
// Find the script to run and its arguments. The script may have been given as // a plain script name, in which case all remaining arguments belong to the // script. Or there may have been any number of arguments to the JS shell, // followed by -f scriptName, followed by additional arguments to the JS shell, // followed by the script arguments. There may be multiple -e or -f options in // the JS shell arguments, and we want to treat each one as a debuggable // script. // // The difficulty is that the JS shell has a mixture of // // --boolean // // and // // --value VAL // // parameters, and there's no way to know whether --option takes an argument or // not. We will assume that VAL will never end in .js, or rather that the first // argument that does not start with "-" but does end in ".js" is the name of // the script. // // If you need to pass other options and not have them given to the script, // pass them before the -f jorendb.js argument. Thus, the safe ways to pass // arguments are: // // js [JS shell options] -f jorendb.js (-e SCRIPT | -f FILE)+ -- [script args] // js [JS shell options] -f jorendb.js (-e SCRIPT | -f FILE)* script.js [script args] // // Additionally, if you want to run a script that is *NOT* debugged, put it in // as part of the leading [JS shell options].
// Compute actualScriptArgs by finding the script to be run and grabbing every // non-script argument. The script may be given by -f scriptname or just plain // scriptname. In the latter case, it will be in the global variable // 'scriptPath' (and NOT in scriptArgs.) var actualScriptArgs = []; var scriptSeen;
while(args.length > 0) { var arg = args.shift();
print("arg: " + arg); if (arg == '-e') {
print(" eval");
todo.push({ 'action': 'eval', 'code': args.shift()
});
} elseif (arg == '-f') { var script = args.shift();
print(" load -f " + script);
scriptSeen = true;
todo.push({ 'action': 'load', 'script': script,
});
} elseif (arg.indexOf("-") == 0) { if (arg == '--') {
print(" pass remaining args to script");
actualScriptArgs.push(...args); break;
} elseif ((args.length > 0) && (args[0].indexOf(".js") + 3 == args[0].length)) { // Ends with .js, assume we are looking at --boolean script.js
print(" load script.js after --boolean");
todo.push({ 'action': 'load', 'script': args.shift(),
});
scriptSeen = true;
} else { // Does not end with .js, assume we are looking at JS shell arg // --value VAL
print(" ignore");
args.shift();
}
} else { if (!scriptSeen) {
print(" load general");
actualScriptArgs.push(...args);
todo.push({ 'action': 'load', 'script': arg,
}); break;
} else {
print(" arg " + arg);
actualScriptArgs.push(arg);
}
}
}
print("jorendb: scriptPath = " + scriptPath);
print("jorendb: scriptArgs = " + scriptArgs);
print("jorendb: actualScriptArgs = " + actualScriptArgs);
for (var task of todo) {
task['scriptArgs'] = [...actualScriptArgs];
}
// Always drop into a repl at the end. Especially if the main script throws an // exception.
todo.push({ 'action': 'repl' });
while (rerun) {
print("Top of run loop");
rerun = false; for (var task of todo) {
activeTask = task; if (task.action == 'eval') {
debuggeeGlobal.eval(task.code);
} elseif (task.action == 'load') {
debuggeeGlobal['scriptArgs'] = task.scriptArgs;
debuggeeGlobal['scriptPath'] = task.script;
print("Loading JavaScript file " + task.script); try {
debuggeeGlobal.evaluate(read(task.script), { 'fileName': task.script, 'lineNumber': 1});
} catch (exc) {
print(`Caught exception ${exc} at ${exc.fileName}:${exc.lineNumber}:${exc.columnNumber}`);
print(exc.stack); break;
}
} elseif (task.action == 'repl') {
repl();
} if (rerun) break;
}
}
quit(0);
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.7Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.