From a6e3d992ba7225ff4610907f298d104050a8907e Mon Sep 17 00:00:00 2001 From: "yurys@chromium.org" Date: Wed, 15 Apr 2009 01:17:00 +0000 Subject: [PATCH] To resolve functions from the call stack we need at least ids for the scripts of those functions. The information on the scripts is now included into the response. Review URL: http://codereview.chromium.org/65006 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1708 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mirror-delay.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mirror-delay.js b/src/mirror-delay.js index 916bc27f80..9c9d713da8 100644 --- a/src/mirror-delay.js +++ b/src/mirror-delay.js @@ -1715,8 +1715,8 @@ JSONProtocolSerializer.prototype.serialize_ = function(mirror, reference, // Collect the JSON property/value pairs in an array. var content = new Array(); - // Add the handle for value mirrors. - if (mirror.isValue()) { + // Add the mirror handle. + if (mirror.isValue() || mirror.isScript()) { content.push(MakeJSONPair_('handle', NumberToJSON_(mirror.handle()))); } @@ -1771,10 +1771,11 @@ JSONProtocolSerializer.prototype.serialize_ = function(mirror, reference, break; case SCRIPT_TYPE: - // Script is represented by name and source attributes. + // Script is represented by id, name and source attributes. if (mirror.name()) { content.push(MakeJSONPair_('name', StringToJSON_(mirror.name()))); } + content.push(MakeJSONPair_('id', NumberToJSON_(mirror.id()))); content.push(MakeJSONPair_('lineOffset', NumberToJSON_(mirror.lineOffset()))); content.push(MakeJSONPair_('columnOffset', @@ -1908,7 +1909,12 @@ JSONProtocolSerializer.prototype.serializeFrame_ = function(mirror, content) { content.push(MakeJSONPair_('index', NumberToJSON_(mirror.index()))); content.push(MakeJSONPair_('receiver', this.serializeReference(mirror.receiver()))); - content.push(MakeJSONPair_('func', this.serializeReference(mirror.func()))); + var func = mirror.func(); + content.push(MakeJSONPair_('func', this.serializeReference(func))); + if (func.script()) { + content.push(MakeJSONPair_('script', + this.serializeReference(func.script()))); + } content.push(MakeJSONPair_('constructCall', BooleanToJSON_(mirror.isConstructCall()))); content.push(MakeJSONPair_('debuggerFrame',