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

Unified Diff: src/debug-debugger.js

Issue 264333007: Add OnCompileError handler and v8::CompileError debug event (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 6 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/debug.cc ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug-debugger.js
diff --git a/src/debug-debugger.js b/src/debug-debugger.js
index aa370f0c3ea99fc9cecd88fcead1b00dd2cbcdc8..6cd1baa61e44bb6af4c8b9b2e481170f5cd8b7ec 100644
--- a/src/debug-debugger.js
+++ b/src/debug-debugger.js
@@ -19,7 +19,8 @@ Debug.DebugEvent = { Break: 1,
NewFunction: 3,
BeforeCompile: 4,
AfterCompile: 5,
- ScriptCollected: 6 };
+ ScriptCollected: 6,
+ CompileError: 7 };
// Types of exceptions that can be broken upon.
Debug.ExceptionBreak = { Caught : 0,
@@ -1143,23 +1144,19 @@ ExceptionEvent.prototype.toJSONProtocol = function() {
};
-function MakeCompileEvent(script, before) {
- return new CompileEvent(script, before);
+function MakeCompileEvent(script, type) {
+ return new CompileEvent(script, type);
}
-function CompileEvent(script, before) {
+function CompileEvent(script, type) {
this.script_ = MakeMirror(script);
- this.before_ = before;
+ this.type_ = type;
}
CompileEvent.prototype.eventType = function() {
- if (this.before_) {
- return Debug.DebugEvent.BeforeCompile;
- } else {
- return Debug.DebugEvent.AfterCompile;
- }
+ return this.type_;
};
@@ -1171,10 +1168,13 @@ CompileEvent.prototype.script = function() {
CompileEvent.prototype.toJSONProtocol = function() {
var o = new ProtocolMessage();
o.running = true;
- if (this.before_) {
- o.event = "beforeCompile";
- } else {
- o.event = "afterCompile";
+ switch (this.type_) {
+ case Debug.DebugEvent.BeforeCompile:
+ o.event = "beforeCompile";
+ case Debug.DebugEvent.AfterCompile:
+ o.event = "afterCompile";
+ case Debug.DebugEvent.CompileError:
+ o.event = "compileError";
}
o.body = {};
o.body.script = this.script_;
« no previous file with comments | « src/debug.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698