Commit 9a919458 authored by yurys@chromium.org's avatar yurys@chromium.org

When devtools window is opening it requests all scripts parsed by the moment....

When devtools window is opening it requests all scripts parsed by the moment. Currently 'scripts' response contains only first 80 chars of the scripts sources. I added an argument to the protocol that allows to include full source text into the response.
Review URL: http://codereview.chromium.org/55011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1638 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d97a72c6
......@@ -1645,6 +1645,7 @@ DebugCommandProcessor.prototype.sourceRequest_ = function(request, response) {
DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) {
var types = ScriptTypeFlag(Debug.ScriptType.Normal);
var includeSource = false;
if (request.arguments) {
// Pull out arguments.
if (!IS_UNDEFINED(request.arguments.types)) {
......@@ -1653,6 +1654,10 @@ DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) {
return response.failed('Invalid types "' + request.arguments.types + '"');
}
}
if (!IS_UNDEFINED(request.arguments.includeSource)) {
includeSource = %ToBoolean(request.arguments.includeSource);
}
}
// Collect all scripts in the heap.
......@@ -1670,7 +1675,11 @@ DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) {
script.lineOffset = scripts[i].line_offset;
script.columnOffset = scripts[i].column_offset;
script.lineCount = scripts[i].lineCount();
if (includeSource) {
script.source = scripts[i].source;
} else {
script.sourceStart = scripts[i].source.substring(0, 80);
}
script.sourceLength = scripts[i].source.length;
script.type = scripts[i].type;
response.body.push(script);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment