Permalink
Browse files

retrieve script source when a breakpoint is hit on a line where we do…

…n't have the source already
  • Loading branch information...
1 parent 05c6ebb commit 1fb8d3d9f39e47a86faf0bd08a7fb3b5e68c819b @dannycoates dannycoates committed Aug 1, 2010
Showing with 9 additions and 3 deletions.
  1. +4 −3 front-end/node/Debugger.js
  2. +5 −0 front-end/node/InspectorFrontendHostStub.js
@@ -80,9 +80,10 @@ WebInspector.nodeDebugger = (function() {
list.push(callback);
listeners[event] = list;
},
- getScripts: function() {
- sendRequest('scripts', {
- arguments: { includeSource: true, types: 4 }});
+ getScripts: function(ids) {
+ var args = { arguments: { includeSource: true, types: 4 }};
+ if(ids) { args.arguments.ids = ids; }
+ sendRequest('scripts', args);
},
setBreakpoint: function(callId, sourceID, line, enabled, condition) {
var bp = breakpoints[sourceID + ':' + line];
@@ -237,6 +237,11 @@ WebInspector.InspectorFrontendHostStub = function()
// events
debugr.on('break', function(msg) {
+ var scripts = WebInspector.panels.scripts._sourceIDMap,
+ id = msg.body.script.id;
+ if(scripts[id] == null) {
+ debugr.getScripts([id]);
+ }
debugr.getBacktrace();
});
debugr.on('exception', function(msg) {

0 comments on commit 1fb8d3d

Please sign in to comment.