This commit is contained in:
Danny Coates 2010-10-25 00:39:15 -06:00
Родитель dcd344fbc5
Коммит 290caa225a
2 изменённых файлов: 29 добавлений и 10 удалений

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

@ -117,7 +117,7 @@ exports.createSession = function (conn) {
function parsedScripts(msg) {
msg.body.forEach(function(s) {
sourceIDs[s.id] = true;
sourceIDs[s.id] = { url: s.name };
var data = {
sourceID: s.id.toString(),
url: s.name,
@ -250,7 +250,24 @@ exports.createSession = function (conn) {
sendEvent('showPanel', { name: 'scripts' });
sendEvent('debuggerWasEnabled');
var args = { arguments: { includeSource: true, types: 4 }};
debugRequest('scripts', args, parsedScripts);
debugRequest('scripts', args, function(msg) {
parsedScripts(msg);
debugRequest('listbreakpoints', {},
function(msg) {
msg.body.breakpoints.forEach(function(bp) {
if (bp.type === 'scriptId') {
var data = {
sourceID: bp.script_id,
url: sourceIDs[bp.script_id].url,
line: bp.line + 1,
enabled: bp.active,
condition: bp.condition
};
sendEvent('restoredBreakpoint', data);
}
});
});
});
}
},
getSettings: {
@ -396,10 +413,10 @@ exports.createSession = function (conn) {
value: function(sourceID, lineNumber, enabled, condition, seq) {
var bp = breakpoints[sourceID + ':' + lineNumber];
var handleResponse = function(msg) {
if (msg.arguments) {
var a = msg.arguments;
breakpoints[a.target + ':' + (a.line + 1)] = msg.body.breakpoint;
var data = { success: true, actualLineNumber: a.line + 1 };
if (msg.success) {
var b = msg.body;
breakpoints[b.script_id + ':' + (b.line + 1)] = b.breakpoint;
var data = { success: true, actualLineNumber: b.line + 1 };
sendResponse(seq, true, data);
}
};
@ -409,8 +426,11 @@ exports.createSession = function (conn) {
arguments: {
breakpoint: bp,
enabled: enabled,
condition: condition,
id: sourceID + ':' + lineNumber}}, handleResponse);
condition: condition
}}, function(msg) {
var data = { success: true, actualLineNumber: lineNumber };
sendResponse(seq, true, data);
});
}
else {
debugRequest('setbreakpoint',{

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

@ -1,5 +1,4 @@
var http = require('http'),
sys = require('sys');
var http = require('http');
var x = 0;
http.createServer(function (req, res) {