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); } }
/** * 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); } }
/** * 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); } }
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; } } }
/** * 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 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()); }
Scriptable scriptable = (Scriptable)object; if (scriptable instanceof DebuggableObject) { ids = ((DebuggableObject)scriptable).getAllIds(); } else { ids = scriptable.getIds();
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); } }
/** * 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; }
/** * 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); } }
Scriptable scriptable = (Scriptable)object; if (scriptable instanceof DebuggableObject) { ids = ((DebuggableObject)scriptable).getAllIds(); } else { ids = scriptable.getIds();
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 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 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 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); } }