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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 result.push({ | 95 result.push({ |
96 type: /** @type {string} */(DebuggerScript._scopeTypeNames.get(scope
Details.type())), | 96 type: /** @type {string} */(DebuggerScript._scopeTypeNames.get(scope
Details.type())), |
97 object: scopeObject, | 97 object: scopeObject, |
98 name: scopeDetails.name() || "" | 98 name: scopeDetails.name() || "" |
99 }); | 99 }); |
100 } | 100 } |
101 return result; | 101 return result; |
102 } | 102 } |
103 | 103 |
104 /** | 104 /** |
105 * @param {Object} object | |
106 * @return {?RawLocation} | |
107 */ | |
108 DebuggerScript.getGeneratorObjectLocation = function(object) | |
109 { | |
110 var mirror = MakeMirror(object); | |
111 if (!mirror.isGenerator()) | |
112 return null; | |
113 var generatorMirror = /** @type {!GeneratorMirror} */(mirror); | |
114 var funcMirror = generatorMirror.func(); | |
115 if (!funcMirror.resolved()) | |
116 return null; | |
117 var location = generatorMirror.sourceLocation() || funcMirror.sourceLocation
(); | |
118 var script = funcMirror.script(); | |
119 if (script && location) { | |
120 return { | |
121 scriptId: "" + script.id(), | |
122 lineNumber: location.line, | |
123 columnNumber: location.column | |
124 }; | |
125 } | |
126 return null; | |
127 } | |
128 | |
129 /** | |
130 * @param {!ExecutionState} execState | 105 * @param {!ExecutionState} execState |
131 * @param {!BreakpointInfo} info | 106 * @param {!BreakpointInfo} info |
132 * @return {string|undefined} | 107 * @return {string|undefined} |
133 */ | 108 */ |
134 DebuggerScript.setBreakpoint = function(execState, info) | 109 DebuggerScript.setBreakpoint = function(execState, info) |
135 { | 110 { |
136 var breakId = Debug.setScriptBreakPointById(info.sourceID, info.lineNumber,
info.columnNumber, info.condition, undefined, Debug.BreakPositionAlignment.State
ment); | 111 var breakId = Debug.setScriptBreakPointById(info.sourceID, info.lineNumber,
info.columnNumber, info.condition, undefined, Debug.BreakPositionAlignment.State
ment); |
137 var locations = Debug.findBreakPointActualLocations(breakId); | 112 var locations = Debug.findBreakPointActualLocations(breakId); |
138 if (!locations.length) | 113 if (!locations.length) |
139 return undefined; | 114 return undefined; |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 case ScopeType.Global: | 497 case ScopeType.Global: |
523 case ScopeType.With: | 498 case ScopeType.With: |
524 result = scopeObject; | 499 result = scopeObject; |
525 break; | 500 break; |
526 } | 501 } |
527 return result; | 502 return result; |
528 } | 503 } |
529 | 504 |
530 return DebuggerScript; | 505 return DebuggerScript; |
531 })(); | 506 })(); |
OLD | NEW |