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

Unified Diff: src/debug-delay.js

Issue 13126: Added type method to the debug events.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug-delay.js
===================================================================
--- src/debug-delay.js (revision 915)
+++ src/debug-delay.js (working copy)
@@ -322,6 +322,10 @@
// Convert the line and column into an absolute position within the script.
var pos = Debug.findScriptSourcePosition(script, this.line(), column);
+ // If the position is not found in the script (the script might be shorter
+ // than it used to be) just ignore it.
+ if (pos === null) return;
+
// Create a break point object and set the break point.
break_point = MakeBreakPoint(pos, this.line(), this.column(), this);
break_point.setIgnoreCount(this.ignoreCount());
@@ -443,7 +447,8 @@
// Returns the character position in a script based on a line number and an
// optional position within that line.
Debug.findScriptSourcePosition = function(script, opt_line, opt_column) {
- return script.locationFromLine(opt_line, opt_column).position;
+ var location = script.locationFromLine(opt_line, opt_column);
+ return location ? location.position : null;
}
@@ -727,6 +732,16 @@
}
+BreakEvent.prototype.executionState = function() {
+ return this.exec_state_;
+};
+
+
+BreakEvent.prototype.eventType = function() {
+ return Debug.DebugEvent.Break;
+};
+
+
BreakEvent.prototype.func = function() {
return this.exec_state_.frame(0).func();
};
@@ -799,12 +814,24 @@
return new ExceptionEvent(exec_state, exception, uncaught);
}
+
function ExceptionEvent(exec_state, exception, uncaught) {
this.exec_state_ = exec_state;
this.exception_ = exception;
this.uncaught_ = uncaught;
}
+
+ExceptionEvent.prototype.executionState = function() {
+ return this.exec_state_;
+};
+
+
+ExceptionEvent.prototype.eventType = function() {
+ return Debug.DebugEvent.Exception;
+};
+
+
ExceptionEvent.prototype.uncaught = function() {
return this.uncaught_;
}
@@ -855,18 +882,28 @@
};
-function MakeCompileEvent(script_source, script_name, script_function) {
- return new CompileEvent(script_source, script_name, script_function);
+function MakeCompileEvent(script_source, script_name, script_function, before) {
+ return new CompileEvent(script_source, script_name, script_function, before);
}
-function CompileEvent(script_source, script_name, script_function) {
+function CompileEvent(script_source, script_name, script_function, before) {
this.scriptSource = script_source;
this.scriptName = script_name;
this.scriptFunction = script_function;
+ this.before = before;
}
+CompileEvent.prototype.eventType = function() {
+ if (this.before) {
+ return Debug.DebugEvent.BeforeComplie;
+ } else {
+ return Debug.DebugEvent.AfterComplie;
+ }
+};
+
+
function MakeNewFunctionEvent(func) {
return new NewFunctionEvent(func);
}
@@ -876,6 +913,12 @@
this.func = func;
}
+
+NewFunctionEvent.prototype.eventType = function() {
+ return Debug.DebugEvent.NewFunction;
+};
+
+
NewFunctionEvent.prototype.name = function() {
return this.func.name;
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698