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

Side by Side Diff: src/debug-debugger.js

Issue 249503002: Trigger debug event on not yet caught exception in promises. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: always use original exception Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/debug.cc ('k') | src/execution.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 24 matching lines...) Expand all
35 // comments. 35 // comments.
36 var sourceLineBeginningSkip = /^(?:\s*(?:\/\*.*?\*\/)*)*/; 36 var sourceLineBeginningSkip = /^(?:\s*(?:\/\*.*?\*\/)*)*/;
37 37
38 // Debug events which can occour in the V8 JavaScript engine. These originate 38 // Debug events which can occour in the V8 JavaScript engine. These originate
39 // from the API include file debug.h. 39 // from the API include file debug.h.
40 Debug.DebugEvent = { Break: 1, 40 Debug.DebugEvent = { Break: 1,
41 Exception: 2, 41 Exception: 2,
42 NewFunction: 3, 42 NewFunction: 3,
43 BeforeCompile: 4, 43 BeforeCompile: 4,
44 AfterCompile: 5, 44 AfterCompile: 5,
45 ScriptCollected: 6 }; 45 ScriptCollected: 6,
46 PendingExceptionInPromise: 7 };
aandrey 2014/04/29 13:04:36 Is it OK that this does not match the DebugEvent e
46 47
47 // Types of exceptions that can be broken upon. 48 // Types of exceptions that can be broken upon.
48 Debug.ExceptionBreak = { Caught : 0, 49 Debug.ExceptionBreak = { Caught : 0,
49 Uncaught: 1 }; 50 Uncaught: 1 };
50 51
51 // The different types of steps. 52 // The different types of steps.
52 Debug.StepAction = { StepOut: 0, 53 Debug.StepAction = { StepOut: 0,
53 StepNext: 1, 54 StepNext: 1,
54 StepIn: 2, 55 StepIn: 2,
55 StepMin: 3, 56 StepMin: 3,
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 } else { 1087 } else {
1087 number = breakpoint.number(); 1088 number = breakpoint.number();
1088 } 1089 }
1089 o.body.breakpoints.push(number); 1090 o.body.breakpoints.push(number);
1090 } 1091 }
1091 } 1092 }
1092 return JSON.stringify(ObjectToProtocolObject_(o)); 1093 return JSON.stringify(ObjectToProtocolObject_(o));
1093 }; 1094 };
1094 1095
1095 1096
1096 function MakeExceptionEvent(exec_state, exception, uncaught) { 1097 function MakeExceptionEvent(exec_state, exception, uncaught, promise) {
1097 return new ExceptionEvent(exec_state, exception, uncaught); 1098 return new ExceptionEvent(exec_state, exception, uncaught, promise);
1098 } 1099 }
1099 1100
1100 1101
1101 function ExceptionEvent(exec_state, exception, uncaught) { 1102 function ExceptionEvent(exec_state, exception, uncaught, promise) {
1102 this.exec_state_ = exec_state; 1103 this.exec_state_ = exec_state;
1103 this.exception_ = exception; 1104 this.exception_ = exception;
1104 this.uncaught_ = uncaught; 1105 this.uncaught_ = uncaught;
1106 this.promise_ = promise;
1105 } 1107 }
1106 1108
1107 1109
1108 ExceptionEvent.prototype.executionState = function() { 1110 ExceptionEvent.prototype.executionState = function() {
1109 return this.exec_state_; 1111 return this.exec_state_;
1110 }; 1112 };
1111 1113
1112 1114
1113 ExceptionEvent.prototype.eventType = function() { 1115 ExceptionEvent.prototype.eventType = function() {
1114 return Debug.DebugEvent.Exception; 1116 return Debug.DebugEvent.Exception;
1115 }; 1117 };
1116 1118
1117 1119
1118 ExceptionEvent.prototype.exception = function() { 1120 ExceptionEvent.prototype.exception = function() {
1119 return this.exception_; 1121 return this.exception_;
1120 }; 1122 };
1121 1123
1122 1124
1123 ExceptionEvent.prototype.uncaught = function() { 1125 ExceptionEvent.prototype.uncaught = function() {
1124 return this.uncaught_; 1126 return this.uncaught_;
1125 }; 1127 };
1126 1128
1127 1129
1130 ExceptionEvent.prototype.promise = function() {
1131 return this.promise_;
1132 };
1133
1134
1128 ExceptionEvent.prototype.func = function() { 1135 ExceptionEvent.prototype.func = function() {
1129 return this.exec_state_.frame(0).func(); 1136 return this.exec_state_.frame(0).func();
1130 }; 1137 };
1131 1138
1132 1139
1133 ExceptionEvent.prototype.sourceLine = function() { 1140 ExceptionEvent.prototype.sourceLine = function() {
1134 return this.exec_state_.frame(0).sourceLine(); 1141 return this.exec_state_.frame(0).sourceLine();
1135 }; 1142 };
1136 1143
1137 1144
(...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after
2609 2616
2610 default: 2617 default:
2611 json = null; 2618 json = null;
2612 } 2619 }
2613 return json; 2620 return json;
2614 } 2621 }
2615 2622
2616 Debug.TestApi = { 2623 Debug.TestApi = {
2617 CommandProcessorResolveValue: DebugCommandProcessor.resolveValue_ 2624 CommandProcessorResolveValue: DebugCommandProcessor.resolveValue_
2618 }; 2625 };
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/execution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698