Reviewers: Søren Gjesse,

Description:
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.

Please review this at http://codereview.chromium.org/55011

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/debug-delay.js


Index: src/debug-delay.js
===================================================================
--- src/debug-delay.js  (revision 1632)
+++ src/debug-delay.js  (working copy)
@@ -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,8 @@
          return response.failed('Invalid types "' + request.arguments.types  
+ '"');
        }
      }
+
+    includeSource = !!request.arguments.includeSource;
    }

    // Collect all scripts in the heap.
@@ -1670,7 +1673,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
-~----------~----~----~----~------~----~------~--~---

Reply via email to