Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Unified Diff: src/debug-delay.js

Issue 111001: Added context information to scripts (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/factory.cc » ('j') | src/mirror-delay.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug-delay.js
===================================================================
--- src/debug-delay.js (revision 1869)
+++ src/debug-delay.js (working copy)
@@ -1062,6 +1062,14 @@
}
+ProtocolMessage.prototype.setOption = function(name, value) {
+ if (!this.options_) {
+ this.options_ = {};
+ }
+ this.options_[name] = value;
+}
+
+
ProtocolMessage.prototype.failed = function(message) {
this.success = false;
this.message = message;
@@ -1090,7 +1098,7 @@
if (this.body) {
json += ',"body":';
// Encode the body part.
- var serializer = MakeMirrorSerializer(true);
+ var serializer = MakeMirrorSerializer(true, this.options_);
if (this.body instanceof Mirror) {
json += serializer.serializeValue(this.body);
} else if (this.body instanceof Array) {
@@ -1680,6 +1688,7 @@
if (!IS_UNDEFINED(request.arguments.includeSource)) {
includeSource = %ToBoolean(request.arguments.includeSource);
+ response.setOption('includeSource', includeSource);
}
}
@@ -1690,25 +1699,7 @@
for (var i = 0; i < scripts.length; i++) {
if (types & ScriptTypeFlag(scripts[i].type)) {
- var script = {};
- if (scripts[i].name) {
- script.name = scripts[i].name;
- }
- script.id = scripts[i].id;
- script.lineOffset = scripts[i].line_offset;
- script.columnOffset = scripts[i].column_offset;
- script.lineCount = scripts[i].lineCount();
- if (scripts[i].data) {
- script.data = scripts[i].data;
- }
- 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);
+ response.body.push(MakeMirror(scripts[i]));
}
}
};
« no previous file with comments | « src/compiler.cc ('k') | src/factory.cc » ('j') | src/mirror-delay.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698