Fixed exception in debugger scripts request.
authorsgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 18 Jun 2009 14:04:04 +0000 (14:04 +0000)
committersgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 18 Jun 2009 14:04:04 +0000 (14:04 +0000)
When collecting the result for a scripts request check that scripts compiled through eval actually have a script for the function they where eval'ed in before adding that informaiton to the response.

BUG=http://crbug.com/14388
TEST=none

Review URL: http://codereview.chromium.org/135001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2218 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/mirror-delay.js

index 060586dc3b7ee15fa05d560609325ba410911ccd..9943b259c00e2d27847de940fe9f86e04a1a4e1b 100644 (file)
@@ -2051,7 +2051,10 @@ JSONProtocolSerializer.prototype.serialize_ = function(mirror, reference,
       content.sourceLength = mirror.source().length;
       content.scriptType = mirror.scriptType();
       content.compilationType = mirror.compilationType();
-      if (mirror.compilationType() == 1) {  // Compilation type eval.
+      // For compilation type eval emit information on the script from which
+      // eval was called if a script is present.
+      if (mirror.compilationType() == 1 &&
+          mirror.evalFromFunction().script()) {
         content.evalFromScript =
             this.serializeReference(mirror.evalFromFunction().script());
         var evalFromLocation = mirror.evalFromLocation()