OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Default number of frames to include in the response to backtrace request. | 5 // Default number of frames to include in the response to backtrace request. |
6 var kDefaultBacktraceLength = 10; | 6 var kDefaultBacktraceLength = 10; |
7 | 7 |
8 var Debug = {}; | 8 var Debug = {}; |
9 | 9 |
10 // Regular expression to skip "crud" at the beginning of a source line which is | 10 // Regular expression to skip "crud" at the beginning of a source line which is |
11 // not really code. Currently the regular expression matches whitespace and | 11 // not really code. Currently the regular expression matches whitespace and |
12 // comments. | 12 // comments. |
13 var sourceLineBeginningSkip = /^(?:\s*(?:\/\*.*?\*\/)*)*/; | 13 var sourceLineBeginningSkip = /^(?:\s*(?:\/\*.*?\*\/)*)*/; |
14 | 14 |
15 // Debug events which can occour in the V8 JavaScript engine. These originate | 15 // Debug events which can occour in the V8 JavaScript engine. These originate |
16 // from the API include file debug.h. | 16 // from the API include file debug.h. |
17 Debug.DebugEvent = { Break: 1, | 17 Debug.DebugEvent = { Break: 1, |
18 Exception: 2, | 18 Exception: 2, |
19 NewFunction: 3, | 19 NewFunction: 3, |
20 BeforeCompile: 4, | 20 BeforeCompile: 4, |
21 AfterCompile: 5, | 21 AfterCompile: 5, |
22 CompileError: 6, | 22 CompileError: 6, |
23 PromiseEvent: 7 }; | 23 PromiseEvent: 7, |
| 24 AsyncTaskEvent: 8 }; |
24 | 25 |
25 // Types of exceptions that can be broken upon. | 26 // Types of exceptions that can be broken upon. |
26 Debug.ExceptionBreak = { Caught : 0, | 27 Debug.ExceptionBreak = { Caught : 0, |
27 Uncaught: 1 }; | 28 Uncaught: 1 }; |
28 | 29 |
29 // The different types of steps. | 30 // The different types of steps. |
30 Debug.StepAction = { StepOut: 0, | 31 Debug.StepAction = { StepOut: 0, |
31 StepNext: 1, | 32 StepNext: 1, |
32 StepIn: 2, | 33 StepIn: 2, |
33 StepMin: 3, | 34 StepMin: 3, |
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 | 1220 |
1220 | 1221 |
1221 NewPromiseEvent.prototype.promise = PromiseGetter; | 1222 NewPromiseEvent.prototype.promise = PromiseGetter; |
1222 | 1223 |
1223 | 1224 |
1224 NewPromiseEvent.prototype.resolver = function() { | 1225 NewPromiseEvent.prototype.resolver = function() { |
1225 return MakeMirror(this.resolver_); | 1226 return MakeMirror(this.resolver_); |
1226 } | 1227 } |
1227 | 1228 |
1228 | 1229 |
| 1230 function MakeAsyncTaskEvent(event_data) { |
| 1231 return new AsyncTaskEvent(event_data); |
| 1232 } |
| 1233 |
| 1234 |
| 1235 function AsyncTaskEvent(event_data) { |
| 1236 this.type_ = event_data.type; |
| 1237 this.name_ = event_data.name; |
| 1238 this.id_ = event_data.id; |
| 1239 } |
| 1240 |
| 1241 |
| 1242 AsyncTaskEvent.prototype.type = function() { |
| 1243 return this.type_; |
| 1244 } |
| 1245 |
| 1246 |
| 1247 AsyncTaskEvent.prototype.name = function() { |
| 1248 return this.name_; |
| 1249 } |
| 1250 |
| 1251 |
| 1252 AsyncTaskEvent.prototype.id = function() { |
| 1253 return this.id_; |
| 1254 } |
| 1255 |
| 1256 |
1229 function DebugCommandProcessor(exec_state, opt_is_running) { | 1257 function DebugCommandProcessor(exec_state, opt_is_running) { |
1230 this.exec_state_ = exec_state; | 1258 this.exec_state_ = exec_state; |
1231 this.running_ = opt_is_running || false; | 1259 this.running_ = opt_is_running || false; |
1232 } | 1260 } |
1233 | 1261 |
1234 | 1262 |
1235 DebugCommandProcessor.prototype.processDebugRequest = function (request) { | 1263 DebugCommandProcessor.prototype.processDebugRequest = function (request) { |
1236 return this.processDebugJSONRequest(request); | 1264 return this.processDebugJSONRequest(request); |
1237 }; | 1265 }; |
1238 | 1266 |
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2540 | 2568 |
2541 default: | 2569 default: |
2542 json = null; | 2570 json = null; |
2543 } | 2571 } |
2544 return json; | 2572 return json; |
2545 } | 2573 } |
2546 | 2574 |
2547 Debug.TestApi = { | 2575 Debug.TestApi = { |
2548 CommandProcessorResolveValue: DebugCommandProcessor.resolveValue_ | 2576 CommandProcessorResolveValue: DebugCommandProcessor.resolveValue_ |
2549 }; | 2577 }; |
OLD | NEW |