private static void notifyDebugger_r(Context cx, DebuggableScript dscript, String debugSource) { cx.debugger.handleCompilationDone(cx, dscript, debugSource); for (int i = 0; i != dscript.getFunctionCount(); ++i) { notifyDebugger_r(cx, dscript.getFunction(i), debugSource); } }
public void onExit(Context cx, boolean byThrow, Object resultOrException) { if (byThrow) { String name = null; if (script.isFunction()) { name = script.getFunctionName(); } else { name = "[script]"; } if (locations == null) { locations = new ArrayList(1); // start small } locations.add(new LocationImpl(name, script.getSourceName(), line, -1)); } else if (locations != null) { // The exception was handled by the script: clear any recorded locations locations = null; } } }
/** * Called when compilation is finished. */ public void handleCompilationDone(Context cx, DebuggableScript fnOrScript, String source) { if (type != IPROXY_DEBUG) Kit.codeBug(); if (!fnOrScript.isTopLevel()) { return; } dim.registerTopScript(fnOrScript, source); } }
int[][] lineArrays = new int[N][]; for (int i = 0; i != N; ++i) { lineArrays[i] = functions[i].getLineNumbers(); String name = functions[i].getFunctionName(); if (name == null) { name = "";
private void print(int row) { RhinoJavascriptDebugExecutor commander = getDebuggerExecutor(); DebuggableScript script = scriptStack.peek(); Scriptable activation = activationStack.peek(); List<VariableValue> variableValuesList = new ArrayList<VariableValue>(); for (int i = 0; i < script.getParamAndVarCount(); i++) { String variable = script.getParamOrVarName(i); Object value = activation.get(variable, activation); if ((variable != null) && (value != null)) { String valueContent = parseValueToString(value); variableValuesList.add(new VariableValue(variable, valueContent)); } } // if (variableValuesMetadata == null) { VariableValuesMetadata variableValuesMetadata = new VariableValuesMetadata(commander.getSessionId(), commander.getExecutionId(), commander.getUserId(), variableValuesList); // } this.session.setVariableValuesMetadata(variableValuesMetadata); notifyVariableValuesMetadata(); String sourceName = script.getSourceName(); sendOnBreakLineChange(sourceName, row); }
String url = fnOrScript.getSourceName(); if (url == null) { url = "<stdin>"; } else {
/** * Returns the FunctionSource object for the given script or function. */ private FunctionSource getFunctionSource(DebuggableScript fnOrScript) { FunctionSource fsource = functionSource(fnOrScript); if (fsource == null) { String url = getNormalizedUrl(fnOrScript); SourceInfo si = sourceInfo(url); if (si == null) { if (!fnOrScript.isGeneratedScript()) { // Not eval or Function, try to load it from URL String source = loadSource(url); if (source != null) { DebuggableScript top = fnOrScript; for (;;) { DebuggableScript parent = top.getParent(); if (parent == null) { break; } top = parent; } registerTopScript(top, source); fsource = functionSource(fnOrScript); } } } } return fsource; }
int[][] lineArrays = new int[N][]; for (int i = 0; i != N; ++i) { lineArrays[i] = functions[i].getLineNumbers(); String name = functions[i].getFunctionName(); if (name == null) { name = "";
String url = fnOrScript.getSourceName(); if (url == null) { url = "<stdin>"; } else {
/** * Returns the FunctionSource object for the given script or function. */ private FunctionSource getFunctionSource(DebuggableScript fnOrScript) { FunctionSource fsource = functionSource(fnOrScript); if (fsource == null) { String url = getNormalizedUrl(fnOrScript); SourceInfo si = sourceInfo(url); if (si == null) { if (!fnOrScript.isGeneratedScript()) { // Not eval or Function, try to load it from URL String source = loadSource(url); if (source != null) { DebuggableScript top = fnOrScript; for (;;) { DebuggableScript parent = top.getParent(); if (parent == null) { break; } top = parent; } registerTopScript(top, source); fsource = functionSource(fnOrScript); } } } } return fsource; }
private static void notifyDebugger_r(Context cx, DebuggableScript dscript, String debugSource) { cx.debugger.handleCompilationDone(cx, dscript, debugSource); for (int i = 0; i != dscript.getFunctionCount(); ++i) { notifyDebugger_r(cx, dscript.getFunction(i), debugSource); } }
private boolean isBreakpoint(int row) { String path = scriptStack.peek().getSourceName(); if (!path.startsWith(IRepositoryStructure.SEPARATOR)) { path = IRepositoryStructure.SEPARATOR + path; } RhinoJavascriptDebugExecutor executor = getDebuggerExecutor(); LinebreakMetadata breakpoint = new LinebreakMetadata(executor.getSessionId(), executor.getExecutionId(), executor.getUserId(), path, row); Set<BreakpointMetadata> breakpoints = debugExecutor.getBreakpoints(); return breakpoints.contains(breakpoint.getBreakpoint()); }
/** * Called when compilation is finished. */ public void handleCompilationDone(Context cx, DebuggableScript fnOrScript, String source) { if (type != IPROXY_DEBUG) Kit.codeBug(); if (!fnOrScript.isTopLevel()) { return; } dim.registerTopScript(fnOrScript, source); } }
private static void notifyDebugger_r(Context cx, DebuggableScript dscript, String debugSource) { cx.debugger.handleCompilationDone(cx, dscript, debugSource); for (int i = 0; i != dscript.getFunctionCount(); ++i) { notifyDebugger_r(cx, dscript.getFunction(i), debugSource); } }
if (!topScript.isTopLevel()) { throw new IllegalArgumentException();
private static void notifyDebugger_r(Context cx, DebuggableScript dscript, String debugSource) { cx.debugger.handleCompilationDone(cx, dscript, debugSource); for (int i = 0; i != dscript.getFunctionCount(); ++i) { notifyDebugger_r(cx, dscript.getFunction(i), debugSource); } }
if (!topScript.isTopLevel()) { throw new IllegalArgumentException();
private static void notifyDebugger_r(Context cx, DebuggableScript dscript, String debugSource) { cx.debugger.handleCompilationDone(cx, dscript, debugSource); for (int i = 0; i != dscript.getFunctionCount(); ++i) { notifyDebugger_r(cx, dscript.getFunction(i), debugSource); } }
/** * Helper function for {@link #getAllFunctions(DebuggableScript)}. */ private static void collectFunctions_r(DebuggableScript function, ObjArray array) { array.add(function); for (int i = 0; i != function.getFunctionCount(); ++i) { collectFunctions_r(function.getFunction(i), array); } }
/** * Helper function for {@link #getAllFunctions(DebuggableScript)}. */ private static void collectFunctions_r(DebuggableScript function, ObjArray array) { array.add(function); for (int i = 0; i != function.getFunctionCount(); ++i) { collectFunctions_r(function.getFunction(i), array); } }