Author: [email protected]
Date: Mon Mar 30 04:50:17 2009
New Revision: 1638
Modified:
branches/bleeding_edge/src/debug-delay.js
Log:
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
Modified: branches/bleeding_edge/src/debug-delay.js
==============================================================================
--- branches/bleeding_edge/src/debug-delay.js (original)
+++ branches/bleeding_edge/src/debug-delay.js Mon Mar 30 04:50:17 2009
@@ -1645,6 +1645,7 @@
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 @@
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 @@
script.lineOffset = scripts[i].line_offset;
script.columnOffset = scripts[i].column_offset;
script.lineCount = scripts[i].lineCount();
- script.sourceStart = scripts[i].source.substring(0, 80);
+ 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);
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---