| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 DontPauseOnExceptions: 0, | 38 DontPauseOnExceptions: 0, |
| 39 PauseOnAllExceptions: 1, | 39 PauseOnAllExceptions: 1, |
| 40 PauseOnUncaughtExceptions: 2 | 40 PauseOnUncaughtExceptions: 2 |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 DebuggerScript._pauseOnExceptionsState = DebuggerScript.PauseOnExceptionsState.D
ontPauseOnExceptions; | 43 DebuggerScript._pauseOnExceptionsState = DebuggerScript.PauseOnExceptionsState.D
ontPauseOnExceptions; |
| 44 Debug.clearBreakOnException(); | 44 Debug.clearBreakOnException(); |
| 45 Debug.clearBreakOnUncaughtException(); | 45 Debug.clearBreakOnUncaughtException(); |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * @param {!CompileEvent} eventData | 48 * @param {?CompileEvent} eventData |
| 49 */ | 49 */ |
| 50 DebuggerScript.getAfterCompileScript = function(eventData) | 50 DebuggerScript.getAfterCompileScript = function(eventData) |
| 51 { | 51 { |
| 52 return DebuggerScript._formatScript(eventData.script().value()); | 52 var script = eventData.script().value(); |
| 53 if (!script.is_debugger_script) |
| 54 return DebuggerScript._formatScript(eventData.script().value()); |
| 55 return null; |
| 53 } | 56 } |
| 54 | 57 |
| 55 /** @type {!Map<!ScopeType, string>} */ | 58 /** @type {!Map<!ScopeType, string>} */ |
| 56 DebuggerScript._scopeTypeNames = new Map(); | 59 DebuggerScript._scopeTypeNames = new Map(); |
| 57 DebuggerScript._scopeTypeNames.set(ScopeType.Global, "global"); | 60 DebuggerScript._scopeTypeNames.set(ScopeType.Global, "global"); |
| 58 DebuggerScript._scopeTypeNames.set(ScopeType.Local, "local"); | 61 DebuggerScript._scopeTypeNames.set(ScopeType.Local, "local"); |
| 59 DebuggerScript._scopeTypeNames.set(ScopeType.With, "with"); | 62 DebuggerScript._scopeTypeNames.set(ScopeType.With, "with"); |
| 60 DebuggerScript._scopeTypeNames.set(ScopeType.Closure, "closure"); | 63 DebuggerScript._scopeTypeNames.set(ScopeType.Closure, "closure"); |
| 61 DebuggerScript._scopeTypeNames.set(ScopeType.Catch, "catch"); | 64 DebuggerScript._scopeTypeNames.set(ScopeType.Catch, "catch"); |
| 62 DebuggerScript._scopeTypeNames.set(ScopeType.Block, "block"); | 65 DebuggerScript._scopeTypeNames.set(ScopeType.Block, "block"); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 for (var i = 0; i < scripts.length; ++i) { | 176 for (var i = 0; i < scripts.length; ++i) { |
| 174 var script = scripts[i]; | 177 var script = scripts[i]; |
| 175 if (contextDataPrefix) { | 178 if (contextDataPrefix) { |
| 176 if (!script.context_data) | 179 if (!script.context_data) |
| 177 continue; | 180 continue; |
| 178 // Context data is a string in the following format: | 181 // Context data is a string in the following format: |
| 179 // <contextGroupId>,<contextId>,<auxData> | 182 // <contextGroupId>,<contextId>,<auxData> |
| 180 if (script.context_data.indexOf(contextDataPrefix) !== 0) | 183 if (script.context_data.indexOf(contextDataPrefix) !== 0) |
| 181 continue; | 184 continue; |
| 182 } | 185 } |
| 186 if (script.is_debugger_script) |
| 187 continue; |
| 183 result.push(DebuggerScript._formatScript(script)); | 188 result.push(DebuggerScript._formatScript(script)); |
| 184 } | 189 } |
| 185 return result; | 190 return result; |
| 186 } | 191 } |
| 187 | 192 |
| 188 /** | 193 /** |
| 189 * @param {!Script} script | 194 * @param {!Script} script |
| 190 * @return {!FormattedScript} | 195 * @return {!FormattedScript} |
| 191 */ | 196 */ |
| 192 DebuggerScript._formatScript = function(script) | 197 DebuggerScript._formatScript = function(script) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 210 name: script.nameOrSourceURL(), | 215 name: script.nameOrSourceURL(), |
| 211 sourceURL: script.source_url, | 216 sourceURL: script.source_url, |
| 212 sourceMappingURL: script.source_mapping_url, | 217 sourceMappingURL: script.source_mapping_url, |
| 213 source: script.source, | 218 source: script.source, |
| 214 startLine: script.line_offset, | 219 startLine: script.line_offset, |
| 215 startColumn: script.column_offset, | 220 startColumn: script.column_offset, |
| 216 endLine: endLine, | 221 endLine: endLine, |
| 217 endColumn: endColumn, | 222 endColumn: endColumn, |
| 218 executionContextId: DebuggerScript._executionContextId(script.context_da
ta), | 223 executionContextId: DebuggerScript._executionContextId(script.context_da
ta), |
| 219 // Note that we cannot derive aux data from context id because of compil
ation cache. | 224 // Note that we cannot derive aux data from context id because of compil
ation cache. |
| 220 executionContextAuxData: DebuggerScript._executionContextAuxData(script.
context_data), | 225 executionContextAuxData: DebuggerScript._executionContextAuxData(script.
context_data) |
| 221 isInternalScript: script.is_debugger_script | |
| 222 }; | 226 }; |
| 223 } | 227 } |
| 224 | 228 |
| 225 /** | 229 /** |
| 226 * @param {!ExecutionState} execState | 230 * @param {!ExecutionState} execState |
| 227 * @param {!BreakpointInfo} info | 231 * @param {!BreakpointInfo} info |
| 228 * @return {string|undefined} | 232 * @return {string|undefined} |
| 229 */ | 233 */ |
| 230 DebuggerScript.setBreakpoint = function(execState, info) | 234 DebuggerScript.setBreakpoint = function(execState, info) |
| 231 { | 235 { |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 break; | 702 break; |
| 699 } | 703 } |
| 700 return result; | 704 return result; |
| 701 } | 705 } |
| 702 | 706 |
| 703 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr
ors in the cache we disable it. | 707 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr
ors in the cache we disable it. |
| 704 ToggleMirrorCache(false); | 708 ToggleMirrorCache(false); |
| 705 | 709 |
| 706 return DebuggerScript; | 710 return DebuggerScript; |
| 707 })(); | 711 })(); |
| OLD | NEW |