| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 25 matching lines...) Expand all Loading... |
| 36 // not really code. Currently the regular expression matches whitespace and | 36 // not really code. Currently the regular expression matches whitespace and |
| 37 // comments. | 37 // comments. |
| 38 const sourceLineBeginningSkip = /^(?:[ \v\h]*(?:\/\*.*?\*\/)*)*/; | 38 const sourceLineBeginningSkip = /^(?:[ \v\h]*(?:\/\*.*?\*\/)*)*/; |
| 39 | 39 |
| 40 // Debug events which can occour in the V8 JavaScript engine. These originate | 40 // Debug events which can occour in the V8 JavaScript engine. These originate |
| 41 // from the API include file debug.h. | 41 // from the API include file debug.h. |
| 42 Debug.DebugEvent = { Break: 1, | 42 Debug.DebugEvent = { Break: 1, |
| 43 Exception: 2, | 43 Exception: 2, |
| 44 NewFunction: 3, | 44 NewFunction: 3, |
| 45 BeforeCompile: 4, | 45 BeforeCompile: 4, |
| 46 AfterCompile: 5 }; | 46 AfterCompile: 5, |
| 47 ScriptCollected: 6 }; |
| 47 | 48 |
| 48 // Types of exceptions that can be broken upon. | 49 // Types of exceptions that can be broken upon. |
| 49 Debug.ExceptionBreak = { All : 0, | 50 Debug.ExceptionBreak = { All : 0, |
| 50 Uncaught: 1 }; | 51 Uncaught: 1 }; |
| 51 | 52 |
| 52 // The different types of steps. | 53 // The different types of steps. |
| 53 Debug.StepAction = { StepOut: 0, | 54 Debug.StepAction = { StepOut: 0, |
| 54 StepNext: 1, | 55 StepNext: 1, |
| 55 StepIn: 2, | 56 StepIn: 2, |
| 56 StepMin: 3, | 57 StepMin: 3, |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 NewFunctionEvent.prototype.name = function() { | 1009 NewFunctionEvent.prototype.name = function() { |
| 1009 return this.func.name; | 1010 return this.func.name; |
| 1010 }; | 1011 }; |
| 1011 | 1012 |
| 1012 | 1013 |
| 1013 NewFunctionEvent.prototype.setBreakPoint = function(p) { | 1014 NewFunctionEvent.prototype.setBreakPoint = function(p) { |
| 1014 Debug.setBreakPoint(this.func, p || 0); | 1015 Debug.setBreakPoint(this.func, p || 0); |
| 1015 }; | 1016 }; |
| 1016 | 1017 |
| 1017 | 1018 |
| 1019 function MakeScriptCollectedEvent(exec_state, id) { |
| 1020 return new ScriptCollectedEvent(exec_state, id); |
| 1021 } |
| 1022 |
| 1023 |
| 1024 function ScriptCollectedEvent(exec_state, id) { |
| 1025 this.exec_state_ = exec_state; |
| 1026 this.id_ = id; |
| 1027 } |
| 1028 |
| 1029 |
| 1030 ScriptCollectedEvent.prototype.id = function() { |
| 1031 return this.id_; |
| 1032 }; |
| 1033 |
| 1034 |
| 1035 ScriptCollectedEvent.prototype.executionState = function() { |
| 1036 return this.exec_state_; |
| 1037 }; |
| 1038 |
| 1039 |
| 1040 ScriptCollectedEvent.prototype.toJSONProtocol = function() { |
| 1041 var o = new ProtocolMessage(); |
| 1042 o.running = true; |
| 1043 o.event = "scriptCollected"; |
| 1044 o.body = {}; |
| 1045 o.body.script = { id: this.id() }; |
| 1046 return o.toJSONProtocol(); |
| 1047 } |
| 1048 |
| 1049 |
| 1018 function MakeScriptObject_(script, include_source) { | 1050 function MakeScriptObject_(script, include_source) { |
| 1019 var o = { id: script.id(), | 1051 var o = { id: script.id(), |
| 1020 name: script.name(), | 1052 name: script.name(), |
| 1021 lineOffset: script.lineOffset(), | 1053 lineOffset: script.lineOffset(), |
| 1022 columnOffset: script.columnOffset(), | 1054 columnOffset: script.columnOffset(), |
| 1023 lineCount: script.lineCount(), | 1055 lineCount: script.lineCount(), |
| 1024 }; | 1056 }; |
| 1025 if (!IS_UNDEFINED(script.data())) { | 1057 if (!IS_UNDEFINED(script.data())) { |
| 1026 o.data = script.data(); | 1058 o.data = script.data(); |
| 1027 } | 1059 } |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1874 case 'string': | 1906 case 'string': |
| 1875 case 'number': | 1907 case 'number': |
| 1876 json = value; | 1908 json = value; |
| 1877 break | 1909 break |
| 1878 | 1910 |
| 1879 default: | 1911 default: |
| 1880 json = null; | 1912 json = null; |
| 1881 } | 1913 } |
| 1882 return json; | 1914 return json; |
| 1883 } | 1915 } |
| OLD | NEW |