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

Unified Diff: src/mirror-delay.js

Issue 119108: Add more debugging information to scripts compiled through eval (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 6 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/factory.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mirror-delay.js
===================================================================
--- src/mirror-delay.js (revision 2090)
+++ src/mirror-delay.js (working copy)
@@ -1617,6 +1617,11 @@
};
+ScriptMirror.prototype.compilationType = function() {
+ return this.script_.compilation_type;
+};
+
+
ScriptMirror.prototype.lineCount = function() {
return this.script_.lineCount();
};
@@ -1638,6 +1643,20 @@
};
+ScriptMirror.prototype.evalFromFunction = function() {
+ return MakeMirror(this.script_.eval_from_function);
+};
+
+
+ScriptMirror.prototype.evalFromLocation = function() {
+ var eval_from_function = this.evalFromFunction();
+ if (!eval_from_function.isUndefined()) {
+ var position = this.script_.eval_from_position;
+ return eval_from_function.script().locationFromPosition(position, true);
+ }
+};
+
+
ScriptMirror.prototype.toText = function() {
var result = '';
result += this.name();
@@ -1901,6 +1920,14 @@
}
content.sourceLength = mirror.source().length;
content.scriptType = mirror.scriptType();
+ content.compilationType = mirror.compilationType();
+ if (mirror.compilationType() == 1) { // Compilation type eval.
+ content.evalFromScript =
+ this.serializeReference(mirror.evalFromFunction().script());
+ var evalFromLocation = mirror.evalFromLocation()
+ content.evalFromLocation = { line: evalFromLocation.line,
+ column: evalFromLocation.column}
+ }
if (mirror.context()) {
content.context = this.serializeReference(mirror.context());
}
« no previous file with comments | « src/factory.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698