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 "use strict"; | 4 "use strict"; |
5 | 5 |
6 // Default number of frames to include in the response to backtrace request. | 6 // Default number of frames to include in the response to backtrace request. |
7 var kDefaultBacktraceLength = 10; | 7 var kDefaultBacktraceLength = 10; |
8 | 8 |
9 var Debug = {}; | 9 var Debug = {}; |
10 | 10 |
11 // Regular expression to skip "crud" at the beginning of a source line which is | 11 // Regular expression to skip "crud" at the beginning of a source line which is |
12 // not really code. Currently the regular expression matches whitespace and | 12 // not really code. Currently the regular expression matches whitespace and |
13 // comments. | 13 // comments. |
14 var sourceLineBeginningSkip = /^(?:\s*(?:\/\*.*?\*\/)*)*/; | 14 var sourceLineBeginningSkip = /^(?:\s*(?:\/\*.*?\*\/)*)*/; |
15 | 15 |
16 // Debug events which can occour in the V8 JavaScript engine. These originate | 16 // Debug events which can occour in the V8 JavaScript engine. These originate |
17 // from the API include file debug.h. | 17 // from the API include file debug.h. |
18 Debug.DebugEvent = { Break: 1, | 18 Debug.DebugEvent = { Break: 1, |
19 Exception: 2, | 19 Exception: 2, |
20 NewFunction: 3, | 20 NewFunction: 3, |
21 BeforeCompile: 4, | 21 BeforeCompile: 4, |
22 AfterCompile: 5, | 22 AfterCompile: 5, |
23 CompileError: 6, | 23 CompileError: 6, |
24 PromiseEvent: 7, | 24 PromiseEvent: 7, |
25 AsyncTaskEvent: 8, | 25 AsyncTaskEvent: 8 }; |
26 BreakForCommand: 9 }; | |
27 | 26 |
28 // Types of exceptions that can be broken upon. | 27 // Types of exceptions that can be broken upon. |
29 Debug.ExceptionBreak = { Caught : 0, | 28 Debug.ExceptionBreak = { Caught : 0, |
30 Uncaught: 1 }; | 29 Uncaught: 1 }; |
31 | 30 |
32 // The different types of steps. | 31 // The different types of steps. |
33 Debug.StepAction = { StepOut: 0, | 32 Debug.StepAction = { StepOut: 0, |
34 StepNext: 1, | 33 StepNext: 1, |
35 StepIn: 2, | 34 StepIn: 2, |
36 StepMin: 3, | 35 StepMin: 3, |
(...skipping 2523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2560 case 'string': | 2559 case 'string': |
2561 case 'number': | 2560 case 'number': |
2562 json = value; | 2561 json = value; |
2563 break; | 2562 break; |
2564 | 2563 |
2565 default: | 2564 default: |
2566 json = null; | 2565 json = null; |
2567 } | 2566 } |
2568 return json; | 2567 return json; |
2569 } | 2568 } |
OLD | NEW |